Skip to content

Commit 652a076

Browse files
committed
Merge remote-tracking branch 'origin/main' into refactor/modal-a11y
2 parents 4066568 + 4f08f0a commit 652a076

34 files changed

Lines changed: 3627 additions & 186 deletions

.oxfmtrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "./node_modules/oxfmt/configuration_schema.json",
2+
"$schema": "https://unpkg.com/oxfmt/configuration_schema.json",
33
"semi": false,
44
"singleQuote": true,
55
"arrowParens": "avoid",

.oxlintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "./node_modules/oxlint/configuration_schema.json",
2+
"$schema": "https://unpkg.com/oxlint/configuration_schema.json",
33
"plugins": ["unicorn", "typescript", "oxc", "vue", "vitest"],
44
"categories": {
55
"correctness": "error",

app/components/ClaimPackageModal.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ async function handleClaim() {
5959
6060
// Auto-approve and execute
6161
await approveOperation(operation.id)
62-
const result = await executeOperations()
62+
await executeOperations()
6363
6464
// Refresh state and check if operation completed successfully
6565
await refreshState()

app/components/CodeDirectoryListing.vue

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script setup lang="ts">
22
import type { PackageFileTree } from '#shared/types'
33
import { getFileIcon } from '~/utils/file-icons'
4+
import { formatBytes } from '~/utils/formatters'
45
56
const props = defineProps<{
67
tree: PackageFileTree[]
@@ -35,13 +36,6 @@ const parentPath = computed(() => {
3536
if (parts.length <= 1) return ''
3637
return parts.slice(0, -1).join('/')
3738
})
38-
39-
// Format file size
40-
function formatBytes(bytes: number): string {
41-
if (bytes < 1024) return `${bytes} B`
42-
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} kB`
43-
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`
44-
}
4539
</script>
4640

4741
<template>

app/components/ColumnPicker.vue

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,33 +16,23 @@ const menuRef = useTemplateRef('menuRef')
1616
const menuId = useId()
1717
1818
// Close on click outside (check both button and menu)
19-
function handleClickOutside(event: MouseEvent) {
20-
const target = event.target as Node
21-
const isOutsideButton = buttonRef.value && !buttonRef.value.contains(target)
22-
const isOutsideMenu = !menuRef.value || !menuRef.value.contains(target)
23-
if (isOutsideButton && isOutsideMenu) {
19+
onClickOutside(
20+
menuRef,
21+
() => {
2422
isOpen.value = false
25-
}
26-
}
23+
},
24+
{
25+
ignore: [buttonRef],
26+
},
27+
)
2728
2829
// Close on Escape key
29-
function handleKeydown(event: KeyboardEvent) {
30+
useEventListener('keydown', event => {
3031
if (event.key === 'Escape' && isOpen.value) {
3132
isOpen.value = false
3233
buttonRef.value?.focus()
3334
}
34-
}
35-
36-
onMounted(() => {
37-
document.addEventListener('click', handleClickOutside)
38-
document.addEventListener('keydown', handleKeydown)
3935
})
40-
41-
onUnmounted(() => {
42-
document.removeEventListener('click', handleClickOutside)
43-
document.removeEventListener('keydown', handleKeydown)
44-
})
45-
4636
// Columns that can be toggled (name is always visible)
4737
const toggleableColumns = computed(() => props.columns.filter(col => col.id !== 'name'))
4838

app/components/ConnectorModal.vue

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,22 @@ function handleDisconnect() {
2525
disconnect()
2626
}
2727
28-
function copyCommand() {
29-
let command = executeNpmxConnectorCommand.value
30-
if (portInput.value !== '31415') {
31-
command += ` --port ${portInput.value}`
32-
}
33-
copy(command)
34-
}
35-
36-
const selectedPM = useSelectedPackageManager()
37-
38-
const executeNpmxConnectorCommand = computed(() => {
39-
return getExecuteCommand({
40-
packageName: 'npmx-connector',
41-
packageManager: selectedPM.value,
42-
})
43-
})
28+
// function copyCommand() {
29+
// let command = executeNpmxConnectorCommand.value
30+
// if (portInput.value !== '31415') {
31+
// command += ` --port ${portInput.value}`
32+
// }
33+
// copy(command)
34+
// }
35+
36+
// const selectedPM = useSelectedPackageManager()
37+
38+
// const executeNpmxConnectorCommand = computed(() => {
39+
// return getExecuteCommand({
40+
// packageName: 'npmx-connector',
41+
// packageManager: selectedPM.value,
42+
// })
43+
// })
4444
</script>
4545

4646
<template>

app/components/HeaderAccountMenu.client.vue

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,16 @@ const hasBothConnections = computed(() => isNpmConnected.value && !!atprotoUser.
2323
/** Only show count of active (pending/approved/running) operations */
2424
const operationCount = computed(() => activeOperations.value.length)
2525
26-
function handleClickOutside(event: MouseEvent) {
27-
const target = event.target as HTMLElement
28-
if (!target.closest('.account-menu')) {
29-
isOpen.value = false
30-
}
31-
}
26+
const accountMenuRef = useTemplateRef('accountMenuRef')
27+
28+
onClickOutside(accountMenuRef, () => {
29+
isOpen.value = false
30+
})
3231
33-
function handleKeydown(event: KeyboardEvent) {
32+
useEventListener('keydown', event => {
3433
if (event.key === 'Escape' && isOpen.value) {
3534
isOpen.value = false
3635
}
37-
}
38-
39-
onMounted(() => {
40-
document.addEventListener('click', handleClickOutside)
41-
})
42-
43-
onUnmounted(() => {
44-
document.removeEventListener('click', handleClickOutside)
4536
})
4637
4738
const connectorModal = useModal('connector-modal')
@@ -64,7 +55,7 @@ function openAuthModal() {
6455
</script>
6556

6657
<template>
67-
<div class="account-menu relative" @keydown="handleKeydown">
58+
<div ref="accountMenuRef" class="relative">
6859
<button
6960
type="button"
7061
class="relative flex items-center justify-end gap-2 px-2 py-1.5 min-w-24 rounded-md transition-colors duration-200 hover:bg-bg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fg/50"

app/components/OrgMembersPanel.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ watch(lastExecutionTime, () => {
433433
:to="{ name: '~username', params: { username: member.name } }"
434434
class="font-mono text-sm text-fg hover:text-fg transition-colors duration-200"
435435
>
436-
@{{ member.name }}
436+
~{{ member.name }}
437437
</NuxtLink>
438438
<span
439439
class="px-1.5 py-0.5 font-mono text-xs border rounded"

app/components/OrgTeamsPanel.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ watch(lastExecutionTime, () => {
423423
:to="{ name: '~username', params: { username: user } }"
424424
class="font-mono text-sm text-fg-muted hover:text-fg transition-colors duration-200"
425425
>
426-
@{{ user }}
426+
~{{ user }}
427427
</NuxtLink>
428428
<span class="font-mono text-sm text-fg">{{ teamName }}</span>
429429
<button

app/components/PackageCard.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ const isExactMatch = computed(() => {
8787
class="flex items-center gap-1.5"
8888
>
8989
<dt class="sr-only">{{ $t('package.card.publisher') }}</dt>
90-
<dd class="font-mono">@{{ result.package.publisher.username }}</dd>
90+
<dd class="font-mono">{{ result.package.publisher.username }}</dd>
9191
</div>
9292
<div v-if="result.package.date" class="flex items-center gap-1.5">
9393
<dt class="sr-only">{{ $t('package.card.updated') }}</dt>

0 commit comments

Comments
 (0)