Skip to content

feat(web): add story filtering and number jump - #150

Open
Bobbyap72 wants to merge 1 commit into
theam:mainfrom
Bobbyap72:feat/story-filter-and-number-jump
Open

feat(web): add story filtering and number jump#150
Bobbyap72 wants to merge 1 commit into
theam:mainfrom
Bobbyap72:feat/story-filter-and-number-jump

Conversation

@Bobbyap72

Copy link
Copy Markdown

web: add title filter and number-jump on the Stories board (#104)

Adds a client-side filter box on the Stories page that narrows
visible stories by title match, and lets a bare story number jump
straight to that story. Numbers already on the board resolve
locally; numbers outside the board's 7-day window fall back to
GET /v1/projects/:projectId/stories/:number.

Known gap: the 409 ambiguous_story_number response doesn't
currently return the candidate repos, so ambiguous numbers show
a message rather than a repo picker. Extending that response is
a natural follow-up, kept out of this PR to stay scoped to
apps/web.

@adrian-lorenzo adrian-lorenzo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the contribution!

Story-number jumps need to handle duplicates before this can merge. localMatch uses the first matching story, so if two repositories have the same number, pressing Enter can silently open the wrong one. Off-board duplicates also leave the user without a working way to choose a repository. Please make ambiguous matches explicit and add tests covering both local and API ambiguity.

The branch also conflicts with main. When rebasing, please preserve the Builder plan policy by passing builderPlanRequired through StoriesBoard to each IssueRow. Please also distinguish API failures from a genuine 404, fix the import ordering, and update the title and commit subject to an allowed Conventional Commit such as feat(web): add story filtering and number jump.

With those changes, we can approve and merge it!

@Bobbyap72
Bobbyap72 force-pushed the feat/story-filter-and-number-jump branch from 3b72588 to a62f906 Compare August 28, 2026 07:06
@Bobbyap72 Bobbyap72 changed the title web: add title filter and number-jump on the Stories board (#104) feat(web): add story filtering and number jump Aug 28, 2026
@Bobbyap72

Copy link
Copy Markdown
Author

Thanks for the thorough review — pushed a rebased, squashed commit addressing all six points:

  1. Ambiguity handling: both local and off-board duplicates are now explicit, not silently resolved to the first match. Locally, resolveLocalJump reports ambiguous if two repos on the board share a number. Off-board, the 409 response from /stories/:number now includes the candidate repos (repoId/repoOwner/repoName/storyType) — the UI renders a real picker instead of a dead-end message. Covered by apps/web/test/story-jump.test.ts.
  2. Rebased onto current main.
  3. builderPlanRequired now threaded through StoriesBoardIssueRow.
  4. API failures vs. genuine 404: interpretJumpResponse now distinguishes a real 404 from a 5xx/network failure — the UI says "couldn't check" rather than implying non-existence.
  5. Import ordering fixed via pnpm exec biome check --write.
  6. Title/commit updated to feat(web): add story filtering and number jump.

One note on scope: this does touch services/api now (the 409 response body), beyond the original apps/web-only plan — necessary since building a real picker needed the candidate data the API wasn't returning.

Also flagging: pnpm --filter @facility/api typecheck currently reports 43 pre-existing errors on main (missing builderPlanPolicy/workspaceBaseSha types, traced to #205). Confirmed unrelated by running the identical typecheck against a clean upstream/main checkout — same 43 errors, same files/lines, before any of this branch's changes were applied. Not touched here to keep this PR to one intent.

@Bobbyap72

Copy link
Copy Markdown
Author

Confirmed the title and commit subject landed correctly:

$ gh pr view 150 --repo theam/facility --json title,commits --jq '.title, .commits[-1].messageHeadline'
feat(web): add story filtering and number jump
feat(web): add story filtering and number jump

Ready for another look whenever you get a chance.

@Bobbyap72

Bobbyap72 commented Aug 28, 2026 via email

Copy link
Copy Markdown
Author

@adrian-lorenzo adrian-lorenzo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the thoughtful revision!

The original issues are addressed, but the off-board lookup still has a race. If someone submits one number and then changes or submits another before the first request completes, the older response can arrive last and navigate them to the wrong story or overwrite the current status. Please cancel superseded requests or ignore their responses, and add a component-level regression covering out-of-order responses.

Please also announce the asynchronous lookup result through an aria-live region, use links for the repository choices, and extend the API integration test to verify the 409 response’s matches data that the picker now depends on.

With those small improvements, this should be ready to approve.

Adds a client-side filter box on the Stories page that narrows
visible stories by title match, and lets a bare story number jump
straight to that story.

Ambiguity is handled explicitly, both locally and via the API:
- Locally: if two repos on the board share the same number, that's
  reported as ambiguous rather than silently opening the first match.
- Off-board: the story-detail endpoint's 409 response now returns
  the candidate repos (repoId/repoOwner/repoName/storyType), so the
  UI renders a real Link-based picker instead of a dead-end message.

A request-generation counter (jumpSeq) guards against out-of-order
async responses: submitting a new number invalidates any in-flight
lookup, so a stale response can never navigate the user to the
wrong story or overwrite newer state. Covered by a component-level
regression test (stories-board.test.tsx) that deliberately resolves
an older request after a newer one and asserts only the newer one
navigates.

The async jump status (checking/not-found/error/ambiguous) is
announced through an aria-live region.

API failures (5xx, network errors) are distinguished from a
genuine 404 — the UI never claims a story doesn't exist when the
truth is "couldn't check right now."

Tests:
- apps/web/test/story-jump.test.ts: pure local/API ambiguity,
  not-found, and error resolution logic.
- apps/web/test/stories-board.test.tsx: component-level regression
  for out-of-order async responses.
- services/api/test/github-platform-lane.test.ts: extended to
  assert the 409 response's error.details.matches carries the
  correct candidate repos.

Verified: pnpm --filter @facility/web typecheck / test, targeted
services/api test run for the modified test (both pass). The full
services/api suite currently has pre-existing failures on main
unrelated to this change, traced to theam#205 (builderPlanPolicy /
workspaceBaseSha schema drift) — confirmed by running the same
typecheck against a clean upstream/main checkout before any of
this branch's changes were applied.
@Bobbyap72
Bobbyap72 force-pushed the feat/story-filter-and-number-jump branch from a62f906 to 4b4828a Compare August 28, 2026 19:35
@Bobbyap72

Bobbyap72 commented Aug 28, 2026 via email

Copy link
Copy Markdown
Author

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