test(desktop): story-cover the change panel's failure and edge states - #4169
Open
liuxiaocs7 wants to merge 1 commit into
Open
test(desktop): story-cover the change panel's failure and edge states#4169liuxiaocs7 wants to merge 1 commit into
liuxiaocs7 wants to merge 1 commit into
Conversation
Fourth surface under apache#3944 (one surface per PR): extend the 变更 panel (SessionReviewPanel, via Product/Session Workbar) with the failure and edge states that never show up in normal use, so the Storybook gate and the apache#3893 a11y audit have real targets. All five drive the real panel through the fake review service — no fabricated UI. - ChangesEmpty — branch matches base: the panel's own EmptyState, not a spinner and not an error. - ChangesLoadFailed — `review.read` rejects: an error Banner with 重试, the same shape as TasksLoadFailed. - ChangesSourceNotGit — a source that cannot be read (not a git repo) is a failure Banner, not an absence; the other read reasons (workspace unavailable, unborn repo, invalid base branch, git failed) share this branch. - ChangesTruncated — a >500-line file: the snapshot 变化过多 banner plus the per-file "另有 N 行未显示" note once expanded, the very-many-rows state bounded before it reaches the DOM. - ChangesEdgeContent — the diff shapes a routine review never shows: binary, rename, deletion, no-newline-at-EOF, and a very long minified line, each rendered by the shared DiffCodePreview. DiffCodePreview is a pure unified-diff string renderer with no edge-state props; the failure states live in this wrapper, which is where they are exercised here. Refs apache#3944, apache#3893
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 free
to 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.
Summary
Fourth surface under #3944 (one surface per PR): extend the 变更 (Changes) panel —
SessionReviewPanel, reached throughProduct/Session Workbar— with the failure and edge states that never show up in normal use, so the Storybook gate and the #3893 a11y audit have real targets. All five drive the real panel through the fakereviewservice; no fabricated UI.EmptyState, not a spinner and not an error.review.readrejects: an errorBannerwith 重试, the same shape asTasksLoadFailed.DiffCodePreview.DiffCodePreviewis a pure unified-diff string renderer with no edge-state props; the failure states live in this wrapper, which is where they are exercised here.bridge()gainsreview/reviewFailoptions in the same idiom as the existingtasksFail/traceFail.Refs #3944, #3893
Verification
apps/desktoptypecheck:storiespasses; Biome lint andgit diff --checkclean.product-session-workbar--changes-empty,--changes-load-failed,--changes-source-not-git,--changes-truncated,--changes-edge-content.playruns under the smoke: each failure banner / empty state renders; expanding the truncated file surfaces the hidden-lines note; expanding the binary file renders its meta row through the diff body.