feat(nav): shared sub-tabs component for settings and kitchen

Extracts the tab-bar UI into a reusable renderSubTabs() utility
(public/utils/sub-tabs.js + public/styles/sub-tabs.css) so all
sub-module navigation shares one implementation and visual style.

- Settings: replaces template-literal <nav class="settings-tabs">
  with renderSubTabs(); tabs now show icon + label (pill-style),
  group separators via separatorBefore, panel switching via onChange
- Kitchen: renderKitchenTabsBar() becomes a thin wrapper around
  renderSubTabs(); kitchen-tabs.css keeps only layout adjustment rules
- CSS: kitchen-tab* rules removed from kitchen-tabs.css,
  settings-tab-btn* rules removed from settings.css; both now
  inherit from sub-tabs.css
- tokens.css: adds --sub-tabs-height (52px default;
  kitchen overrides to --kitchen-tabs-height: 56px)
- test-browser-loader.mjs: resolves browser-absolute /utils/*.js
  imports to public/ directory for Node test compatibility

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Ulas Kalayci
2026-05-06 07:33:54 +02:00
parent c465713418
commit c4cb52d042
9 changed files with 236 additions and 220 deletions
+5
View File
@@ -25,5 +25,10 @@ export async function resolve(specifier, context, nextResolve) {
url: `data:text/javascript,${encodeURIComponent(STUBS[specifier])}`,
};
}
// Browser-absolute paths (/foo.js, /utils/bar.js) → public/foo.js, public/utils/bar.js
if (specifier.startsWith('/') && !specifier.startsWith('//')) {
const resolved = new URL('public' + specifier, import.meta.url).href;
return nextResolve(resolved, context);
}
return nextResolve(specifier, context);
}