Skip to content

FE-1558: Fuzzy-search prototypes for the ad-hoc scenario form - #9453

Draft
kube wants to merge 2 commits into
cf/fe-1518-optimization-constraintsfrom
cf/fe-1558-form-search-prototypes
Draft

FE-1558: Fuzzy-search prototypes for the ad-hoc scenario form#9453
kube wants to merge 2 commits into
cf/fe-1518-optimization-constraintsfrom
cf/fe-1558-form-search-prototypes

Conversation

@kube

@kube kube commented Aug 30, 2026

Copy link
Copy Markdown
Collaborator

🌟 What is the purpose of this PR?

Stacked on #9371. Four playable Storybook prototypes for fuzzy-finding parameters, Variables, and places in the ad-hoc scenario form, layered over the real form with a large generated fixture, so the interaction patterns can be compared and one picked.

🔗 Related links

🔍 What does this change?

Everything lives under src/ui/dev/form-search-prototypes/ (Storybook-only, nothing ships; see its README). Open Dev / Form Search Prototypes:

  • A · Command palette — ⌘K overlay with a ranked, kind-chipped, match-highlighted list; Enter jumps: scroll, focus (focus is selection in the worksheet model), amber flash on the landing trigger.
  • B · Filter in place — a persistent box that dims every non-matching row, keeping matches in their spatial context, with an honest "n of m names match" count.
  • C · Quickfind/ opens a browser-find bar; Enter/Shift+Enter cycle the focus flash through matches while the bar keeps the keyboard; Escape hands focus to the current match.
  • D · Outline rail — a permanent grouped index beside the form with a filter on top; doubles as a map of the model.
  • Shared, unit-tested core: an fzf-style fuzzy scorer (word-start/consecutive bonuses, with a feasibility guard so a camelCase anchor cannot strand the rest of the query) and a name index whose entries carry the form's real adHocTargetLabel aria-labels, so jumps resolve against the actual triggers.
  • The harness mounts the REAL AdHocScenarioForm (live LSP + Monaco) with a generated bottling-plant fixture: 18 parameters, 12 Variables, 12 places, per-place variables.

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • does not modify any publishable blocks or libraries, or modifications do not need publishing

Files sit inside @hashintel/petrinaut but are Storybook-only (no shipped entry point imports them).

📜 Does this require a change to the docs?

The changes in this PR:

  • are internal and do not require a docs change

🕸️ Does this require a change to the Turbo Graph?

The changes in this PR:

  • do not affect the execution graph

⚠️ Known issues

  • B's dimming is painted onto the rendered rows from outside the form (prototype-grade); a shipped filter would thread through the form's rendering instead.
  • Jumps cannot enter collapsed places (the worksheet skips collapsed members); the fixture renders expanded, and a shipped version would expand on jump.

🐾 Next steps

  • Pick a pattern (A and B compose well: one index, palette + in-place dimming) and decide where it ships — the form itself vs each host panel.

🛡 What tests cover this?

  • fuzzy.test.ts (11 tests): subsequence matching, word-start preference and its feasibility guard, positions for highlighting, ranking, and the index's aria-label conventions against the big fixture.

❓ How to test this?

  1. yarn exec turbo run dev --filter @hashintel/petrinaut and open Storybook (port 6006).
  2. Open Dev / Form Search Prototypes, stories A–D.
  3. A: ⌘K, type a fragment ("filltime", "breakroom"), Enter — the form scrolls and the landing cell flashes. B: type "rate" and watch non-matches dim. C: press /, type, Enter repeatedly. D: filter and click in the rail.

📹 Demo

Screenshots pending — placeholder for drag-drop.

@vercel

vercel Bot commented Aug 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hash Ready Ready Preview Sep 2, 2026 2:08am UTC
petrinaut Ready Ready Preview Sep 2, 2026 2:08am UTC
petrinaut-docs Ready Ready Preview Sep 2, 2026 2:08am UTC
1 Skipped Deployment
Project Deployment Actions Updated
hashdotdesign-tokens Ignored Ignored Preview Sep 2, 2026 2:08am UTC

Request Review

@github-actions github-actions Bot added area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > frontend Owned by the @frontend team area/apps > hash.design Affects the `hash.design` design site (app) labels Aug 30, 2026
Comment thread libs/@hashintel/petrinaut/src/ui/dev/form-search-prototypes/fuzzy.ts Dismissed
Comment thread libs/@hashintel/petrinaut/src/ui/dev/form-search-prototypes/fuzzy.ts Dismissed
@kube
kube force-pushed the cf/fe-1558-form-search-prototypes branch from 00a163a to bbe9d11 Compare August 30, 2026 13:33
@kube
kube force-pushed the cf/fe-1518-optimization-constraints branch from 4e368fc to cabed47 Compare August 30, 2026 13:33
@kube
kube force-pushed the cf/fe-1558-form-search-prototypes branch from bbe9d11 to becfe81 Compare August 30, 2026 16:52
@kube
kube force-pushed the cf/fe-1518-optimization-constraints branch from cabed47 to b520b68 Compare August 30, 2026 16:52
@kube
kube force-pushed the cf/fe-1518-optimization-constraints branch from b520b68 to f4b5096 Compare August 30, 2026 17:57
@kube
kube force-pushed the cf/fe-1558-form-search-prototypes branch from becfe81 to 1196847 Compare August 30, 2026 17:57
@kube
kube force-pushed the cf/fe-1518-optimization-constraints branch from f4b5096 to cdcb7ac Compare August 30, 2026 18:35
@kube
kube force-pushed the cf/fe-1558-form-search-prototypes branch from 1196847 to 38ab4ea Compare August 30, 2026 18:35
@kube
kube force-pushed the cf/fe-1558-form-search-prototypes branch from d170bef to 7c3fb8e Compare August 31, 2026 02:20
@kube
kube force-pushed the cf/fe-1518-optimization-constraints branch from a2d2855 to 5af8666 Compare August 31, 2026 02:20
@kube
kube force-pushed the cf/fe-1518-optimization-constraints branch from 5af8666 to 663d298 Compare August 31, 2026 03:03
@kube
kube force-pushed the cf/fe-1558-form-search-prototypes branch from 7c3fb8e to 71c6180 Compare August 31, 2026 03:03
@kube
kube force-pushed the cf/fe-1558-form-search-prototypes branch from 71c6180 to b4218d8 Compare August 31, 2026 03:53
@kube
kube force-pushed the cf/fe-1518-optimization-constraints branch from 663d298 to 18eaf90 Compare August 31, 2026 03:53
@kube
kube changed the base branch from cf/fe-1518-optimization-constraints to cf/fe-778-ad-hoc-form-editing-and-layout-fixes August 31, 2026 16:51
@kube
kube force-pushed the cf/fe-1558-form-search-prototypes branch from b4218d8 to 388adb5 Compare August 31, 2026 16:51
@kube
kube force-pushed the cf/fe-1558-form-search-prototypes branch from 388adb5 to 86b32ec Compare August 31, 2026 17:21
@kube
kube force-pushed the cf/fe-778-ad-hoc-form-editing-and-layout-fixes branch from 1990608 to 51b10fa Compare August 31, 2026 17:21
@kube
kube force-pushed the cf/fe-1558-form-search-prototypes branch from 86b32ec to eb39f9f Compare August 31, 2026 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/apps > hash.design Affects the `hash.design` design site (app) area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > frontend Owned by the @frontend team

Development

Successfully merging this pull request may close these issues.

2 participants