Skip to content

feat(home): searchable skill picker in quick-action editor#2979

Merged
k11kirky merged 4 commits into
mainfrom
posthog-code/searchable-skill-picker
Jun 30, 2026
Merged

feat(home): searchable skill picker in quick-action editor#2979
k11kirky merged 4 commits into
mainfrom
posthog-code/searchable-skill-picker

Conversation

@k11kirky

Copy link
Copy Markdown
Contributor

Summary

Improves skill selection while building a quick action in the home Config tab. The skill field in ActionEditorPanel is no longer a bare <select> of names — it's now a searchable combobox that:

  • Searches across both title and description — typing filters on name and description (fuzzy, via the existing useComboboxFilter).
  • Shows the title with a truncated description for each option, so skills are distinguishable without memorizing names.
  • Keeps the full description of the selected skill shown beneath the field.

Changes

  • Extended the shared Combobox.Item primitive (Combobox.tsx + Combobox.css): added an optional description prop that renders a muted, single-line ellipsis-truncated second line. CSS lets two-line items grow to fit and keeps the selected-check top-aligned. Items without a description are unchanged, so existing consumers (TaskSelector, stories) are unaffected.
  • Rebuilt the skill picker (ActionEditorPanel.tsx): Combobox.RootTriggerContent with items={skills} and getValue={(s) => \${s.name} ${s.description}`}`, a search input, empty state, and a "N more; type to filter" hint.
  • Added a WithDescriptions Storybook story documenting the new two-line item variant.

Verification

  • pnpm build — all 8 packages succeed.
  • pnpm --filter @posthog/ui typecheck — clean.
  • biome check on all changed files — no issues.

Not yet eyeballed in the running Electron app; happy to drive it over CDP and screenshot the dropdown if useful.

Replace the plain skill `<select>` in the home Config quick-action editor
with a searchable Combobox that filters across skill name and description
and shows each skill's title plus a truncated description while picking.

- Extend the shared `Combobox.Item` with an optional `description` prop that
  renders a muted, single-line truncated second line; add supporting CSS so
  two-line items grow to fit and the selected-check stays top-aligned. Items
  without a description are unchanged.
- Rebuild the `ActionEditorPanel` skill field as `Combobox.Root` with
  `getValue` spanning name + description, a search input, empty state, and a
  "N more; type to filter" hint.
- Add a `WithDescriptions` Storybook story documenting the new item variant.

Generated-By: PostHog Code
Task-Id: d7caf7bc-b854-46b9-bfbc-af4647bb8e98
@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 4e8140b.

@greptile-apps

greptile-apps Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "feat(home): searchable skill picker in q..." | Re-trigger Greptile

Comment thread packages/ui/src/features/home/config/ActionEditorPanel.tsx Outdated
Comment thread packages/ui/src/features/home/config/ActionEditorPanel.tsx
Comment thread packages/ui/src/primitives/combobox/Combobox.stories.tsx
k11kirky added 2 commits June 29, 2026 15:17
- Show "Loading skills…" in the combobox empty state while skills load
- Use Combobox.Label instead of raw combobox-label divs (panel + story)

Generated-By: PostHog Code
Task-Id: 57b6c685-e5ae-4ce3-b8dc-4e7dd96051b1
- Only wrap items in the text-group flex column when a description is present, restoring the flat single-span DOM for the common single-line case; use a truthy guard consistent with the icon check.
- Hoist the skill search-key function to module scope so its reference is stable, avoiding needless re-runs of the combobox fuzzy filter on unrelated panel re-renders.

Generated-By: PostHog Code
Task-Id: 57b6c685-e5ae-4ce3-b8dc-4e7dd96051b1
Comment thread packages/ui/src/features/home/config/ActionEditorPanel.tsx Outdated
Address Adam's review: skill-picker filtering scored a single concatenated
"name description" string with cmdk's defaultFilter, so a hit deep in a long
description ranked as highly as a name match.

Add an opt-in `searchKeys` path to the Combobox filter, backed by fuse.js
(already a dependency, used in core/suggestions and PromptHistoryDialog):
- weighted multi-key matching (skill name 0.7, description 0.3)
- prefix matches on `getValue` promoted for exact-match priority
- falls back to the existing cmdk single-string path when `searchKeys` is
  omitted, so other combobox consumers are unaffected

Wire it into the action-editor skill picker and cover the new path with tests
(name match outranks description-only match; prefix promotion).

Generated-By: PostHog Code
Task-Id: 57b6c685-e5ae-4ce3-b8dc-4e7dd96051b1
@k11kirky k11kirky merged commit fe2df6e into main Jun 30, 2026
23 checks passed
@k11kirky k11kirky deleted the posthog-code/searchable-skill-picker branch June 30, 2026 13:25
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