Skip to content

svdoc: pilot shared @nais/ui in documentation search - #925

Merged
rbjornstad merged 1 commit into
mainfrom
investigate/nais-ui-pilot
Nov 13, 2026
Merged

rbjornstad merged 1 commit into
mainfrom
investigate/nais-ui-pilot

Conversation

@rbjornstad

Copy link
Copy Markdown
Contributor

Summary

  • Consume exact @nais/ui@0.1.0 from the public Nais Google Artifact Registry without authentication. Preserve npm configuration and exempt @nais/ui from the release-age delay.
  • Use the shared Modal through the existing local adapter for documentation search, preserving accessible name/description, dimensions, scrolling, mobile layout and unmounting of search content. Replace the focus timeout with Bits UI autofocus and focus return.
  • Keep the root Theme, production buttons, fonts, resets and palette overrides local. Exercise package Button and nested Theme in an isolated browser fixture. No full-app migration or package changes.
  • Add SSR tests and zero-retry Playwright coverage; document installation and package-boundary limitations. No local tarball dependencies remain.

Validation

  • Frozen-lockfile installation passes.
  • mise run check passes: formatting, ESLint, Svelte/type checks (0 errors/warnings), 54 unit tests and Action pinning.
  • Production builds pass for nav, ssb, test-nais, ldir, atil, ci-nais, dev-nais, miljodir and novari.
  • All 12 Chromium tests pass against both dev and the prerendered nav build without retries: SSR/hydration diagnostics, light/dark and nested themes, theme-scoped portals, keyboard search, focus trap/return, Escape, close button, backdrop, host styling, mounting and widths 375/800/801/1280px.
  • Production CSS assertions compare computed colors rather than source hex spelling to handle minification; expected visual values are unchanged.

Known limitations / follow-up

  • Existing runed@0.35.1 optional peer warning: SvelteKit ^2.21.0 declared, doc uses 3.2.0. This predates the pilot through the existing Bits UI dependency. Dialog code uses runed, not runed/kit. No overrides or warning suppression added.
  • The package pins Bits UI 2.20.2 and Lucide 1.63.0 alongside newer doc versions. The adapter relies on package layer/header/body CSS classes; public styling, accessibility and lifecycle hooks remain upstream considerations.
  • Browser tests ran locally in Chromium; Firefox/WebKit and browser-test CI integration are not included.
  • No changes to console-frontend or m8e.

Consume published @nais/ui 0.1.0 through the local Modal adapter while preserving doc styles, accessible naming and search behavior. Add SSR and browser coverage for themes, portals, keyboard focus and mobile layouts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the documentation-search UI pilot.

No open issues 🎉

1 file not reviewed
  • svdoc/pnpm-lock.yaml: Generated file
What changed in this PR

This PR pilots @nais/ui@0.1.0 in documentation search through the existing Modal adapter, while keeping the site’s root theme, production buttons and styling local.

Changes:

  • Configure the public package registry, pin the shared UI dependency and exempt it from the release-age delay.
  • Adapt the shared Modal to preserve search accessibility, layout and unmounting, replacing timeout-based focus with Bits UI behavior.
  • Add server-rendering and zero-retry browser tests, an isolated component fixture and installation guidance.
File Description
svdoc/​tsconfig.json Include browser tests and Playwright configuration in type checking.
svdoc/​tests/​browser/​vite.config.ts Configure the isolated fixture server.
svdoc/​tests/​browser/​search.spec.ts Test search behavior, focus, themes and responsive styling.
svdoc/​tests/​browser/​pilot.ts Mount the browser fixture.
svdoc/​tests/​browser/​Pilot.svelte Exercise package buttons, nested themes and modal lifecycle.
svdoc/​tests/​browser/​pilot.html Provide the fixture’s HTML entry point.
svdoc/​src/​routes/​+layout.svelte Expose hydration readiness for browser tests.
svdoc/​src/​lib/​shadcn/​ui/​Modal.test.ts Test server rendering with the modal open and closed.
svdoc/​src/​lib/​shadcn/​ui/​Modal.svelte Wrap the package Modal with local accessibility, lifecycle and styling adaptations.
svdoc/​src/​lib/​SearchModal.svelte Remove timeout-based input focus.
svdoc/​src/​css/​app.css Import package tokens and theme styles alongside local styles.
svdoc/​README.md Document setup, test coverage and package limitations.
svdoc/​pnpm-workspace.yaml Exempt @nais/ui from the release-age delay.
svdoc/​pnpm-lock.yaml Lock the shared UI and Playwright dependencies.
svdoc/​playwright.config.ts Configure zero-retry tests and app/fixture servers.
svdoc/​package.json Add shared UI, Playwright and the browser-test script.
svdoc/​.npmrc Map the Nais scope to the public registry.
svdoc/​.gitignore Ignore browser-test results and reports.

Review effort: Balanced

@rbjornstad
rbjornstad merged commit 7beddee into main Nov 13, 2026
8 checks passed
@rbjornstad
rbjornstad deleted the investigate/nais-ui-pilot branch November 13, 2026 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants