fix(ui): accessibility check targets the New task dialog; keep focus outlines on dock handles (#1963)
This commit is contained in:
3 files changed
+9
-6
No files matched your search
@@ -13,7 +13,7 @@ module.exports = async ({ page, go, shot, fail, settled, tolerate }) => {
|
|||||||
await go('/tasks');
|
await go('/tasks');
|
||||||
await page.getByRole('button', { name: 'Jump to', exact: true }).click();
|
await page.getByRole('button', { name: 'Jump to', exact: true }).click();
|
||||||
await page.getByRole('option', { name: 'New task', exact: true }).click();
|
await page.getByRole('option', { name: 'New task', exact: true }).click();
|
||||||
const dialog = page.getByRole('dialog');
|
const dialog = page.getByRole('dialog', { name: 'New task' });
|
||||||
await dialog.waitFor();
|
await dialog.waitFor();
|
||||||
await settled();
|
await settled();
|
||||||
const bounds = await dialog.boundingBox();
|
const bounds = await dialog.boundingBox();
|
||||||
|
|||||||
+6
-3
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from "vue";
|
import { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from "vue";
|
||||||
import { errors } from "@/copy/errors";
|
import { errors } from "@/copy/errors";
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { START_LOCATION, useRoute, useRouter } from "vue-router";
|
||||||
|
|
||||||
import AccountEntry from "@/accounts/AccountEntry.vue";
|
import AccountEntry from "@/accounts/AccountEntry.vue";
|
||||||
import { useAccountsStore } from "@/accounts/accounts";
|
import { useAccountsStore } from "@/accounts/accounts";
|
||||||
@@ -48,10 +48,13 @@ watch(() => [route.path, accounts.instance], () => {
|
|||||||
const scope = route.meta.org ? "Organisation" : route.meta.settings ? "Instance" : "";
|
const scope = route.meta.org ? "Organisation" : route.meta.settings ? "Instance" : "";
|
||||||
document.title = [route.meta.label || errors.base.notFound.title, scope, "Archie", accounts.instance].filter(Boolean).join(" | ");
|
document.title = [route.meta.label || errors.base.notFound.title, scope, "Archie", accounts.instance].filter(Boolean).join(" | ");
|
||||||
}, { immediate: true });
|
}, { immediate: true });
|
||||||
watch(() => route.path, async () => {
|
// A page load keeps focus at the top so the skip link is the first keyboard
|
||||||
|
// stop; later navigations move focus to the new page.
|
||||||
|
router.afterEach(async (to, from) => {
|
||||||
|
if (from === START_LOCATION || to.path === from.path) return;
|
||||||
await nextTick();
|
await nextTick();
|
||||||
main.value?.focus({ preventScroll: true });
|
main.value?.focus({ preventScroll: true });
|
||||||
}, { flush: "post" });
|
});
|
||||||
|
|
||||||
onMounted(() => {void accounts.load();});
|
onMounted(() => {void accounts.load();});
|
||||||
// A failed startup read retries on an interval, so a proxy or daemon that
|
// A failed startup read retries on an interval, so a proxy or daemon that
|
||||||
|
|||||||
@@ -437,7 +437,7 @@ function onPinKey(event: KeyboardEvent): void {
|
|||||||
:aria-valuemin="dir === 'n' || dir === 's' ? MIN_H : MIN_W"
|
:aria-valuemin="dir === 'n' || dir === 's' ? MIN_H : MIN_W"
|
||||||
:aria-valuemax="dir === 'n' || dir === 's' ? vh : vw"
|
:aria-valuemax="dir === 'n' || dir === 's' ? vh : vw"
|
||||||
:data-resize="dir"
|
:data-resize="dir"
|
||||||
:class="cn('absolute z-10 touch-none hover:bg-primary/30 focus-visible:bg-primary/50 focus-visible:outline-none', HANDLE_CLASS[dir])"
|
:class="cn('absolute z-10 touch-none hover:bg-primary/30 focus-visible:bg-primary/50', HANDLE_CLASS[dir])"
|
||||||
@keydown="onHandleKey(dir, $event)"
|
@keydown="onHandleKey(dir, $event)"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
@@ -451,7 +451,7 @@ function onPinKey(event: KeyboardEvent): void {
|
|||||||
:aria-valuemin="MIN_W"
|
:aria-valuemin="MIN_W"
|
||||||
:aria-valuemax="pinMax"
|
:aria-valuemax="pinMax"
|
||||||
data-resize="pin"
|
data-resize="pin"
|
||||||
class="absolute inset-y-0 z-10 w-1.5 cursor-col-resize touch-none hover:bg-primary/30 focus-visible:bg-primary/50 focus-visible:outline-none"
|
class="absolute inset-y-0 z-10 w-1.5 cursor-col-resize touch-none hover:bg-primary/30 focus-visible:bg-primary/50"
|
||||||
:class="mode === 'left' ? '-right-0.5' : '-left-0.5'"
|
:class="mode === 'left' ? '-right-0.5' : '-left-0.5'"
|
||||||
@keydown="onPinKey"
|
@keydown="onPinKey"
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in new issue
Block a user