Skip to content

fix: name the cause when a side-panel copy is only partial - #31792

Merged
KiroCrewCaptain merged 1 commit into
mainfrom
fix/14449-rest-partial-cause-wording
Nov 7, 2026
Merged

KiroCrewCaptain merged 1 commit into
mainfrom
fix/14449-rest-partial-cause-wording

Conversation

@bolichen97

Copy link
Copy Markdown
Contributor

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) and X-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

What changed (motivation → approach → change)

The cause was lost at the first step: isPartialRead turned the three headers into one boolean, and that boolean is what the tab stored. So the fix carries the cause itself: partialReadCause returns 'truncated', 'redacted', 'lossy' or false, and the tab's partial field holds that value where it held true. Everything that only asked "is it partial?" still works, because a cause is truthy.

Part Change
utils/fileReadQuery.ts partialReadCause replaces isPartialRead
tab and panel partial is PartialCause | false in usePanelTabs, MarkdownPanel, useMarkdownPanelDisk, SidePanelTabBodies, usePanelDocumentActions and page/eventBridges.ts
words the four sentences take a {{reason}}; partialReason in MarkdownPanelBody.tsx fills it from one of three new keys, in every catalog under website/src/i18n/locales/ (en.json, en.manual.json, the eleven translations, and en-XA.json regenerated)
spec 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: partial is 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.ts
Reader: website/src/components/useMarkdownPanelDisk.ts:readFromDisk -- chat -- calls partialReadCause; MarkdownPanel.watchVisibleTab.test.tsx
Reader: website/src/pages/chat/SidePanelTabBodies.tsx:HydratingFileTab -- chat -- calls partialReadCause; sidePanelColdTabHydration.test.tsx
Reader: website/src/pages/chat/page/eventBridges.ts:useChatPageEventBridges -- chat -- calls partialReadCause; useChatPageEventBridges.test.tsx

Tests

  • 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 expected true.

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

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 6, 2026 20:41
@bolichen97
bolichen97 requested a review from Zedmor November 6, 2026 20:41
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 6, 2026
@bolichen97
bolichen97 enabled auto-merge (squash) November 6, 2026 20:43
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 8de91c2d444d01eec237aeba641b63e62728ffe2 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks: one stored cause fixes the guessed wording, and the issue is linked (#14449).

What this change ships

Inventory (6 items) — 6 justified

Intent: 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.

  1. The missing-file banner now names the one cause: cut short at the size limit, credentials redacted, or invalid UTF-8 — justified
  2. The close prompt, with or without unsaved edits, names the cause — justified
  3. The Save notice and the Cmd+S refusal name the cause — justified
  4. When a read is both cut and redacted or lossy, the message names the cut — justified
  5. The tab's partial field holds the cause instead of true, and partialReadCause replaces isPartialRead (0 callers of the old name left) — justified
  6. Three new reason strings added to all 13 locale catalogs — justified

[FIRST-PRINCIPLES-REVIEWED] 8de91c2

Description read

[DESCRIPTION-READ] d239fc6247d7e38b3e2ad12b835bc15ed2459692b5c2547d3c47688891c90d76

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 8de91c2d444d01eec237aeba641b63e62728ffe2 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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 partial is in this diff, and the screenshots cover each cause.

Notes

  • The type allows partial to be one cause or false, so when a read is both cut and redacted the prompt names only the cut. That is a stated choice, and it is easy to change later because partial is never saved.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 8de91c2d444d01eec237aeba641b63e62728ffe2 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 8de91c2

Verdict parsed from the review's SHA-scoped output markers for commit 8de91c2d444d01eec237aeba641b63e62728ffe2.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 8de91c2d444d01eec237aeba641b63e62728ffe2 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 8de91c2d444d01eec237aeba641b63e62728ffe2 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 8de91c2

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 8de91c2d444d01eec237aeba641b63e62728ffe2 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)

UX-level review of 8de91c2d444d01eec237aeba641b63e62728ffe2 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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

  • partial_copy_cannot_save ("Only part of this file was loaded ({{reason}}), so it can't be saved over the file on disk.") is the inline markdown-panel-partial-notice status and the setSaveError text from Save/Cmd+S. None of shot-01 to shot-08 shows it. To close the gap, attach a screenshot of a partial tab after Save or Cmd+S, for at least one cause.
  • close_partial_copy_dirty_body (the close prompt when the tab has unsaved edits) appears in no screenshot either. Attach one shot of the Escape prompt on an edited partial tab.

Notes

  • In the redacted and lossy cases, "holds only part of it" is wrong: nothing is missing, it was changed. The blind reader said: "In the credentials and UTF-8 cases, I can't tell whether parts are missing or just changed. 'Part' seems to mean two different things." Use "holds an altered copy" for those two causes, or move "only part of it" into partial_reason_truncated.
  • The reasons are in code vocabulary. The reader didn't know "gateway", "credentials … redacted" or "UTF-8". Suggested wording:
    • "it was cut off at the size limit"
    • "passwords and keys in it were hidden"
    • "some characters couldn't be read and were replaced"

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 6, 2026
@bolichen97
bolichen97 force-pushed the fix/14449-rest-partial-cause-wording branch from 10f517b to 8e83020 Compare November 7, 2026 01:31
@bolichen97

Copy link
Copy Markdown
Contributor Author

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 test/test_pull_request_target_allowlist.py::test_only_the_allowed_workflows_use_pull_request_target red on Backend Tests shard 7 (Linux and Windows) that main had when the previous head ran. The patch itself is unchanged (git range-diff shows =); targeted frontend and backend tests, tsc, eslint and i18n:check pass on the rebased head 8e83020.

[operator: bolichen97]

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 7, 2026
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
@bolichen97
bolichen97 force-pushed the fix/14449-rest-partial-cause-wording branch from 8e83020 to 8de91c2 Compare November 7, 2026 06:18
@bolichen97

Copy link
Copy Markdown
Contributor Author

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 SelectionToolbar.codeBlock.test.tsx "keeps an out-of-range passage in the fallback slot and the next row in its own slot", a file this PR does not touch; it passes alone 5 of 5. Recorded as #32131. Coverage Merge and Coverage Gate were red only because that shard failed. CI re-running.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Nov 7, 2026

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved for the on-call. Review lanes pass on 8de91c2, no conflict, no open change request.

@KiroCrewCaptain
KiroCrewCaptain merged commit 18d7308 into main Nov 7, 2026
97 checks passed
@KiroCrewCaptain
KiroCrewCaptain deleted the fix/14449-rest-partial-cause-wording branch November 7, 2026 07:09
bolichen97 added a commit that referenced this pull request Nov 9, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

readiness: passed Eligible automated validation passed for the current revision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(dashboard): follow-ups deferred from #14262

2 participants