Skip to content

Commit f7b86b9

Browse files
committed
Fix fmt
1 parent 5ec6d81 commit f7b86b9

File tree

1 file changed

+34
-36
lines changed

1 file changed

+34
-36
lines changed

src/browser/components/RightSidebar/CodeReview/ReviewPanel.stories.tsx

Lines changed: 34 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -46,34 +46,34 @@ const reviewPanelDiff = joinLines([
4646
"- setRefreshTrigger((prev) => prev + 1);",
4747
"+ setRefreshTrigger((prev) => prev + 1);",
4848
"+ if (idleForMs > 5000) {",
49-
"+ console.debug(\"ReviewPanel idle refresh\", { workspaceId, idleForMs });",
49+
'+ console.debug("ReviewPanel idle refresh", { workspaceId, idleForMs });',
5050
"+ }",
51-
"+ if (typeof window !== \"undefined\") {",
51+
'+ if (typeof window !== "undefined") {',
5252
"+ window.dispatchEvent(",
53-
"+ new CustomEvent(\"review-panel:refresh\", { detail: { workspaceId, idleForMs } })",
53+
'+ new CustomEvent("review-panel:refresh", { detail: { workspaceId, idleForMs } })',
5454
"+ );",
5555
"+ }",
5656
" };",
5757
"",
5858
"@@ -642,6 +656,14 @@ export const ReviewPanel = ({",
59-
"- <div className=\"border-border-light bg-separator border-b px-3 py-2\">",
60-
"+ <div className=\"border-border-light bg-separator border-b px-3 py-2 sticky top-0 z-10 backdrop-blur-sm\">",
61-
" <div className=\"border-border-light bg-dark hover:border-border-gray focus-within:border-accent focus-within:hover:border-accent flex items-stretch overflow-hidden rounded border transition-[border-color] duration-150\">",
62-
"+ <span className=\"text-dim flex items-center px-2 text-[10px] uppercase tracking-wide\">",
59+
'- <div className="border-border-light bg-separator border-b px-3 py-2">',
60+
'+ <div className="border-border-light bg-separator border-b px-3 py-2 sticky top-0 z-10 backdrop-blur-sm">',
61+
' <div className="border-border-light bg-dark hover:border-border-gray focus-within:border-accent focus-within:hover:border-accent flex items-stretch overflow-hidden rounded border transition-[border-color] duration-150">',
62+
'+ <span className="text-dim flex items-center px-2 text-[10px] uppercase tracking-wide">',
6363
"+ Search",
6464
"+ </span>",
6565
" <input",
6666
"",
6767
"@@ -707,6 +729,12 @@ export const ReviewPanel = ({",
6868
" {(fileTree ?? isLoadingTree) && (",
69-
" <div className=\"border-border-light flex w-full flex-[0_0_auto] flex-col overflow-hidden border-b\">",
69+
' <div className="border-border-light flex w-full flex-[0_0_auto] flex-col overflow-hidden border-b">',
7070
" <FileTree",
7171
" root={fileTree}",
7272
" selectedPath={selectedFilePath}",
7373
" onSelectFile={setSelectedFilePath}",
7474
"- isLoading={isLoadingTree}",
7575
"+ isLoading={isLoadingTree}",
76-
"+ key={selectedFilePath ?? \"all-files\"}",
76+
'+ key={selectedFilePath ?? "all-files"}',
7777
" getFileReadStatus={getFileReadStatus}",
7878
" workspaceId={workspaceId}",
7979
" />",
@@ -114,29 +114,29 @@ const hunkViewerDiff = joinLines([
114114
"",
115115
"@@ -182,7 +190,8 @@ export const HunkViewer = React.memo<HunkViewerProps>(",
116116
" className={cn(",
117-
" \"bg-dark border rounded mb-3 overflow-hidden cursor-pointer transition-all duration-200\",",
118-
" \"focus:outline-none focus-visible:outline-none\",",
119-
" isRead ? \"border-read\" : \"border-border-light\",",
120-
"- isSelected && \"border-review-accent shadow-[0_0_0_1px_var(--color-review-accent)]\"",
121-
"+ isSelected && \"border-review-accent shadow-[0_0_0_1px_var(--color-review-accent)]\",",
122-
"+ isPinned && \"ring-1 ring-review-accent/70\"",
117+
' "bg-dark border rounded mb-3 overflow-hidden cursor-pointer transition-all duration-200",',
118+
' "focus:outline-none focus-visible:outline-none",',
119+
' isRead ? "border-read" : "border-border-light",',
120+
'- isSelected && "border-review-accent shadow-[0_0_0_1px_var(--color-review-accent)]"',
121+
'+ isSelected && "border-review-accent shadow-[0_0_0_1px_var(--color-review-accent)]",',
122+
'+ isPinned && "ring-1 ring-review-accent/70"',
123123
" )}",
124124
"",
125125
"@@ -206,6 +215,18 @@ export const HunkViewer = React.memo<HunkViewerProps>(",
126-
" <div className=\"flex shrink-0 items-center gap-2 text-[11px] whitespace-nowrap\">",
126+
' <div className="flex shrink-0 items-center gap-2 text-[11px] whitespace-nowrap">',
127127
"+ <TooltipWrapper inline>",
128128
"+ <button",
129129
"+ className={cn(",
130-
"+ \"border-border-light flex cursor-pointer items-center gap-1 rounded-[3px] border bg-transparent px-1.5 py-0.5 text-[11px] transition-all duration-200\",",
131-
"+ isPinned ? \"text-warning-light border-warning\" : \"text-muted hover:text-foreground\",",
132-
"+ isPinned && \"bg-warning/10\"",
130+
'+ "border-border-light flex cursor-pointer items-center gap-1 rounded-[3px] border bg-transparent px-1.5 py-0.5 text-[11px] transition-all duration-200",',
131+
'+ isPinned ? "text-warning-light border-warning" : "text-muted hover:text-foreground",',
132+
'+ isPinned && "bg-warning/10"',
133133
"+ )}",
134-
"+ type=\"button\"",
134+
'+ type="button"',
135135
"+ onClick={handlePinToggle}",
136136
"+ >",
137-
"+ {isPinned ? \"Pinned\" : \"Pin\"}",
137+
'+ {isPinned ? "Pinned" : "Pin"}',
138138
"+ </button>",
139-
"+ <Tooltip align=\"center\" position=\"top\">",
139+
'+ <Tooltip align="center" position="top">',
140140
"+ Keep this hunk expanded while scrolling",
141141
"+ </Tooltip>",
142142
"+ </TooltipWrapper>",
@@ -287,16 +287,16 @@ const packageJsonDiff = joinLines([
287287
"--- a/package.json",
288288
"+++ b/package.json",
289289
"@@ -5,7 +5,8 @@",
290-
" \"name\": \"mux\",",
291-
" \"scripts\": {",
292-
"- \"storybook\": \"storybook dev -p 6006\"",
293-
"+ \"storybook\": \"storybook dev -p 6006\",",
294-
"+ \"storybook:code-review\": \"storybook dev -p 6006 --docs\"",
290+
' "name": "mux",',
291+
' "scripts": {',
292+
'- "storybook": "storybook dev -p 6006"',
293+
'+ "storybook": "storybook dev -p 6006",',
294+
'+ "storybook:code-review": "storybook dev -p 6006 --docs"',
295295
" },",
296-
" \"devDependencies\": {",
296+
' "devDependencies": {',
297297
"@@ -23,4 +24,5 @@",
298-
" \"lint-staged\": {},",
299-
"+ \"codeReviewPanel\": \"storybook\"",
298+
' "lint-staged": {},',
299+
'+ "codeReviewPanel": "storybook"',
300300
" }",
301301
]);
302302

@@ -388,12 +388,11 @@ function setupCodeReviewMocks(config: ScenarioConfig) {
388388
const pathMatch = pathRegex.exec(command);
389389
const pathFilter = pathMatch?.[1];
390390
const diffOutput = pathFilter
391-
? config.diffByFile[pathFilter] ?? ""
392-
: Object.values(config.diffByFile)
393-
.filter(Boolean)
394-
.join("\n\n");
391+
? (config.diffByFile[pathFilter] ?? "")
392+
: Object.values(config.diffByFile).filter(Boolean).join("\n\n");
395393

396-
const truncated = !pathFilter && config.truncated ? { truncated: config.truncated } : undefined;
394+
const truncated =
395+
!pathFilter && config.truncated ? { truncated: config.truncated } : undefined;
397396
return Promise.resolve(createSuccessResult(diffOutput, truncated));
398397
}
399398

@@ -485,4 +484,3 @@ export const EmptyState: Story = {
485484
},
486485
render: () => <ReviewPanelStoryWrapper scenario="empty" />,
487486
};
488-

0 commit comments

Comments
 (0)