Repository navigation
fix: name the cause when a side-panel copy is only partial - #31792
Conversation
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks: one stored cause fixes the guessed wording, and the issue is linked (#14449). What this change shipsInventory (6 items) — 6 justifiedIntent: when a side-panel tab holds only part of a deleted file, the user is told the actual reason, not a guess between two. FIX.
[FIRST-PRINCIPLES-REVIEWED] 8de91c2 Description read[DESCRIPTION-READ] d239fc6247d7e38b3e2ad12b835bc15ed2459692b5c2547d3c47688891c90d76 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the read's cause is now kept where it used to be reduced to a yes/no, every place that writes Notes
[DESIGN-REVIEWED] 8de91c2 Description read[DESCRIPTION-READ] 63cf1da5443f0673ace23f0a1e4cdede8753972d49b486e267d446e3ee92b7e0 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
UX Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)UX-level review of UX-Verdict: PASS cannot evaluate: missing the Save notice and the Cmd+S refusal with each cause filled in. The PR rewrites that sentence, but no screenshot shows it. Evidence gaps
Notes
[UX-REVIEWED] 8de91c2 Description read[DESCRIPTION-READ] 597bcc00528b665f0c7ad038edc81965e7a742f2f69f68449ea76bf554a21969 That sha256 names everything this verdict read: the PR description, plus the 11 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
10f517b to
8e83020
Compare
|
Rebased: main moved in docs/system-specs/modules/learn-cron-dashboard.md and website/src/i18n/locales/*.json since this head's CI ran (39717a0 -> 678769e); CI re-running. The new base also carries #31803, which fixes the [operator: bolichen97] |
A side-panel tab whose read was cut at the gateway's cap, had credentials redacted, or was not valid UTF-8 told the user it "was cut short or had credentials redacted" whatever the cause, so a Latin-1 file was described wrongly on both counts. The tab now carries the cause the read's headers named, and the missing-file banner, the close prompts and the Save notice say which one it was. When a read is both cut and redacted or lossy, the cut is named: a redaction tag or a replacement character shows in the text, a cut does not. Closes #14449
8e83020 to
8de91c2
Compare
|
Rebased: main moved in docs/system-specs/modules/learn-cron-dashboard.md and website/src/i18n/locales/*.json, and the PR was conflicting (8e83020 -> 8de91c2, base 8544127). The spec conflict kept both: this PR's "File read headers" wording plus main's new Escape sentence in "Side-panel file tabs". The patch is otherwise unchanged (range-diff identical). The previous head's Frontend Tests (2) red was |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved for the on-call. Review lanes pass on 8de91c2, no conflict, no open change request.
A side-panel tab whose read was cut at the gateway's cap, had credentials redacted, or was not valid UTF-8 told the user it "was cut short or had credentials redacted" whatever the cause, so a Latin-1 file was described wrongly on both counts. The tab now carries the cause the read's headers named, and the missing-file banner, the close prompts and the Save notice say which one it was. When a read is both cut and redacted or lossy, the cut is named: a redaction tag or a replacement character shows in the text, a cut does not. Closes #14449 (cherry picked from commit 18d7308) Backport note: release has no Save notice for a partial copy (partial_copy_cannot_save and partialSaveBlocked come from feat #30812, not on release), so the banner and close-prompt cause are taken and the Save-notice hunks, their locale key and MarkdownPanel.richEdit.test.tsx (also from #30812) are left out. The learn-cron-dashboard.md line is reworded on release's text without the Save notice.
Problem / Motivation
Goal: When a side-panel file tab holds only part of a deleted file, its banner, close prompt and Save notice name the one cause the read reported, never a guess between two.
The gateway reports three separate reasons a read is not the file as written:
X-Truncated(cut at its size cap),X-Redacted(credentials redacted) andX-Lossy-Decode(not valid UTF-8, characters replaced). The panel folded them into one yes/no, so every prompt guessed "the copy was cut short or had credentials redacted". For a Latin-1 file shown with replacement characters both halves of that were wrong, and "the copy" read like the "Copy content" button sitting next to it.Why it matters
These prompts appear when the file is gone and the tab is the only copy left, which is exactly when the user decides whether to keep it. Telling them credentials are missing when characters were replaced, or that the copy is cut short when it is whole but redacted, misleads them about what they are keeping.
Not a goal
.partialdownload name.What changed (motivation → approach → change)
The cause was lost at the first step:
isPartialReadturned the three headers into one boolean, and that boolean is what the tab stored. So the fix carries the cause itself:partialReadCausereturns'truncated','redacted','lossy'orfalse, and the tab'spartialfield holds that value where it heldtrue. Everything that only asked "is it partial?" still works, because a cause is truthy.utils/fileReadQuery.tspartialReadCausereplacesisPartialReadpartialisPartialCause | falseinusePanelTabs,MarkdownPanel,useMarkdownPanelDisk,SidePanelTabBodies,usePanelDocumentActionsandpage/eventBridges.ts{{reason}};partialReasoninMarkdownPanelBody.tsxfills it from one of three new keys, in every catalog underwebsite/src/i18n/locales/(en.json,en.manual.json, the eleven translations, anden-XA.jsonregenerated)learn-cron-dashboard.md(File read headers)When a read is both cut and redacted or lossy, the cut is named: a redaction tag or a replacement character shows in the text itself, a cut does not.
Backwards compatibility
Compatible:
partialis a transient tab field (stripped before tabs are saved, never sent to the backend or to apps), and every writer of it is in this diff.Reader: website/src/hooks/usePanelDocumentActions.ts:openFile -- chat -- calls
partialReadCause; usePanelDocumentActions.redactionEpoch.test.tsReader: website/src/components/useMarkdownPanelDisk.ts:readFromDisk -- chat -- calls
partialReadCause; MarkdownPanel.watchVisibleTab.test.tsxReader: website/src/pages/chat/SidePanelTabBodies.tsx:HydratingFileTab -- chat -- calls
partialReadCause; sidePanelColdTabHydration.test.tsxReader: website/src/pages/chat/page/eventBridges.ts:useChatPageEventBridges -- chat -- calls
partialReadCause; useChatPageEventBridges.test.tsxTests
MarkdownPanel.watchVisibleTab.test.tsx: the banner and close-prompt test runs for a cut, a redacted and a lossy buffer (and a whole one), and checks each names only its own cause.MarkdownPanel.richEdit.test.tsx: the Save notice and the Cmd+S refusal name the cause.usePanelDocumentActions.redactionEpoch.test.ts: each header maps to its cause, and a cut that was also redacted is named as cut.sidePanelColdTabHydration,sidePanelAddMenu,MarkdownPanel.partialDiff: expect the cause where they expectedtrue.With the production files put back to
main, 9 of these tests fail; with the fix all 350 tests in the 10 related files pass. Determinism: the six changed test files ran 10 times in a shuffled order (vitest run --sequence.shuffle, seeds 26414, 14583, 22448, 22361, 27996, 30501, 2751, 11327, 23353, 19726), 121 of 121 green each time.Proof: not provable -- frontend test (prove.py runs Python only)
Manual verification
Ran the built dashboard against stubbed APIs: a tab whose opening read carried each header, then 404s, shows the banner and the Escape prompt below with that cause's words, in English and Chinese.
Screenshots / video
Cut at the size limit, then Escape:
Credentials redacted:
Not valid UTF-8, English and Chinese:
The other close prompts
The red "Couldn't load your starred Bots" notice in the full-page frames comes from the stubbed API, not from this change.
Related Issues
Closes #14449
Sibling sweep
Swept: git grep -n -i -E "cut short or|or had credentials|truncated or redacted" -- website/src src/kiro_crew
Siblings: none -- the four strings changed here are the only user-facing wording of the partial verdict; the other hits are code comments about unrelated features
Pattern harvest
Not generalizable: a verdict with several causes was stored as one boolean at a single seam, and the fix is to store the cause there.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)