Skip to content

Commit cffeb51

Browse files
cevhericlaude
andcommitted
fix: palette focus trap, Results scroll-to-top action, namespaced rerun keyframe
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 4195885 commit cffeb51

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

src/components/studio/QueryChrome.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const { section, class: className = '' } = Astro.props;
6060
<!-- Results tabs -->
6161
<div class="flex items-center justify-between gap-3 border-t border-edge px-4 text-[12px]">
6262
<div class="flex items-center gap-4 overflow-x-auto py-2.5 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden">
63-
<span class="whitespace-nowrap font-semibold text-fg shadow-[inset_0_-2px_0_var(--color-primary)] pb-0.5">▦ Results</span>
63+
<button type="button" class="whitespace-nowrap font-semibold text-fg shadow-[inset_0_-2px_0_var(--color-primary)] pb-0.5" data-action="results"><span aria-hidden="true">▦</span> Results</button>
6464
<button type="button" class="whitespace-nowrap text-faint hover:text-fg" data-action="explain" aria-expanded="false" aria-controls={`explain-${section.id}`}><span aria-hidden="true">⚡</span> Explain</button>
6565
<button type="button" class="whitespace-nowrap text-faint hover:text-fg" data-action="notice" data-notice="history"><span aria-hidden="true">↺</span> History</button>
6666
<button type="button" class="whitespace-nowrap text-faint hover:text-fg" data-action="notice" data-notice="saved"><span aria-hidden="true">⭐</span> Saved</button>

src/scripts/studio.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,10 @@ function init() {
370370
if (action === 'copy-link') { e.preventDefault(); copyLink(); }
371371
if (action === 'export') { e.preventDefault(); exportSection(); }
372372
if (action === 'palette') { e.preventDefault(); openPalette(); }
373+
if (action === 'results') {
374+
e.preventDefault();
375+
document.querySelector(`[data-section="${currentHash()}"] .studio-results`)?.scrollTo({ top: 0, behavior: 'smooth' });
376+
}
373377
});
374378

375379
// Hash routing — hashchange covers in-page link nav; popstate covers
@@ -390,6 +394,7 @@ function init() {
390394
const root = document.querySelector('[data-palette-root]');
391395
if (!root || root.hasAttribute('hidden')) return;
392396
if (e.key === 'Escape') { e.preventDefault(); closePalette(); }
397+
else if (e.key === 'Tab') { e.preventDefault(); (document.querySelector('[data-palette-input]') as HTMLElement | null)?.focus(); }
393398
else if (e.key === 'ArrowDown') { e.preventDefault(); setHighlight(Math.min(paletteHighlight + 1, paletteFiltered.length - 1)); }
394399
else if (e.key === 'ArrowUp') { e.preventDefault(); setHighlight(Math.max(paletteHighlight - 1, 0)); }
395400
else if (e.key === 'Enter') { e.preventDefault(); paletteFiltered[paletteHighlight]?.run(); closePalette(); }

src/styles/global.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@
112112
}
113113

114114
/* RUN re-run shimmer on the active result pane */
115-
@keyframes rerun-fade { 0% { opacity: 0.35; } 100% { opacity: 1; } }
116-
.studio-results.is-rerunning { animation: rerun-fade 0.5s ease; }
115+
@keyframes studio-rerun-fade { 0% { opacity: 0.35; } 100% { opacity: 1; } }
116+
.studio-results.is-rerunning { animation: studio-rerun-fade 0.5s ease; }
117117
@media (prefers-reduced-motion: reduce) {
118118
.studio-results.is-rerunning { animation: none; }
119119
}

0 commit comments

Comments
 (0)