From 4a0392acca80ea40e030f8e193337a762cfce6b7 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Wed, 19 Aug 2026 21:12:00 -0400 Subject: [PATCH 1/7] Fix the addon typecheck so template modifiers resolve `{{on}}` did not typecheck anywhere in `src/`, because two tsconfig settings disagreed with what Glint needs: - `moduleResolution: node16` stopped Glint's module augmentations from attaching, so `on` stayed the bare `Opaque<"modifier:on">` that ember-source declares and no `resolve` overload accepted it. - `types` named `@glint/ember-tsc`, which is the tool's own API, rather than `@glint/ember-tsc/types`, which is the file that carries those augmentations. `types` also read ember-source out of `docs-app/node_modules`. It reads the addon's own copy now. With the augmentations attached, a real error appears: `getSignature` returns `undefined` when a declaration carries no signature, and the union check does not narrow that away. Co-Authored-By: Claude Opus 5 (1M context) --- src/browser/typedoc/signature/component.gts | 2 +- tsconfig.json | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/browser/typedoc/signature/component.gts b/src/browser/typedoc/signature/component.gts index 0c7d6014..bfe15224 100644 --- a/src/browser/typedoc/signature/component.gts +++ b/src/browser/typedoc/signature/component.gts @@ -174,7 +174,7 @@ export const ComponentSignature: TOC<{ {{/each}} - {{else}} + {{else if info}} {{/if}} diff --git a/tsconfig.json b/tsconfig.json index 3fba1ce7..fe692255 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,11 +11,11 @@ "isolatedModules": true, // @tsconfig/node22 - "module": "node16", + "module": "esnext", "target": "es2022", "esModuleInterop": true, "skipLibCheck": true, - "moduleResolution": "node16", + "moduleResolution": "bundler", // My options "rootDir": "./src", @@ -33,6 +33,6 @@ "declaration": true, // Compat "allowSyntheticDefaultImports": true, - "types": ["./docs-app/node_modules/ember-source/types/stable", "unplugin", "@glint/ember-tsc"] + "types": ["ember-source/types", "unplugin", "@glint/ember-tsc/types"] } } From f3b7e203eb06958248b89db8e6445c3c4df16d0b Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Wed, 19 Aug 2026 21:12:10 -0400 Subject: [PATCH 2/7] Add : site-wide search as a command palette `` is `` from ember-primitives, filled in with what `searcher` ranks. It renders a trigger button and a modal ``, and it needs nothing configured: the `docs()` plugin already wrote every page's title, headings, and prose into the compiled docs. The `:trigger` block replaces the button, and is yielded `open` and the modifier that returns focus to it. The `:result` block replaces the group, title, and excerpt. `stripFormatting` now drops inline HTML, keeping the text it wrapped, so an excerpt reads "press K" rather than "press K". Lowercase tag names only, so a component written in prose survives. The palette's own stylesheet answers frameworks that style a bare `dialog` as a full-screen box around an `
`: `min-width: 100%` outranks any width the palette sets, and centring the children squashes it. Co-Authored-By: Claude Opus 5 (1M context) --- docs-app/package.json | 2 +- docs-app/src/styles/app.css | 41 +++ docs-app/src/templates/application.gts | 82 +----- docs/navigation/meta.json | 2 +- docs/navigation/search.gjs.md | 110 ++++++++ docs/navigation/search.json | 1 + package.json | 2 +- pnpm-lock.yaml | 118 +++++---- src/browser/components.ts | 2 + src/browser/components/search.css | 186 +++++++++++++ src/browser/components/search.gts | 246 ++++++++++++++++++ .../services/search/strip-formatting.test.ts | 31 +++ .../services/search/strip-formatting.ts | 32 ++- .../markdown-only/app/routes/application.ts | 5 +- .../app/templates/application.gts | 3 +- test-apps/markdown-only/package.json | 2 +- .../tests/search-component-test.ts | 90 +++++++ 17 files changed, 799 insertions(+), 156 deletions(-) create mode 100644 docs/navigation/search.gjs.md create mode 100644 docs/navigation/search.json create mode 100644 src/browser/components/search.css create mode 100644 src/browser/components/search.gts create mode 100644 src/browser/services/search/strip-formatting.test.ts create mode 100644 test-apps/markdown-only/tests/search-component-test.ts diff --git a/docs-app/package.json b/docs-app/package.json index 6ed0fa70..fb616a1a 100644 --- a/docs-app/package.json +++ b/docs-app/package.json @@ -60,7 +60,7 @@ "ember-eslint": "^0.7.0", "ember-modifier": "^4.3.0", "ember-page-title": "^9.0.3", - "ember-primitives": "^0.61.1", + "ember-primitives": "^0.62.0", "ember-qunit": "^9.1.0", "ember-resolver": "^13.2.0", "ember-resources": "^7.1.0", diff --git a/docs-app/src/styles/app.css b/docs-app/src/styles/app.css index ca9bb07b..17f55006 100644 --- a/docs-app/src/styles/app.css +++ b/docs-app/src/styles/app.css @@ -32,6 +32,47 @@ a[data-search-result]:is(:hover, :focus, :active) { text-decoration: none; } +/* + * in pico's colours. The component brings its own layout; these + * are the only values it asks for. + */ +:root { + --kolay-search-bg: var(--pico-background-color); + --kolay-search-fg: var(--pico-color); + --kolay-search-muted: var(--pico-muted-color); + --kolay-search-border: var(--pico-muted-border-color); + --kolay-search-accent: var(--pico-primary); + --kolay-search-active: color-mix(in oklab, var(--pico-primary), transparent 88%); +} + +/* the palette's results are anchors too, and pico reaches them the same way */ +a.kolay__search__result, +a.kolay__search__result:is(:hover, :focus, :active) { + --pico-color: inherit; + --pico-background-color: inherit; + color: inherit; + text-decoration: none; +} + +/* + * The palette's input. Pico reaches every text input through a selector that + * carries an attribute, which outranks the component's single class, and + * gives it a box and a bottom margin the palette does not want. + */ +input.kolay__search__input { + margin: 0; + padding: 0; + border: none; + background: none; + box-shadow: none; +} + +/* the header's middle column, where the old search form used to sit */ +header .kolay__search__trigger { + flex: 1; + max-width: 24rem; +} + /* * The shine's colours. Kept as their own names so the sweep can be retuned in * one place: the site's primary at the leading edge, running through violet diff --git a/docs-app/src/templates/application.gts b/docs-app/src/templates/application.gts index 45b8a298..5f6977ac 100644 --- a/docs-app/src/templates/application.gts +++ b/docs-app/src/templates/application.gts @@ -7,9 +7,8 @@ import { pascalCase, sentenceCase } from 'change-case'; // @ts-expect-error no types for the mobile-menu import MenuWrapper from 'ember-mobile-menu/components/mobile-menu-wrapper'; import { pageTitle } from 'ember-page-title'; -import { Form } from 'ember-primitives/components/form'; import Route from 'ember-route-template'; -import { GroupNav, PageNav } from 'kolay/components'; +import { GroupNav, PageNav, Search } from 'kolay/components'; import rememberDocumentScroll from 'memory-scroll/modifiers/remember-document-scroll'; import { ExternalLink } from 'nvp.ui'; @@ -73,83 +72,6 @@ const Menu: TOC<{ Element: SVGElement }> = ; -class HeaderSearch extends Component<{ Args: Record }> { - @service declare router: RouterService; - - get isSearchRoute() { - return this.router.currentRouteName === 'search'; - } - - submit = (data: { q?: string }) => { - const q = data.q ?? ''; - - this.router.transitionTo('search', { queryParams: { q } }); - }; - - -} - const SideNav: TOC<{ Element: HTMLElement }> =