HOTFIX KAN-353: kanban job-number search returns nothing - #134
Open
corrin wants to merge 1 commit into
Open
Conversation
…d gets a column Two independent defects on one journey, "find job 97537". The search box read the RAW query string (location.searchStr) but wrote through navigate(), i.e. TanStack's stringifier. The default stringifier JSON-quotes any value that parses as JSON, so a job number went out as ?q=%2297537%22 and came back as the literal `"97537"`. Typing 9, pausing past the 300ms debounce, then typing the rest therefore produced `"9"7537` in the box and searched for a string no job carries. Both sides now read the parsed value through one normaliser; a number is coerced rather than dropped, so a hand-typed or shared ?q=97537 filters the board instead of silently rendering an unfiltered one. Archived was never a column in v2 — omitted on a planning brief's unexamined premise, recorded in no ADR — which hid ~95% of the jobs the board knows about (2287 archived against 117 elsewhere), a set that grows nightly as auto_archive_service moves completed jobs into it. Adding it to OFFICE_COLUMN_IDS is the whole lever: the grid, the reconciliation feed and every cache writer already derive from that array. The three special cases built on the old premise go with it, notably updateStatus, which called removeJob and so DELETED a card the user asked to archive. The backend needed no change: it has served the archived column, its label and its diffs all along. Decisions taken with the owner: Archived obeys the staff filter like every other column (an exempt column that stayed full while its neighbours emptied would read as the filter having failed), and it uses the same COLUMN_MAX_JOBS as everything else rather than a second ceiling to reason about. Perf posture: one extra parallel column query on mount, index-served by Index(status, priority), ~31KB gzipped against the 100KB E2E wire guard. The real cost is DOM — 117 to ~317 mounted JobCards, with no virtualization on the board. Nothing on the drag or reconciliation hot path changed. Tests: the unit specs were confirmed to FAIL against the pre-fix code and pass after (the box round-trip, the numeric link, and the archive-from-drawer move). The E2E spec types with pressSequentially rather than fill() — fill() is one atomic change event, which is exactly why the existing kanban specs never saw this. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012KsKjSzg9umSt7ad4NHEg7
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Emergency hotfix, based directly on
production. Frontend only — zero migrations, no dependency changes, no external-API changes.Deliberately NOT the main→production release. This carries only the kanban search fix, so it can go out without the release's schema rename, Places API switch or payroll sync changes.
The bug
Typing a job number into the kanban search box put
"9"7537in the box and returned no results.The search box READ the raw query string (
location.searchStr) but WROTE throughnavigate()— TanStack's stringifier. The default stringifier JSON-quotes any value that parses as JSON, so a job number goes out as?q=%2297537%22and comes back as the literal"97537", quote characters included. Verified against the installed router, not inferred:97537?q=%2297537%22"97537"← literal quotessmith?q=smithsmith✓Only values that parse as JSON are affected — which is job numbers, i.e. the main search path. Both sides now read the parsed value through one normaliser. A number is also coerced rather than dropped, so a shared
?q=97537link filters the board instead of rendering an unfiltered one under a filled-in box.Also included
Archived gets a board column. It was never rendered in v2, hiding ~95% of the jobs the board knows about (2287 archived against 117 elsewhere), which is why searching for an old job failed twice over. Adding it to
OFFICE_COLUMN_IDSis the whole lever — the grid, the reconciliation feed and every cache writer derive from that array. The three special cases built on the old premise go with it, notablyupdateStatus, which calledremoveJoband so deleted a card the user asked to archive.Backend needs no change: it has served the archived column, its label and its diffs all along.
Risk
Verification
expected '"9"' to be '9';expected [] to deeply equal ['archived']).6v3f3dsb, same commit content on the main-based branch): all 3 new kanban-search specs pass, plus all 17 existing kanban specs including the drag-and-search interactions the new column could have broken.pressSequentiallyrather thanfill()—fill()is one atomic change event, which is why the existing specs never caught this.Jira: https://docketworks.atlassian.net/browse/KAN-353
Same change is already merged to
mainas #133.🤖 Generated with Claude Code
https://claude.ai/code/session_012KsKjSzg9umSt7ad4NHEg7