From c6b87b74ae071922a39d3fd124b3147fe57a03c1 Mon Sep 17 00:00:00 2001 From: Marcos Paulo Date: Sat, 5 Sep 2026 07:08:45 +0000 Subject: [PATCH] feat(blocks): add FileTabs for review desk package switcher Static markup-only component for the package-file switcher inside the preview surface. Renders one button per file with the kind eyebrow and file name; applies the 'active' class on the current file. Click handling is task 16. The dark tab strip uses --deep for the surface and --gold for the active state; close to the legacy palette but with a few mid-tones documented in the task report. Did not: extract the eyebrow into a separate component (it is a two-property chip, not a reusable element); introduce client: directives. --- src/components/blocks/FileTabs.astro | 97 ++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 src/components/blocks/FileTabs.astro diff --git a/src/components/blocks/FileTabs.astro b/src/components/blocks/FileTabs.astro new file mode 100644 index 0000000..4022b6f --- /dev/null +++ b/src/components/blocks/FileTabs.astro @@ -0,0 +1,97 @@ +--- +// FileTabs — the package-file switcher inside the preview surface. +// +// A horizontal scroll of buttons, one per file in the submitted package +// (SKILL.md + references + scripts + templates). Click handling and the +// fetch-state machine are task 16's job; this component ships zero JS. +// +// `aria-label` is on the nav itself so the tablist announces as a unit. +// The `active` class on the selected file mirrors the legacy CSS so the +// verification engineer can re-point scripts/verify.mjs assertions without +// renaming. + +interface PackageFile { + /** File name without directory prefix; the row label. */ + name: string; + /** Kind tag rendered as the small uppercase eyebrow above the name. */ + kind: string; + /** Absolute or repo-relative path used to fetch the source. */ + path: string; +} + +interface Props { + files: PackageFile[]; + /** Name of the currently-selected file. */ + currentFile?: string; + /** Accessible label for the tablist. Defaults to the skill-package label. */ + ariaLabel?: string; +} + +const { files, currentFile, ariaLabel = 'Skill package files' } = Astro.props; +--- + + + +