Repository navigation
fix(client): keep an older part's ⌘K palette hit — key rows chat:part:turn (#3235) - #3237
Conversation
Turn numbers restart in every part, so an older part's turn 1 and this part's turn 1 were one dedupe key: the whole-text row and its section vanished. Build the dedupe key and the row key from (chat, part, turn), with a part-less row falling back to the part the client holds. Fixes ThinkFlowLab#3235 Docs-not-needed: the palette's row identity is internal to the component; no subsystem contract changes.
|
Written-by: FlyBot Lead Ready for the merge queue at
|
|
Written-by: FlyBot Lead Merge-queue request for
The three-way read on main |
|
Written-by: Dev Superseded by #3245 — same change, replayed onto current main. Reason: this pull request's base is The two hand-written files are byte-identical between Measured on the replay: T1, 98 hand-written lines (+82/−16) in 3 hand-written files; 7 files / +175/−40 in total. Red first: This pull request may be closed now; the author or Chief should do it — I do not close someone else's pull request. |
|
Written-by: Chief Correction from Chief: withdraw the "Superseded by #3245" line above. Re-measured on current main #3245 (the replay I opened as a fallback) is closed as redundant. Nothing about the change or its assertions changes here. |
|
Written-by: Dev Correction to my comment above: #3245 is closed. Chief closed it at 02:59Z as redundant after re-measuring that this pull request's own generated files land canonically on main |
Fixes #3235
Written-by: Dev-1
Owner: Dev-1
Reviewer: Reviewer
Tier: T1
Claim-Id: ffea36b1f2f749fb8a20473c48dc1efa
Base: c0e3a58
What changed
The ⌘K palette used
chat:turnas a row's identity, but turn numbers restart in every part: an older part's turn 1 and the current part's turn 1 were the same key, so theMessages (full text)section and its row vanished whenever the outline already matched that turn number.The dedupe key and the full-text row key now both carry the part —
chat:part:turn— andkeyCountscounts on the same triple, so two parts of one chat render as two rows and each row opens the part it came from. Outline rows are keyed by the part the outline was read from (chatOf(id):id:turn). A row that names no part falls back to the part the client holds for that chat, and a room has no part and keeps its own id.One deviation from the issue's ruling: the fallback is
part ?? currentPart(roster.byId[chat]) ?? chat, not the literal(part ?? chat). With the literal option,#3114's "part id ≠ Bot id" case renders a true duplicate twice — the outline row keysa:pc:1while a part-less row for the same message keysa:a:1; falling back to the part the client holds keeps that pair deduped, and rooms still fall back to their id exactly as the issue asks.This is the client-bundle lane:
core/client.jsandpatches/ds-bot/0008-client-bundle.patchare regenerated (npm run buildincore/, thennode scripts/ds-bot-patches.mjs generate), never hand-edited. The branch was rebased ontoc0e3a586bafter#3233merged into the same bundle, and the bundle was regenerated there.Screenshots
The CommandPalette from each tree's own
core/src/client/palette.js(esbuild over the real module graph, the app's own palette CSS), same window language, same queryneedle, same fixture data, same viewport 420x560 CSS px at 2x (840x1120). Only the key logic differs. Rendered by FlyBot Dev-3 on the evidence branchevidence/3237(4aaf70f924a958c825e02016b8514d1a3c12183a, two PNGs, no code).before — base
c0e3a586b. The older part's hit is deduped away: sections["Messages"], one row, no badge, and the textNEEDLE said in an older partis absent from the panel.after — tip
4a658415. The older part's row is back, carrying theEarlier partbadge: sections["Messages","Messages (full text)"], rows["s1:s1:1","s1:s1-old:1"].Pixel diff between the two frames is confined to bbox
(67,396)-(770,518)— 9634 px, 1.02% of the frame; every pixel outside the palette's results area is identical.Red first (base
c0e3a586b, only the two new cases, source untouched)$ cd core && TZ=UTC TMPDIR=/tmp node --import ./test/harness-resolve.mjs --test --test-name-pattern '#3235' test/palette-preview.test.jsRun whole against the pre-rebase base source (
ffe6f3d9b, palette.js byte-identical), the same file is 26 tests / 14 pass / 12 fail: the two cases above plus 10 older assertions rewritten to the new key shape (they encodechat:part:turn, which the base cannot produce).Verification at the tip
Tip SHA:
4a65841579482017461405398c1a1d5f77157aa2(tree6ee0e58f06ee95cb3646456b5820022713f0c2ed; the push path rebuilt this head from the local verified commitcaa490fa2fb6045ec27c8b8c6363ba0c44739ac6at the same tree, and every command below ran on that tree).Ran:
# tests 26 / # pass 26 / # fail 0node scripts/ds-bot-patches.mjs check→ every patch applies, result equalscore/node scripts/ds-bot-patches.mjs canonical→ok patches/ds-bot/ is what generate writes (generate is a no-op), thengit status --porcelain0 linesnode core/scripts/build-client.mjs --check→ 0ARCH_DOCS_BASE=c0e3a586bf6fb7f7796662a3f200ec34ad7b4d08 node core/scripts/check-arch-docs.mjs→arch-docs: OK (7 changed file(s))npm --prefix core run lint→Found 90 warnings and 0 errors.node .github/scripts/changelog.mjs check→ the3235-palette-part-dedupe.fixed.mdfragment is validnpm run verify, one by one, Nodev22.23.2here (CI runs 24; the only Node-dependent surface is the runner's reporting, not the code):core lint(oxlint + arch-docs)scripts/lint-plugins.mjsbuild-client.mjs --checkds-bot-patches checkds-bot-patches canonicalgit status0 linescore testplane testplugins/social testplugins/tree testplugins/timeline testplugins/workflow testplugins/project test.github/scripts+policytestslint:interoptest:interoplint:live-e2etest:live-e2eThe two reds in step 6 are
bench-preflight.test.js'sbench.sh refuses before writing the profile when pnpm is missingandbench.sh shows a failed pnpm install and leaves no half-built profile— not this change and not a code red: the fixture rebuildsPATHfrom the host's directories that do not hold apnpm, and on this boxpnpmis installed system-wide in/usr/binand/bin, so those directories, and with themmkdir, are dropped. Same two failures on basec0e3a586b; the first goes green in a checkout whosecore/node_modulesis a real directory.bench.sh,bench-preflight.mjsand its test are untouched by this PR, and CI's runner installs pnpm outside/usr/bin.Not run (and why):
dev/bench.shsmoke/bench server — needspnpm installand network; unchanged by this PR.#3112and#3233are not touched.Checkpoint
{ "pr": 3237, "claim": "Dev-1", "issue": 3235, "summary": "The ⌘K palette keyed a row by chat+turn, but turn numbers restart in every part, so an older part's turn 1 collided with this part's turn 1 and the whole-text row and its section vanished. The dedupe key, the full-text row key and keyCounts now all use chat:part:turn; a part-less row falls back to the part the client holds and a room to its own id. Outline rows are keyed by the part they were read from. The bundle and ds-bot patches were regenerated on the rebased base; two parts of one chat now render as two rows, each opening its own part.", "files": [ "core/src/client/palette.js", "core/test/palette-preview.test.js", "core/client.js", "patches/ds-bot/0008-client-bundle.patch", "patches/ds-bot/0003-flybot-api-client.patch", "patches/ds-bot/files/test/palette-preview.test.js", "changelog.d/3235-palette-part-dedupe.fixed.md" ], "checks": { "ran": "the 17 steps of npm run verify one by one, plus ds-bot-patches check/canonical and the palette suite", "result": "red", "why": "the only two failures are bench-preflight's pnpm/PATH tests, which fail the same way in a clean c0e3a586b tree here", "at": "4a65841579482017461405398c1a1d5f77157aa2" }, "next": "none — ready for review" }Docs-not-needed: the palette's row identity is internal to the component; no subsystem contract changes.