diff --git a/justfile b/justfile index 5fc59258..f16df0fa 100644 --- a/justfile +++ b/justfile @@ -57,17 +57,6 @@ check: cargo fmt --all cargo clippy --all-features --all-targets -- -D warnings -# Frontend design-system / a11y guardrails — pure Node, no extra deps. -# Single gate: WCAG contrast, heading order, locale completeness, dead tokens, -# brand-mark drift. -# (Also run `stylelint static/css/**/*.css`, `biome check`, `tsc -p jsconfig.json -# --noEmit` once node_modules is installed — those need devDependencies.) -frontend-check: - node scripts/check-contrast.mjs - node scripts/check-headings.mjs - node scripts/check-locales.mjs - node scripts/check-dead-tokens.mjs - node scripts/check-brand-drift.mjs wasm-check: cd wasm/oxicloud-hash; cargo fmt --all @@ -94,7 +83,10 @@ front-dev: PROFILE=dev cargo run # front: check all (linter, format, type, icons, translations...) -front-check: front-fmt front-lint front-type front-rules front-check-icons front-check-i18n +front-check: front-fmt front-lint front-type front-rules front-check-icons front-check-i18n frontend-check + +# kept for compatibility +frontend-check: front-design front-fmt: biome format static/ @@ -116,7 +108,6 @@ front-check-icons: front-check-i18n: tools/check-missing-translations.py --check-only - # end-to-end Playwright tests front-test: cd tests/e2e && npm test @@ -125,6 +116,19 @@ front-test: front-test-update-snapshot: cd tests/e2e && npm test -- --update-snapshots=all +# Frontend design-system / a11y guardrails — pure Node, no extra deps. +# Single gate: WCAG contrast, heading order, locale completeness, dead tokens, +# brand-mark drift. +# (Also run `stylelint static/css/**/*.css`, `biome check`, `tsc -p jsconfig.json +# --noEmit` once node_modules is installed — those need devDependencies.) +front-design: + node scripts/check-contrast.mjs + node scripts/check-headings.mjs + node scripts/check-locales.mjs + node scripts/check-dead-tokens.mjs + node scripts/check-brand-drift.mjs + + # Hurl API functional tests (starts postgres + server, tears down after) api-test: bash tests/api/run.sh diff --git a/static/js/app/commandPalette.js b/static/js/app/commandPalette.js index e20d9611..551572cf 100644 --- a/static/js/app/commandPalette.js +++ b/static/js/app/commandPalette.js @@ -19,11 +19,19 @@ const state = { }; /** Click an element by selector (no-op if absent). */ +/** + * + * @param {String} selector + */ function click(selector) { /** @type {HTMLElement | null} */ (document.querySelector(selector))?.click(); } /** Activate the sidebar nav button whose label key matches `nav.
`. */ +/** + * + * @param {String} section + */ function navTo(section) { document.querySelectorAll('.nav-item').forEach((it) => { const key = it.querySelector('span[data-i18n]')?.getAttribute('data-i18n'); @@ -76,6 +84,10 @@ function render() { .join(''); } +/** + * + * @param {String} query + */ function filter(query) { const q = query.trim().toLowerCase(); state.filtered = q ? state.items.filter((c) => c.label.toLowerCase().includes(q)) : state.items.slice(); @@ -83,6 +95,11 @@ function filter(query) { render(); } +/** + * + * @param {number} delta + * @returns + */ function move(delta) { if (!state.filtered.length) return; state.index = (state.index + delta + state.filtered.length) % state.filtered.length; diff --git a/static/js/app/ui.js b/static/js/app/ui.js index 6201cacb..dc051498 100644 --- a/static/js/app/ui.js +++ b/static/js/app/ui.js @@ -1011,8 +1011,14 @@ const ui = { // Let ui.js delegation handle this container again delete filesList.dataset.managedBy; - // A clickable, flat-sorting column header (Drive-style). The arrow is - // shown only on the active column; direction toggles on re-click. + /** + * A clickable, flat-sorting column header (Drive-style). The arrow is + * shown only on the active column; direction toggles on re-click. + * @param {String} field + * @param {String} key + * @param {String} label + * @returns {String} + */ const sortCol = (field, key, label) => `