@zyro-sec/session-ui 0.0.0-stage → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +25 -0
- package/bunfig.toml +2 -0
- package/component-tests/basic-tool.fixture.tsx +46 -0
- package/component-tests/basic-tool.spec.ts +63 -0
- package/component-tests/file-media.fixture.tsx +39 -0
- package/component-tests/file-media.spec.ts +13 -0
- package/component-tests/file-tool.spec.ts +62 -0
- package/component-tests/file-viewer.fixture.tsx +109 -0
- package/component-tests/file-viewer.spec.ts +134 -0
- package/component-tests/file.spec.ts +33 -0
- package/component-tests/line-comment-v2.spec.ts +15 -0
- package/component-tests/markdown-code-wrap.spec.ts +94 -0
- package/component-tests/markdown-readiness.spec.ts +95 -0
- package/component-tests/markdown.fixture.tsx +104 -0
- package/component-tests/markdown.spec.ts +1564 -0
- package/component-tests/mermaid-preview.spec.ts +43 -0
- package/component-tests/patch-group.spec.ts +79 -0
- package/component-tests/read-group.spec.ts +72 -0
- package/component-tests/read-image.fixture.tsx +66 -0
- package/component-tests/read-image.spec.ts +154 -0
- package/component-tests/session-compaction.spec.ts +254 -0
- package/component-tests/session-lifecycle.spec.ts +190 -0
- package/component-tests/session-message-projection.spec.ts +639 -0
- package/component-tests/session-notice-projection.spec.ts +20 -0
- package/component-tests/session-review-comments.spec.ts +179 -0
- package/component-tests/session-shell.spec.ts +93 -0
- package/component-tests/session-timeline-mobile.spec.ts +201 -0
- package/component-tests/session-timeline-notices.spec.ts +38 -0
- package/component-tests/session-timeline-reasoning.spec.ts +107 -0
- package/component-tests/session-timeline.spec.ts +157 -0
- package/component-tests/session-tool-projection.spec.ts +323 -0
- package/component-tests/text-lifecycle.fixture.tsx +26 -0
- package/component-tests/text-lifecycle.spec.ts +42 -0
- package/component-tests/timeline-subagent-rows.spec.ts +33 -0
- package/component-tests/tool-disclosure.spec.ts +48 -0
- package/component-tests/tool-group-sticky.spec.ts +37 -0
- package/component-tests/tool-group.spec.ts +290 -0
- package/component-tests/tool-status-title.fixture.tsx +22 -0
- package/component-tests/tool-status-title.spec.ts +30 -0
- package/component-tests/user-message-quotes.spec.ts +111 -0
- package/package.json +91 -4
- package/playwright.components.config.ts +4 -0
- package/playwright.local.config.ts +2 -0
- package/src/actions.ts +54 -0
- package/src/components/apply-patch-file.ts +122 -0
- package/src/components/basic-tool.css +487 -0
- package/src/components/basic-tool.tsx +258 -0
- package/src/components/copy-machine.ts +78 -0
- package/src/components/copy.ts +85 -0
- package/src/components/diagram-preview.tsx +28 -0
- package/src/components/disclosure-machine.ts +188 -0
- package/src/components/disclosure.ts +129 -0
- package/src/components/dock-prompt.stories.tsx +73 -0
- package/src/components/dock-prompt.tsx +29 -0
- package/src/components/file-comment-selection.tsx +146 -0
- package/src/components/file-media-machine.ts +165 -0
- package/src/components/file-media.stories.tsx +112 -0
- package/src/components/file-media.tsx +323 -0
- package/src/components/file-search.tsx +73 -0
- package/src/components/file.css +59 -0
- package/src/components/file.tsx +1300 -0
- package/src/components/image-preview.tsx +35 -0
- package/src/components/line-comment-annotations.tsx +580 -0
- package/src/components/line-comment-machine.ts +262 -0
- package/src/components/line-comment-styles.ts +293 -0
- package/src/components/line-comment.stories.tsx +152 -0
- package/src/components/line-comment.tsx +448 -0
- package/src/components/link-segments.ts +20 -0
- package/src/components/linked-text.tsx +21 -0
- package/src/components/markdown-cache-machine.ts +257 -0
- package/src/components/markdown-cache.tsx +556 -0
- package/src/components/markdown-clipboard.ts +101 -0
- package/src/components/markdown-code-machine.ts +200 -0
- package/src/components/markdown-code-state.ts +22 -0
- package/src/components/markdown-fragment-links.ts +74 -0
- package/src/components/markdown-github.svg +3 -0
- package/src/components/markdown-globe.svg +5 -0
- package/src/components/markdown-image-machine.ts +170 -0
- package/src/components/markdown-image.ts +156 -0
- package/src/components/markdown-inline-code-kind.ts +39 -0
- package/src/components/markdown-mermaid.ts +18 -0
- package/src/components/markdown-phase-machine.ts +102 -0
- package/src/components/markdown-projection.ts +13 -0
- package/src/components/markdown-session-links.ts +183 -0
- package/src/components/markdown-solid.test.tsx +92 -0
- package/src/components/markdown-solid.tsx +113 -0
- package/src/components/markdown-stream.ts +95 -0
- package/src/components/markdown-worker-machine.ts +516 -0
- package/src/components/markdown-worker-protocol.ts +73 -0
- package/src/components/markdown-worker.ts +250 -0
- package/src/components/markdown.css +672 -0
- package/src/components/markdown.stories.tsx +199 -0
- package/src/components/markdown.tsx +1612 -0
- package/src/components/markdown.worker.ts +188 -0
- package/src/components/message-file.ts +102 -0
- package/src/components/message-nav.css +134 -0
- package/src/components/message-nav.tsx +159 -0
- package/src/components/message-part.css +2109 -0
- package/src/components/message-part.tsx +3 -0
- package/src/components/question-prompt-experimental.css +576 -0
- package/src/components/question-prompt.css +527 -0
- package/src/components/quote-highlight.css +59 -0
- package/src/components/review-focus-driver.ts +142 -0
- package/src/components/review-focus-machine.ts +95 -0
- package/src/components/session-compaction.css +270 -0
- package/src/components/session-diff.ts +358 -0
- package/src/components/session-error.tsx +41 -0
- package/src/components/session-retry.tsx +92 -0
- package/src/components/session-review-machine.ts +241 -0
- package/src/components/session-review.css +264 -0
- package/src/components/session-review.stories.tsx +232 -0
- package/src/components/session-review.tsx +733 -0
- package/src/components/session-turn.css +282 -0
- package/src/components/shell-submessage.css +24 -0
- package/src/components/timeline-separator.tsx +69 -0
- package/src/components/tool-count-label.css +57 -0
- package/src/components/tool-count-label.tsx +76 -0
- package/src/components/tool-count-summary.css +102 -0
- package/src/components/tool-count-summary.stories.tsx +99 -0
- package/src/components/tool-count-summary.tsx +44 -0
- package/src/components/tool-error-card.css +178 -0
- package/src/components/tool-error-card.stories.tsx +113 -0
- package/src/components/tool-error-card.tsx +202 -0
- package/src/components/tool-status-title-machine.ts +128 -0
- package/src/components/tool-status-title.css +89 -0
- package/src/components/tool-status-title.tsx +163 -0
- package/src/context/data.tsx +107 -0
- package/src/context/index.ts +1 -0
- package/src/context/markdown.tsx +129 -0
- package/src/context/sources.tsx +34 -0
- package/src/document.ts +8 -0
- package/src/file-presentation.ts +34 -0
- package/src/message/action-machine.ts +72 -0
- package/src/message/agent-label.ts +3 -0
- package/src/message/attachment-card.css +119 -0
- package/src/message/attachment-card.tsx +40 -0
- package/src/message/attachment-media-machine.ts +213 -0
- package/src/message/comment-card.tsx +155 -0
- package/src/message/compaction-entrance-machine.ts +93 -0
- package/src/message/current-message.tsx +157 -0
- package/src/message/current-tool-state.ts +161 -0
- package/src/message/message-content.tsx +1391 -0
- package/src/message/paced-text-machine.ts +73 -0
- package/src/message/prompt-message.stories.tsx +149 -0
- package/src/message/relative-time.ts +45 -0
- package/src/message/user-message-quote-parts.ts +16 -0
- package/src/message/user-message-quotes.stories.tsx +797 -0
- package/src/message/user-message-quotes.tsx +135 -0
- package/src/pierre/comment-hover-machine.ts +53 -0
- package/src/pierre/comment-hover.ts +131 -0
- package/src/pierre/comment-selection-machine.ts +257 -0
- package/src/pierre/commented-lines.ts +106 -0
- package/src/pierre/diff-selection.ts +91 -0
- package/src/pierre/file-find-machine.ts +323 -0
- package/src/pierre/file-find.ts +537 -0
- package/src/pierre/file-runtime.ts +42 -0
- package/src/pierre/file-selection.ts +140 -0
- package/src/pierre/index.ts +344 -0
- package/src/pierre/media.ts +140 -0
- package/src/pierre/render-machine.ts +381 -0
- package/src/pierre/selection-bridge.ts +82 -0
- package/src/pierre/selection-machine.ts +198 -0
- package/src/pierre/virtualizer.ts +114 -0
- package/src/pierre/worker.ts +46 -0
- package/src/sources/experiment.ts +59 -0
- package/src/sources/site-icon.tsx +53 -0
- package/src/sources/sources-chip.tsx +57 -0
- package/src/sources/sources-expand-machine.ts +101 -0
- package/src/sources/sources-panel.tsx +249 -0
- package/src/sources/sources-title.tsx +21 -0
- package/src/sources/sources.css +266 -0
- package/src/sources/sources.ts +141 -0
- package/src/storybook/current-session-fixtures.ts +1492 -0
- package/src/storybook/current-session-scenarios.ts +76 -0
- package/src/storybook/current-session-story.tsx +154 -0
- package/src/storybook/index.ts +43 -0
- package/src/styles/index.css +19 -0
- package/src/timeline/__snapshots__/group-labels.test.ts.snap +110 -0
- package/src/timeline/__snapshots__/placement.test.ts.snap +1041 -0
- package/src/timeline/code-blocks.stories.tsx +105 -0
- package/src/timeline/commentary.stories.tsx +70 -0
- package/src/timeline/commentary.ts +38 -0
- package/src/timeline/detail.ts +111 -0
- package/src/timeline/error-card.stories.tsx +134 -0
- package/src/timeline/error-spacing.stories.tsx +71 -0
- package/src/timeline/facts.ts +493 -0
- package/src/timeline/file-changes.stories.tsx +436 -0
- package/src/timeline/group-label-fixtures.ts +97 -0
- package/src/timeline/mermaid.stories.tsx +131 -0
- package/src/timeline/place.ts +280 -0
- package/src/timeline/placement-fixtures.ts +365 -0
- package/src/timeline/placement-reactivity.ts +133 -0
- package/src/timeline/projection.ts +1261 -0
- package/src/timeline/research-and-agents.stories.tsx +461 -0
- package/src/timeline/session-timeline-row.tsx +1675 -0
- package/src/timeline/session-timeline.tsx +68 -0
- package/src/timeline/steer-arrival-machine.ts +134 -0
- package/src/timeline/terminal-work.stories.tsx +464 -0
- package/src/timeline/timeline-row.stories.tsx +1069 -0
- package/src/timeline/timeline-row.ts +238 -0
- package/src/timeline/turn-phase-machine.ts +112 -0
- package/src/timeline/user-message-fold.stories.tsx +194 -0
- package/src/timeline/user-runs.ts +87 -0
- package/src/timeline-next/__snapshots__/placement.test.ts.snap +990 -0
- package/src/timeline-next/compaction.tsx +236 -0
- package/src/timeline-next/errors.ts +101 -0
- package/src/timeline-next/event-row.tsx +168 -0
- package/src/timeline-next/events.ts +103 -0
- package/src/timeline-next/index.ts +10 -0
- package/src/timeline-next/nested-rail.ts +125 -0
- package/src/timeline-next/projection.ts +1028 -0
- package/src/timeline-next/row.tsx +1728 -0
- package/src/timeline-next/rules.ts +89 -0
- package/src/timeline-next/separator.tsx +73 -0
- package/src/timeline-next/spacing.ts +127 -0
- package/src/timeline-next/status-line.tsx +41 -0
- package/src/timeline-next/status.ts +33 -0
- package/src/timeline-next/stories/compare-renderer.stories.tsx +190 -0
- package/src/timeline-next/stories/compare-sessions/.gitignore +3 -0
- package/src/timeline-next/stories/compare.stories.tsx +486 -0
- package/src/timeline-next/stories/playground.stories.tsx +297 -0
- package/src/timeline-next/stories/session-replay.ts +1156 -0
- package/src/timeline-next/stories/session-timeline.tsx +50 -0
- package/src/timeline-next/stories/subagent-status.stories.tsx +132 -0
- package/src/timeline-next/timeline-next.css +649 -0
- package/src/timeline-next/tools/__snapshots__/activity-label.test.ts.snap +39 -0
- package/src/timeline-next/tools/activity-label.ts +166 -0
- package/src/timeline-next/tools/assistant-content.tsx +84 -0
- package/src/timeline-next/tools/context-group.tsx +619 -0
- package/src/timeline-next/tools/error-card.tsx +147 -0
- package/src/timeline-next/tools/explore.tsx +119 -0
- package/src/timeline-next/tools/file-group.tsx +128 -0
- package/src/timeline-next/tools/patch.tsx +174 -0
- package/src/timeline-next/tools/shell.tsx +186 -0
- package/src/timeline-next/tools/thought.tsx +87 -0
- package/src/timeline-next/tools/tool-display.tsx +119 -0
- package/src/tools/ansi.ts +8 -0
- package/src/tools/context-group-label.ts +123 -0
- package/src/tools/file-runs.ts +35 -0
- package/src/tools/project-path.ts +18 -0
- package/src/tools/read-group.stories.tsx +159 -0
- package/src/tools/run-machine.ts +185 -0
- package/src/tools/shell-output-machine.ts +233 -0
- package/src/tools/shell-output.ts +91 -0
- package/src/tools/subagent-row-variants.stories.tsx +129 -0
- package/src/tools/tool-group.stories.tsx +345 -0
- package/src/tools/tool-renderer.tsx +2876 -0
- package/src/v2/components/line-comment-annotations-v2.tsx +215 -0
- package/src/v2/components/session-file-panel-v2.tsx +149 -0
- package/src/v2/components/session-progress-indicator-v2.css +5 -0
- package/src/v2/components/session-progress-indicator-v2.stories.tsx +86 -0
- package/src/v2/components/session-progress-indicator-v2.tsx +16 -0
- package/src/v2/components/session-review-empty-changes-v2.tsx +17 -0
- package/src/v2/components/session-review-empty-no-git-v2.tsx +28 -0
- package/src/v2/components/session-review-file-preview-v2-virtualize.ts +5 -0
- package/src/v2/components/session-review-file-preview-v2.tsx +266 -0
- package/src/v2/components/session-review-v2.css +653 -0
- package/src/v2/components/session-review-v2.tsx +422 -0
- package/src/v2/components/sidebar-presence-machine.ts +69 -0
- package/tsconfig.json +20 -0
- package/README.md +0 -3
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import { createStore } from "solid-js/store"
|
|
2
|
+
import { parseDiffFromFile } from "@pierre/diffs"
|
|
3
|
+
import { CurrentSessionProviders } from "../storybook/current-session-story"
|
|
4
|
+
import { editThenTestDocument, reviewDiffs } from "../storybook/current-session-fixtures"
|
|
5
|
+
import { File } from "./file"
|
|
6
|
+
import { Button } from "@zyro-sec/ui/button"
|
|
7
|
+
import { SessionReview, type SessionReviewComment, type SessionReviewFocus } from "./session-review"
|
|
8
|
+
|
|
9
|
+
type ReviewArgs = { split: boolean; empty: boolean; disableLineNumbers: boolean; overflow: "wrap" | "scroll" }
|
|
10
|
+
|
|
11
|
+
function ReviewStory(props: ReviewArgs) {
|
|
12
|
+
return (
|
|
13
|
+
<CurrentSessionProviders document={editThenTestDocument}>
|
|
14
|
+
<div class="mx-auto h-screen min-h-[620px] w-full max-w-[1100px] overflow-hidden bg-background-base">
|
|
15
|
+
<SessionReview
|
|
16
|
+
title="Changes in this Session"
|
|
17
|
+
diffs={props.empty ? [] : reviewDiffs}
|
|
18
|
+
open={reviewDiffs.map((diff) => diff.file)}
|
|
19
|
+
split={props.split}
|
|
20
|
+
overflow={props.overflow}
|
|
21
|
+
disableLineNumbers={props.disableLineNumbers}
|
|
22
|
+
/>
|
|
23
|
+
</div>
|
|
24
|
+
</CurrentSessionProviders>
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default {
|
|
29
|
+
title: "OpenCode/Review/Changed files",
|
|
30
|
+
id: "components-session-review",
|
|
31
|
+
component: SessionReview,
|
|
32
|
+
parameters: {
|
|
33
|
+
layout: "fullscreen",
|
|
34
|
+
docs: {
|
|
35
|
+
description: {
|
|
36
|
+
component:
|
|
37
|
+
"The production inline review surface with current Session diffs. Expand files, switch the view, and inspect the same content in both color schemes.",
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export const Unified = {
|
|
44
|
+
args: { split: false, empty: false, disableLineNumbers: false, overflow: "wrap" },
|
|
45
|
+
argTypes: { overflow: { options: ["wrap", "scroll"] } },
|
|
46
|
+
render: (args: ReviewArgs) => <ReviewStory {...args} />,
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const Split = {
|
|
50
|
+
...Unified,
|
|
51
|
+
args: { ...Unified.args, split: true },
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export const UnifiedDark = {
|
|
55
|
+
...Unified,
|
|
56
|
+
globals: { theme: "dark" },
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const commentFile = "src/review.ts"
|
|
60
|
+
|
|
61
|
+
const mentionPaths = [commentFile, "src/review.test.ts", "src/server.ts", "README.md"]
|
|
62
|
+
|
|
63
|
+
const commentDiffs = [
|
|
64
|
+
{
|
|
65
|
+
file: commentFile,
|
|
66
|
+
additions: 1,
|
|
67
|
+
deletions: 1,
|
|
68
|
+
status: "modified" as const,
|
|
69
|
+
patch:
|
|
70
|
+
"diff --git a/src/review.ts b/src/review.ts\n--- a/src/review.ts\n+++ b/src/review.ts\n@@ -1,3 +1,3 @@\n export const first = 1\n-export const value = 'before'\n+export const value = 'after'\n export const last = 3\n",
|
|
71
|
+
},
|
|
72
|
+
]
|
|
73
|
+
|
|
74
|
+
function InteractiveCommentsStory() {
|
|
75
|
+
const [state, setState] = createStore<{ comments: SessionReviewComment[]; next: number }>({ comments: [], next: 1 })
|
|
76
|
+
|
|
77
|
+
return (
|
|
78
|
+
<CurrentSessionProviders document={editThenTestDocument}>
|
|
79
|
+
<div class="mx-auto h-screen min-h-[620px] w-full max-w-[900px] overflow-hidden bg-background-base">
|
|
80
|
+
<SessionReview
|
|
81
|
+
title="Changes in this Session"
|
|
82
|
+
diffs={commentDiffs}
|
|
83
|
+
open={[commentFile]}
|
|
84
|
+
comments={state.comments}
|
|
85
|
+
onLineComment={(comment) => {
|
|
86
|
+
setState("comments", (comments) => [...comments, { id: `comment-${state.next}`, ...comment }])
|
|
87
|
+
setState("next", (next) => next + 1)
|
|
88
|
+
}}
|
|
89
|
+
onLineCommentUpdate={(update) =>
|
|
90
|
+
setState("comments", (comment) => comment.id === update.id, "comment", update.comment)
|
|
91
|
+
}
|
|
92
|
+
onLineCommentDelete={(target) =>
|
|
93
|
+
setState("comments", (comments) => comments.filter((comment) => comment.id !== target.id))
|
|
94
|
+
}
|
|
95
|
+
lineCommentActions={{
|
|
96
|
+
moreLabel: "More options",
|
|
97
|
+
editLabel: "Edit",
|
|
98
|
+
deleteLabel: "Delete",
|
|
99
|
+
saveLabel: "Save",
|
|
100
|
+
}}
|
|
101
|
+
lineCommentMention={{ items: (query) => mentionPaths.filter((path) => path.includes(query)) }}
|
|
102
|
+
/>
|
|
103
|
+
</div>
|
|
104
|
+
</CurrentSessionProviders>
|
|
105
|
+
)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export const InteractiveComments = { render: () => <InteractiveCommentsStory /> }
|
|
109
|
+
|
|
110
|
+
// A parent asks the review to reveal a saved comment, as a composer chip does. "Focus missing comment" names a
|
|
111
|
+
// comment that never renders, so the request settles by timing out.
|
|
112
|
+
function FocusedCommentStory() {
|
|
113
|
+
const [state, setState] = createStore<{ focus: SessionReviewFocus | null }>({ focus: null })
|
|
114
|
+
|
|
115
|
+
const comments: SessionReviewComment[] = [
|
|
116
|
+
{
|
|
117
|
+
id: "comment-1",
|
|
118
|
+
file: commentFile,
|
|
119
|
+
selection: { start: 2, end: 2, side: "additions" },
|
|
120
|
+
comment: "Saved comment",
|
|
121
|
+
},
|
|
122
|
+
]
|
|
123
|
+
|
|
124
|
+
return (
|
|
125
|
+
<CurrentSessionProviders document={editThenTestDocument}>
|
|
126
|
+
<div class="mx-auto flex h-screen min-h-[620px] w-full max-w-[900px] flex-col overflow-hidden bg-background-base">
|
|
127
|
+
<div class="flex items-center gap-2 p-2">
|
|
128
|
+
<Button size="small" onClick={() => setState("focus", { file: commentFile, id: "comment-1" })}>
|
|
129
|
+
Focus comment
|
|
130
|
+
</Button>
|
|
131
|
+
<Button size="small" onClick={() => setState("focus", { file: commentFile, id: "missing" })}>
|
|
132
|
+
Focus missing comment
|
|
133
|
+
</Button>
|
|
134
|
+
<span>
|
|
135
|
+
Focus request: <output>{state.focus?.id ?? "none"}</output>
|
|
136
|
+
</span>
|
|
137
|
+
</div>
|
|
138
|
+
<SessionReview
|
|
139
|
+
title="Changes in this Session"
|
|
140
|
+
diffs={commentDiffs}
|
|
141
|
+
open={[commentFile]}
|
|
142
|
+
comments={comments}
|
|
143
|
+
focusedComment={state.focus}
|
|
144
|
+
onFocusedCommentChange={(focus) => setState("focus", focus)}
|
|
145
|
+
onLineComment={() => undefined}
|
|
146
|
+
/>
|
|
147
|
+
</div>
|
|
148
|
+
</CurrentSessionProviders>
|
|
149
|
+
)
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export const FocusedComment = { render: () => <FocusedCommentStory /> }
|
|
153
|
+
|
|
154
|
+
const gitDiffs = [
|
|
155
|
+
{
|
|
156
|
+
// OpenCode 93e1f383dd79683af4fc5ad139cea0516603c838, unchanged git-show output.
|
|
157
|
+
file: "packages/session-ui/src/components/file.tsx",
|
|
158
|
+
additions: 1,
|
|
159
|
+
deletions: 1,
|
|
160
|
+
patch: `diff --git a/packages/session-ui/src/components/file.tsx b/packages/session-ui/src/components/file.tsx
|
|
161
|
+
index 704971b014..4876731cbd 100644
|
|
162
|
+
--- a/packages/session-ui/src/components/file.tsx
|
|
163
|
+
+++ b/packages/session-ui/src/components/file.tsx
|
|
164
|
+
@@ -702,7 +702,7 @@ function ViewerShell(props: {
|
|
165
|
+
data-mode={props.mode}
|
|
166
|
+
dir="ltr"
|
|
167
|
+
style={styleVariables}
|
|
168
|
+
- class="relative outline-none"
|
|
169
|
+
+ class="relative select-text outline-none"
|
|
170
|
+
classList={{
|
|
171
|
+
...props.classList,
|
|
172
|
+
[props.class ?? ""]: !!props.class,
|
|
173
|
+
`,
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
// OpenCode 497a24c17d, unchanged git-show output.
|
|
177
|
+
file: "packages/core/src/session/runner/retry.ts",
|
|
178
|
+
additions: 1,
|
|
179
|
+
deletions: 1,
|
|
180
|
+
patch: `diff --git a/packages/core/src/session/runner/retry.ts b/packages/core/src/session/runner/retry.ts
|
|
181
|
+
index 10f6680097..ef26792ffe 100644
|
|
182
|
+
--- a/packages/core/src/session/runner/retry.ts
|
|
183
|
+
+++ b/packages/core/src/session/runner/retry.ts
|
|
184
|
+
@@ -15,7 +15,7 @@ export interface Input {
|
|
185
|
+
}
|
|
186
|
+
\x20
|
|
187
|
+
export function isRetryable(error: AIError) {
|
|
188
|
+
- const override = "http" in error.reason ? error.reason.http?.response?.headers["x-should-retry"] : undefined
|
|
189
|
+
+ const override = error.reason.http?.headers["x-should-retry"]
|
|
190
|
+
if (override === "true") return true
|
|
191
|
+
if (override === "false") return false
|
|
192
|
+
switch (error.reason._tag) {
|
|
193
|
+
`,
|
|
194
|
+
},
|
|
195
|
+
]
|
|
196
|
+
|
|
197
|
+
export const InlineChanges = {
|
|
198
|
+
args: { split: false },
|
|
199
|
+
render: (args: { split: boolean }) => (
|
|
200
|
+
<CurrentSessionProviders document={editThenTestDocument}>
|
|
201
|
+
<div class="mx-auto h-screen min-h-[620px] w-full max-w-[1100px] overflow-hidden bg-background-base">
|
|
202
|
+
<SessionReview
|
|
203
|
+
title="OpenCode Git history"
|
|
204
|
+
diffs={gitDiffs}
|
|
205
|
+
open={gitDiffs.map((diff) => diff.file)}
|
|
206
|
+
split={args.split}
|
|
207
|
+
/>
|
|
208
|
+
</div>
|
|
209
|
+
</CurrentSessionProviders>
|
|
210
|
+
),
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export const LargeFile = {
|
|
214
|
+
args: { split: false, source: "files" },
|
|
215
|
+
argTypes: { source: { control: "select", options: ["files", "metadata"] } },
|
|
216
|
+
render: (args: { split: boolean; source: string }) => {
|
|
217
|
+
// Cross the viewer's 500,000-character limit without long changed lines or 1,000 total lines.
|
|
218
|
+
const padding = `// ${"unchanged ".repeat(70)}\n`.repeat(800)
|
|
219
|
+
const before = { name: "large.ts", contents: `export const value = 'before'\n${padding}` }
|
|
220
|
+
const after = { name: "large.ts", contents: `export const value = 'after'\n${padding}` }
|
|
221
|
+
|
|
222
|
+
return (
|
|
223
|
+
<div class="h-screen overflow-auto bg-background-base">
|
|
224
|
+
<File
|
|
225
|
+
mode="diff"
|
|
226
|
+
{...(args.source === "metadata" ? { fileDiff: parseDiffFromFile(before, after) } : { before, after })}
|
|
227
|
+
diffStyle={args.split ? "split" : "unified"}
|
|
228
|
+
/>
|
|
229
|
+
</div>
|
|
230
|
+
)
|
|
231
|
+
},
|
|
232
|
+
}
|