Skip to content

Commit df9b58b

Browse files
Merge branch 'main' into refactor/remove-redirect-on-typing
2 parents 954e5b5 + d206a7a commit df9b58b

52 files changed

Lines changed: 787 additions & 214 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/autofix.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ jobs:
3434
- name: 📦 Install browsers
3535
run: pnpm playwright install
3636

37+
- name: 🌐 Compare translations
38+
run: pnpm i18n:check
39+
3740
- name: 🌍 Update lunaria data
3841
run: pnpm build:lunaria
3942

CONTRIBUTING.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,23 @@ To add a new locale:
284284

285285
Check [Pluralization rule callback](https://vue-i18n.intlify.dev/guide/essentials/pluralization.html#custom-pluralization) for more info.
286286

287+
### Update translation
288+
289+
We track the current progress of translations with [Lunaria](https://lunaria.dev/) on this site: https://i18n.npmx.dev/
290+
If you see any outdated translations in your language, feel free to update the keys to match then English version.
291+
292+
In order to make sure you have everything up-to-date, you can run:
293+
294+
```bash
295+
pnpm i18n:check <country-code>
296+
```
297+
298+
For example to check if all Japanese translation keys are up-to-date, run:
299+
300+
```bash
301+
pnpm i18n:check ja-JP
302+
```
303+
287304
#### Country variants (advanced)
288305

289306
Most languages only need a single locale file. Country variants are only needed when you want to support regional differences (e.g., `es-ES` for Spain vs `es-419` for Latin America).

app/components/AnnounceTooltip.vue

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<script setup lang="ts">
2+
const props = defineProps<{
3+
/** Tooltip text */
4+
text: string
5+
/** Position: 'top' | 'bottom' | 'left' | 'right' */
6+
position?: 'top' | 'bottom' | 'left' | 'right'
7+
/** is tooltip visible */
8+
isVisible: boolean
9+
}>()
10+
</script>
11+
12+
<template>
13+
<BaseTooltip :text :isVisible :position :tooltip-attr="{ 'aria-live': 'polite' }"
14+
><slot
15+
/></BaseTooltip>
16+
</template>

app/components/AppHeader.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const { isConnected, npmUser } = useConnector()
1212
1313
const router = useRouter()
1414
15-
const showFullSearch = ref(false)
15+
const showFullSearch = shallowRef(false)
1616
1717
onKeyStroke(',', e => {
1818
// Don't trigger if user is typing in an input

app/components/AppTooltip.vue

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,6 @@ const props = defineProps<{
99
const isVisible = shallowRef(false)
1010
const tooltipId = useId()
1111
12-
const positionClasses: Record<string, string> = {
13-
top: 'bottom-full inset-is-1/2 -translate-x-1/2 mb-1',
14-
bottom: 'top-full inset-is-0 mt-1',
15-
left: 'inset-ie-full top-1/2 -translate-y-1/2 me-2',
16-
right: 'inset-is-full top-1/2 -translate-y-1/2 ms-2',
17-
}
18-
19-
const tooltipPosition = computed(() => positionClasses[props.position || 'bottom'])
20-
2112
function show() {
2213
isVisible.value = true
2314
}
@@ -28,31 +19,16 @@ function hide() {
2819
</script>
2920

3021
<template>
31-
<div
32-
class="relative inline-flex"
33-
:aria-describedby="isVisible ? tooltipId : undefined"
22+
<BaseTooltip
23+
:text
24+
:isVisible
25+
:position
26+
:tooltip-attr="{ role: 'tooltip', id: tooltipId }"
3427
@mouseenter="show"
3528
@mouseleave="hide"
3629
@focusin="show"
3730
@focusout="hide"
38-
>
39-
<slot />
40-
41-
<Transition
42-
enter-active-class="transition-opacity duration-150 motion-reduce:transition-none"
43-
leave-active-class="transition-opacity duration-100 motion-reduce:transition-none"
44-
enter-from-class="opacity-0"
45-
leave-to-class="opacity-0"
46-
>
47-
<div
48-
v-if="isVisible"
49-
:id="tooltipId"
50-
role="tooltip"
51-
class="absolute px-2 py-1 font-mono text-xs text-fg bg-bg-elevated border border-border rounded shadow-lg whitespace-nowrap z-[100] pointer-events-none"
52-
:class="tooltipPosition"
53-
>
54-
{{ text }}
55-
</div>
56-
</Transition>
57-
</div>
31+
:aria-describedby="isVisible ? tooltipId : undefined"
32+
><slot
33+
/></BaseTooltip>
5834
</template>

app/components/AuthButton.client.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
const showModal = ref(false)
2+
const showModal = shallowRef(false)
33
const { user } = useAtproto()
44
</script>
55

app/components/AuthButton.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
const showModal = ref(false)
2+
const showModal = shallowRef(false)
33
const { user } = useAtproto()
44
</script>
55

app/components/AuthModal.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script setup lang="ts">
22
const open = defineModel<boolean>('open', { default: false })
33
4-
const handleInput = ref('')
4+
const handleInput = shallowRef('')
55
66
const { user, logout } = useAtproto()
77

app/components/BaseTooltip.vue

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<script setup lang="ts">
2+
import type { HTMLAttributes } from 'vue'
3+
4+
const props = defineProps<{
5+
/** Tooltip text */
6+
text: string
7+
/** Position: 'top' | 'bottom' | 'left' | 'right' */
8+
position?: 'top' | 'bottom' | 'left' | 'right'
9+
/** is tooltip visible */
10+
isVisible: boolean
11+
/** attributes for tooltip element */
12+
tooltipAttr?: HTMLAttributes
13+
}>()
14+
15+
const positionClasses: Record<string, string> = {
16+
top: 'bottom-full inset-is-1/2 -translate-x-1/2 mb-1',
17+
bottom: 'top-full inset-is-0 mt-1',
18+
left: 'inset-ie-full top-1/2 -translate-y-1/2 me-2',
19+
right: 'inset-is-full top-1/2 -translate-y-1/2 ms-2',
20+
}
21+
22+
const tooltipPosition = computed(() => positionClasses[props.position || 'bottom'])
23+
</script>
24+
25+
<template>
26+
<div class="relative inline-flex">
27+
<slot />
28+
29+
<Transition
30+
enter-active-class="transition-opacity duration-150 motion-reduce:transition-none"
31+
leave-active-class="transition-opacity duration-100 motion-reduce:transition-none"
32+
enter-from-class="opacity-0"
33+
leave-to-class="opacity-0"
34+
>
35+
<div
36+
v-if="props.isVisible"
37+
class="absolute px-2 py-1 font-mono text-xs text-fg bg-bg-elevated border border-border rounded shadow-lg whitespace-nowrap z-[100] pointer-events-none"
38+
:class="tooltipPosition"
39+
v-bind="tooltipAttr"
40+
>
41+
{{ text }}
42+
</div>
43+
</Transition>
44+
</div>
45+
</template>

app/components/ColumnPicker.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const emit = defineEmits<{
1010
reset: []
1111
}>()
1212
13-
const isOpen = ref(false)
13+
const isOpen = shallowRef(false)
1414
const buttonRef = useTemplateRef('buttonRef')
1515
const menuRef = useTemplateRef('menuRef')
1616
const menuId = useId()

0 commit comments

Comments
 (0)