@nkzw/codiff-core 1.12.0 → 1.13.0

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.
@@ -39,7 +39,7 @@ type HeaderReviewDiffBlock = {
39
39
  selected?: boolean;
40
40
  };
41
41
  export type ReviewDiffBlock = FileReviewDiffBlock | HeaderReviewDiffBlock;
42
- export declare function ReviewCodeView({ activeSearchMatch, agentId, agentLabel, allowViewedToggle, blocks, bottomInset, codeQualityFindings, collapsed, comments, commitMetadata, diffLineHeight, diffStyle, disableWorkerPool, expandedGenerated, files, focusCommentId, focusCommentRequest, forceExpandedPaths, gitIdentity, hunkNavigation, initialMarkdownPreviewSectionIds, isReadOnly, itemVersionByKey, keymap, loadingSectionIds, onActiveBlockChange, onAskCodex, onCommentDraftChange, onCreateComment, onDeleteComment, onFindDefinitions, onLoadImageContent, onLoadSection, onLoadSectionContents, onOpenDefinition, onOpenFile, onRefreshMarkdown, onResolveThread, onSaveCommentEdit, onSelectPathFromScroll, onSubmitComment, onToggleCollapsed, onToggleViewed, onUpdateComment, onUpdateSourceDescription, onUpdateSourceTitle, onUploadSourceDescriptionAsset, reviewIdentityByPath, scrollTarget, searchQuery, selectedPath, showSourceDescription, showWhitespace, source, sourceDescriptionActions, sourceDescriptionFooter, supportsReviewCommentActions, theme, viewed, walkthroughNotes, wordWrap, }: {
42
+ export declare function ReviewCodeView({ activeSearchMatch, agentId, agentLabel, allowViewedToggle, blocks, bottomInset, codeQualityFindings, collapsed, comments, commitMetadata, diffLineHeight, diffStyle, disableWorkerPool, expandedReviewKeys, files, focusCommentId, focusCommentRequest, forceExpandedPaths, gitIdentity, hunkNavigation, initialMarkdownPreviewSectionIds, isReadOnly, itemVersionByKey, keymap, loadingSectionIds, onActiveBlockChange, onAskCodex, onCommentDraftChange, onCreateComment, onDeleteComment, onFindDefinitions, onLoadImageContent, onLoadSection, onLoadSectionContents, onOpenDefinition, onOpenFile, onRefreshMarkdown, onResolveThread, onSaveCommentEdit, onSelectPathFromScroll, onSubmitComment, onToggleCollapsed, onToggleViewed, onUpdateComment, onUpdateSourceDescription, onUpdateSourceTitle, onUploadSourceDescriptionAsset, reviewIdentityByPath, scrollTarget, searchQuery, selectedPath, showSourceDescription, showWhitespace, source, sourceDescriptionActions, sourceDescriptionFooter, supportsReviewCommentActions, theme, viewed, walkthroughNotes, wordWrap, }: {
43
43
  activeSearchMatch: DiffSearchMatch | null;
44
44
  agentId: 'codex' | 'claude' | 'opencode' | 'pi';
45
45
  agentLabel: string;
@@ -53,7 +53,7 @@ export declare function ReviewCodeView({ activeSearchMatch, agentId, agentLabel,
53
53
  diffLineHeight?: number;
54
54
  diffStyle: CodiffDiffStyle;
55
55
  disableWorkerPool?: boolean;
56
- expandedGenerated?: ReadonlySet<string>;
56
+ expandedReviewKeys?: ReadonlySet<string>;
57
57
  files: ReadonlyArray<ChangedFile>;
58
58
  focusCommentId: string | null;
59
59
  focusCommentRequest: number;
@@ -7,11 +7,11 @@ type UseReviewFileStateOptions = {
7
7
  export declare function useReviewFileState({ initialSelectedPath, onViewedChange, }?: UseReviewFileStateOptions): {
8
8
  bumpItemVersion: (key: string) => void;
9
9
  collapsed: Set<string>;
10
- expandedGenerated: Set<string>;
10
+ expandedReviewKeys: Set<string>;
11
11
  itemVersionByKey: Record<string, number>;
12
12
  selectedPath: string | null;
13
13
  setCollapsed: import("react").Dispatch<import("react").SetStateAction<Set<string>>>;
14
- setExpandedGenerated: import("react").Dispatch<import("react").SetStateAction<Set<string>>>;
14
+ setExpandedReviewKeys: import("react").Dispatch<import("react").SetStateAction<Set<string>>>;
15
15
  setItemVersionByKey: import("react").Dispatch<import("react").SetStateAction<Record<string, number>>>;
16
16
  setSelectedPath: import("react").Dispatch<import("react").SetStateAction<string | null>>;
17
17
  setViewed: import("react").Dispatch<import("react").SetStateAction<Record<string, string>>>;
@@ -52,6 +52,14 @@ export type ReviewScrollTarget = {
52
52
  request: number;
53
53
  };
54
54
  export type ReviewIdentity = {
55
+ coverage?: {
56
+ allHunkIds: ReadonlyArray<string>;
57
+ file: {
58
+ fingerprint: string;
59
+ key: string;
60
+ };
61
+ hunkIds: ReadonlyArray<string>;
62
+ };
55
63
  fingerprint: string;
56
64
  key: string;
57
65
  };
@@ -106,7 +114,7 @@ export type WalkthroughNote = {
106
114
  };
107
115
  export type SourceSession = {
108
116
  collapsed: Set<string>;
109
- expandedGenerated: Set<string>;
117
+ expandedReviewKeys: Set<string>;
110
118
  /** Populated by a generated or pre-authored narrative walkthrough document. */
111
119
  narrativeWalkthrough?: NarrativeWalkthrough | null;
112
120
  reviewComments: ReadonlyArray<ReviewComment>;
@@ -42,6 +42,7 @@ export declare const formatWalkthroughFileLineRows: (items: ReadonlyArray<{
42
42
  deleted: number;
43
43
  path: string;
44
44
  }>, maxVisibleFiles?: number) => ReadonlyArray<WalkthroughFileLineRow>;
45
+ export declare const getUncoveredWalkthroughReviewIdentity: (file: ChangedFile, view: WalkthroughView, showWhitespace: boolean) => import("./app-types.ts").ReviewIdentity;
45
46
  export declare const getUncoveredWalkthroughFiles: (files: ReadonlyArray<ChangedFile>, view: WalkthroughView, showWhitespace: boolean) => ReadonlyArray<ChangedFile>;
46
47
  export declare const getUncoveredWalkthroughFileLineItems: (files: ReadonlyArray<ChangedFile>, view: WalkthroughView, showWhitespace: boolean) => ReadonlyArray<{
47
48
  added: number;
@@ -1,6 +1,9 @@
1
1
  import type { ChangedFile } from '../types.ts';
2
2
  import type { ReviewIdentity } from './app-types.ts';
3
3
  export declare const getFileReviewIdentity: (file: ChangedFile) => ReviewIdentity;
4
+ export declare const getWalkthroughReviewKeyPrefix: (path: string) => string;
5
+ export declare const getSectionReviewHunkIds: (file: ChangedFile, section: ChangedFile['sections'][number]) => ReadonlyArray<string>;
6
+ export declare const getWalkthroughReviewIdentity: (file: ChangedFile, hunkIds: ReadonlyArray<string>) => ReviewIdentity;
4
7
  export declare const getReviewIdentity: (file: ChangedFile, identityByPath?: ReadonlyMap<string, ReviewIdentity>) => ReviewIdentity;
5
8
  export declare const isReviewIdentityViewed: (viewed: Readonly<Record<string, string>>, identity: ReviewIdentity) => boolean;
6
9
  export declare const updateReviewIdentityViewed: (viewed: Readonly<Record<string, string>>, identity: ReviewIdentity, currentlyViewed: boolean) => Record<string, string>;
package/dist/react.mjs CHANGED
@@ -3945,18 +3945,46 @@ const getFileReviewIdentity = (file) => ({
3945
3945
  fingerprint: file.fingerprint,
3946
3946
  key: file.path
3947
3947
  });
3948
+ const getWalkthroughReviewKeyPrefix = (path) => `walkthrough:${JSON.stringify(path)}:`;
3949
+ const getHunkViewedKey = (path, hunkId) => `${getWalkthroughReviewKeyPrefix(path)}${JSON.stringify(hunkId)}`;
3950
+ const getSectionReviewHunkIds = (file, section) => {
3951
+ const ids = getSectionWalkthroughHunks(file, section).map((hunk) => hunk.id);
3952
+ return ids.length > 0 ? ids : [section.id];
3953
+ };
3954
+ const getWalkthroughReviewIdentity = (file, hunkIds) => ({
3955
+ coverage: {
3956
+ allHunkIds: file.sections.flatMap((section) => getSectionReviewHunkIds(file, section)),
3957
+ file: getFileReviewIdentity(file),
3958
+ hunkIds
3959
+ },
3960
+ fingerprint: file.fingerprint,
3961
+ key: `${getWalkthroughReviewKeyPrefix(file.path)}${JSON.stringify(hunkIds)}`
3962
+ });
3948
3963
  const getReviewIdentity = (file, identityByPath) => identityByPath?.get(file.path) ?? getFileReviewIdentity(file);
3949
- const isReviewIdentityViewed = (viewed, identity) => viewed[identity.key] === identity.fingerprint;
3964
+ const isReviewIdentityViewed = (viewed, identity) => {
3965
+ const { coverage } = identity;
3966
+ return coverage ? viewed[coverage.file.key] === coverage.file.fingerprint || coverage.hunkIds.length > 0 && coverage.hunkIds.every((id) => viewed[getHunkViewedKey(coverage.file.key, id)] === coverage.file.fingerprint) : viewed[identity.key] === identity.fingerprint;
3967
+ };
3950
3968
  const updateReviewIdentityViewed = (viewed, identity, currentlyViewed) => {
3951
- if (currentlyViewed) {
3952
- const next = { ...viewed };
3953
- delete next[identity.key];
3969
+ const next = { ...viewed };
3970
+ const { coverage } = identity;
3971
+ if (coverage) {
3972
+ const { allHunkIds, file, hunkIds } = coverage;
3973
+ if (viewed[file.key] === file.fingerprint) for (const id of allHunkIds) next[getHunkViewedKey(file.key, id)] = file.fingerprint;
3974
+ for (const id of hunkIds) {
3975
+ const key = getHunkViewedKey(file.key, id);
3976
+ if (currentlyViewed) delete next[key];
3977
+ else next[key] = file.fingerprint;
3978
+ }
3979
+ if (allHunkIds.length > 0 && allHunkIds.every((id) => next[getHunkViewedKey(file.key, id)] === file.fingerprint)) next[file.key] = file.fingerprint;
3980
+ else delete next[file.key];
3954
3981
  return next;
3955
3982
  }
3956
- return {
3957
- ...viewed,
3958
- [identity.key]: identity.fingerprint
3959
- };
3983
+ const prefix = getWalkthroughReviewKeyPrefix(identity.key);
3984
+ for (const key of Object.keys(next)) if (key.startsWith(prefix)) delete next[key];
3985
+ if (currentlyViewed) delete next[identity.key];
3986
+ else next[identity.key] = identity.fingerprint;
3987
+ return next;
3960
3988
  };
3961
3989
  const updateReviewIdentityCollapsed = (collapsed, identity, currentlyCollapsed) => {
3962
3990
  const next = new Set(collapsed);
@@ -4308,6 +4336,7 @@ const getUncoveredWalkthroughSection = (file, section, coveredHunkIds, coveredSe
4308
4336
  if (coveredSyntheticSectionIds.has(section.id)) return null;
4309
4337
  const hunkIds = getSectionHunkIds(file, section);
4310
4338
  if (hunkIds.length === 0) return coveredSectionIds.has(section.id) ? null : {
4339
+ hunkIds: [section.id],
4311
4340
  identity: section.id,
4312
4341
  section
4313
4342
  };
@@ -4315,11 +4344,13 @@ const getUncoveredWalkthroughSection = (file, section, coveredHunkIds, coveredSe
4315
4344
  if (uncoveredHunkIds.length === 0) return null;
4316
4345
  const identity = `${section.id}:${uncoveredHunkIds.join(",")}`;
4317
4346
  if (uncoveredHunkIds.length === hunkIds.length) return {
4347
+ hunkIds: uncoveredHunkIds,
4318
4348
  identity,
4319
4349
  section
4320
4350
  };
4321
4351
  const patch = filterPatchToHunkIds(section.patch, section.id, uncoveredHunkIds);
4322
4352
  return patch ? {
4353
+ hunkIds: uncoveredHunkIds,
4323
4354
  identity,
4324
4355
  section: {
4325
4356
  ...section,
@@ -4327,6 +4358,13 @@ const getUncoveredWalkthroughSection = (file, section, coveredHunkIds, coveredSe
4327
4358
  }
4328
4359
  } : null;
4329
4360
  };
4361
+ const getUncoveredWalkthroughReviewIdentity = (file, view, showWhitespace) => {
4362
+ const coveredHunkIds = walkthroughCoveredHunkIds(view);
4363
+ const coveredSectionIds = walkthroughCoveredSectionIds(view);
4364
+ const coveredSyntheticSectionIds = walkthroughCoveredSyntheticSectionIds(view);
4365
+ const hunkIds = getVisibleDiffSections(file, showWhitespace).flatMap(({ section }) => getUncoveredWalkthroughSection(file, section, coveredHunkIds, coveredSectionIds, coveredSyntheticSectionIds)?.hunkIds ?? []);
4366
+ return getWalkthroughReviewIdentity(file, hunkIds);
4367
+ };
4330
4368
  const getUncoveredWalkthroughFiles = (files, view, showWhitespace) => {
4331
4369
  const coveredHunkIds = walkthroughCoveredHunkIds(view);
4332
4370
  const coveredSectionIds = walkthroughCoveredSectionIds(view);
@@ -4973,7 +5011,7 @@ function DiffLineCountBadge({ ariaLabelPrefix, className = "codiff-line-count",
4973
5011
  //#endregion
4974
5012
  //#region app/components/ReviewCodeView.tsx
4975
5013
  const emptyMarkdownPreviewSectionIds = /* @__PURE__ */ new Set();
4976
- const emptyExpandedGenerated = /* @__PURE__ */ new Set();
5014
+ const emptyExpandedReviewKeys = /* @__PURE__ */ new Set();
4977
5015
  const markdownPreviewPlugins = [frontmatterPlugin(), imagePlugin({
4978
5016
  disableImageResize: true,
4979
5017
  disableImageSettingsButton: true
@@ -6604,7 +6642,7 @@ const getHunkSelectionRange = (hunk) => {
6604
6642
  } : null;
6605
6643
  };
6606
6644
  const isSameSelection = (a, b) => a.start === b.start && a.end === b.end && a.side === b.side;
6607
- function ReviewCodeView({ activeSearchMatch, agentId, agentLabel, allowViewedToggle = false, blocks, bottomInset = codeViewLayout.paddingBottom, codeQualityFindings = [], collapsed, comments, commitMetadata, diffLineHeight = 20, diffStyle, disableWorkerPool = false, expandedGenerated = emptyExpandedGenerated, files, focusCommentId, focusCommentRequest, forceExpandedPaths, gitIdentity, hunkNavigation, initialMarkdownPreviewSectionIds = emptyMarkdownPreviewSectionIds, isReadOnly = false, itemVersionByKey, keymap, loadingSectionIds, onActiveBlockChange, onAskCodex, onCommentDraftChange, onCreateComment, onDeleteComment, onFindDefinitions, onLoadImageContent, onLoadSection, onLoadSectionContents, onOpenDefinition, onOpenFile, onRefreshMarkdown, onResolveThread = noopResolveThread, onSaveCommentEdit, onSelectPathFromScroll, onSubmitComment, onToggleCollapsed, onToggleViewed, onUpdateComment, onUpdateSourceDescription, onUpdateSourceTitle, onUploadSourceDescriptionAsset, reviewIdentityByPath, scrollTarget, searchQuery, selectedPath, showSourceDescription = true, showWhitespace, source, sourceDescriptionActions, sourceDescriptionFooter, supportsReviewCommentActions, theme = "system", viewed, walkthroughNotes, wordWrap }) {
6645
+ function ReviewCodeView({ activeSearchMatch, agentId, agentLabel, allowViewedToggle = false, blocks, bottomInset = codeViewLayout.paddingBottom, codeQualityFindings = [], collapsed, comments, commitMetadata, diffLineHeight = 20, diffStyle, disableWorkerPool = false, expandedReviewKeys = emptyExpandedReviewKeys, files, focusCommentId, focusCommentRequest, forceExpandedPaths, gitIdentity, hunkNavigation, initialMarkdownPreviewSectionIds = emptyMarkdownPreviewSectionIds, isReadOnly = false, itemVersionByKey, keymap, loadingSectionIds, onActiveBlockChange, onAskCodex, onCommentDraftChange, onCreateComment, onDeleteComment, onFindDefinitions, onLoadImageContent, onLoadSection, onLoadSectionContents, onOpenDefinition, onOpenFile, onRefreshMarkdown, onResolveThread = noopResolveThread, onSaveCommentEdit, onSelectPathFromScroll, onSubmitComment, onToggleCollapsed, onToggleViewed, onUpdateComment, onUpdateSourceDescription, onUpdateSourceTitle, onUploadSourceDescriptionAsset, reviewIdentityByPath, scrollTarget, searchQuery, selectedPath, showSourceDescription = true, showWhitespace, source, sourceDescriptionActions, sourceDescriptionFooter, supportsReviewCommentActions, theme = "system", viewed, walkthroughNotes, wordWrap }) {
6608
6646
  const codeViewRef = useRef(null);
6609
6647
  const markdownEditorRefs = useRef(/* @__PURE__ */ new Map());
6610
6648
  const refreshingMarkdownSectionsRef = useRef(/* @__PURE__ */ new Set());
@@ -6729,7 +6767,7 @@ function ReviewCodeView({ activeSearchMatch, agentId, agentLabel, allowViewedTog
6729
6767
  const reviewIdentity = block.reviewIdentity ?? getReviewIdentity(file, reviewIdentityByPath);
6730
6768
  const reviewKey = reviewIdentity.key;
6731
6769
  const isViewed = isReviewIdentityViewed(viewed, reviewIdentity);
6732
- const isCollapsed = !forceExpandedPaths.has(file.path) && !expandedGenerated.has(reviewKey) && (collapsed.has(reviewKey) || isGeneratedWalkthroughFile(file));
6770
+ const isCollapsed = !forceExpandedPaths.has(file.path) && !expandedReviewKeys.has(reviewKey) && (isViewed || collapsed.has(reviewKey) || isGeneratedWalkthroughFile(file));
6733
6771
  const visibleSections = getVisibleDiffSections(file, showWhitespace);
6734
6772
  const lineCount = getDiffLineCountFromVisibleSections(visibleSections);
6735
6773
  const sections = isCollapsed ? visibleSections.slice(0, 1) : visibleSections;
@@ -6891,7 +6929,7 @@ function ReviewCodeView({ activeSearchMatch, agentId, agentLabel, allowViewedTog
6891
6929
  commentsBySection,
6892
6930
  diffLineHeight,
6893
6931
  diffStyle,
6894
- expandedGenerated,
6932
+ expandedReviewKeys,
6895
6933
  forceExpandedPaths,
6896
6934
  imagePreviewLayoutPassBySection,
6897
6935
  isReadOnly,
@@ -8455,10 +8493,7 @@ const getFocusedRunDiffs = (item, files) => resolveWalkthroughHunkRuns(item, fil
8455
8493
  return focused ? [{
8456
8494
  file: focused,
8457
8495
  note: getWalkthroughRunNote(item, run),
8458
- reviewIdentity: {
8459
- fingerprint: focused.fingerprint,
8460
- key: `walkthrough:${run.key}`
8461
- }
8496
+ reviewIdentity: getWalkthroughReviewIdentity(run.resolved.file, run.hunks.flatMap((hunk) => hunk.kind === "synthetic" ? getSectionReviewHunkIds(run.resolved.file, run.resolved.section) : [hunk.id]))
8462
8497
  }] : [];
8463
8498
  });
8464
8499
  const getWalkthroughNavigationKeyDirection = (event) => {
@@ -8572,10 +8607,7 @@ const createSupportBlocks = (files, selected, walkthroughView, showWhitespace) =
8572
8607
  id: blockId,
8573
8608
  itemIdPrefix: blockId,
8574
8609
  note: "Not included in the generated walkthrough.",
8575
- reviewIdentity: {
8576
- fingerprint: file.fingerprint,
8577
- key: blockId
8578
- }
8610
+ reviewIdentity: getUncoveredWalkthroughReviewIdentity(files.find((candidate) => candidate.path === file.path), walkthroughView, showWhitespace)
8579
8611
  });
8580
8612
  }
8581
8613
  return blocks;
@@ -9492,7 +9524,7 @@ function useReviewCommentDrafts({ canCreateComment = true, comments, onCommentFi
9492
9524
  //#region app/hooks/useReviewState.ts
9493
9525
  function useReviewFileState({ initialSelectedPath = null, onViewedChange } = {}) {
9494
9526
  const [collapsed, setCollapsed] = useState(() => /* @__PURE__ */ new Set());
9495
- const [expandedGenerated, setExpandedGenerated] = useState(() => /* @__PURE__ */ new Set());
9527
+ const [expandedReviewKeys, setExpandedReviewKeys] = useState(() => /* @__PURE__ */ new Set());
9496
9528
  const [itemVersionByKey, setItemVersionByKey] = useState({});
9497
9529
  const [selectedPath, setSelectedPath] = useState(initialSelectedPath);
9498
9530
  const [viewed, setViewed] = useState({});
@@ -9505,11 +9537,11 @@ function useReviewFileState({ initialSelectedPath = null, onViewedChange } = {})
9505
9537
  return {
9506
9538
  bumpItemVersion,
9507
9539
  collapsed,
9508
- expandedGenerated,
9540
+ expandedReviewKeys,
9509
9541
  itemVersionByKey,
9510
9542
  selectedPath,
9511
9543
  setCollapsed,
9512
- setExpandedGenerated,
9544
+ setExpandedReviewKeys,
9513
9545
  setItemVersionByKey,
9514
9546
  setSelectedPath,
9515
9547
  setViewed,
@@ -9520,9 +9552,9 @@ function useReviewFileState({ initialSelectedPath = null, onViewedChange } = {})
9520
9552
  else next.add(reviewKey);
9521
9553
  return next;
9522
9554
  });
9523
- setExpandedGenerated((current) => {
9555
+ setExpandedReviewKeys((current) => {
9524
9556
  const next = new Set(current);
9525
- if (isCollapsed && isGeneratedWalkthroughFile(file)) next.add(reviewKey);
9557
+ if (isCollapsed) next.add(reviewKey);
9526
9558
  else next.delete(reviewKey);
9527
9559
  return next;
9528
9560
  });
@@ -9534,12 +9566,20 @@ function useReviewFileState({ initialSelectedPath = null, onViewedChange } = {})
9534
9566
  onViewedChange?.(next);
9535
9567
  return next;
9536
9568
  });
9537
- setCollapsed((current) => updateReviewIdentityCollapsed(current, reviewIdentity, isViewed));
9538
- if (!isViewed) setExpandedGenerated((current) => {
9539
- const next = new Set(current);
9540
- next.delete(reviewIdentity.key);
9541
- return next;
9542
- });
9569
+ const fileKey = reviewIdentity.coverage?.file.key ?? file.path;
9570
+ const prefix = getWalkthroughReviewKeyPrefix(fileKey);
9571
+ const clearRelatedKeys = (current) => new Set([...current].filter((key) => key !== fileKey && (reviewIdentity.coverage ? key !== reviewIdentity.key : !key.startsWith(prefix))));
9572
+ if (reviewIdentity.coverage || reviewIdentity.key === file.path) {
9573
+ setCollapsed(clearRelatedKeys);
9574
+ setExpandedReviewKeys(clearRelatedKeys);
9575
+ } else {
9576
+ setCollapsed((current) => updateReviewIdentityCollapsed(current, reviewIdentity, isViewed));
9577
+ setExpandedReviewKeys((current) => {
9578
+ const next = new Set(current);
9579
+ next.delete(reviewIdentity.key);
9580
+ return next;
9581
+ });
9582
+ }
9543
9583
  bumpItemVersion(reviewIdentity.key);
9544
9584
  }, [bumpItemVersion, onViewedChange]),
9545
9585
  viewed
@@ -9572,13 +9612,13 @@ const defaultConfigTemplate = {
9572
9612
  keymap: {
9573
9613
  "askAgent": "Mod+Alt+Enter",
9574
9614
  "closeSearch": "Escape",
9575
- "commandBar": "Mod+Shift+p",
9615
+ "commandBar": "Mod+k",
9576
9616
  "diffSearch": "Mod+f",
9577
9617
  "discardComment": "Escape",
9578
9618
  "fileFilter": "Mod+p",
9579
9619
  "nextHunk": ["Ctrl+ArrowDown", "j"],
9580
9620
  "nextSearchMatch": "Enter",
9581
- "openFile": "Mod+k",
9621
+ "openFile": "Mod+Shift+o",
9582
9622
  "prevHunk": ["Ctrl+ArrowUp", "k"],
9583
9623
  "prevSearchMatch": "Shift+Enter",
9584
9624
  "shortcutsHelp": "Shift+?",
@@ -9732,7 +9772,7 @@ function ReviewSurface({ commenting, externalUrl, gitIdentity = null, initialMod
9732
9772
  }, [keymap, toggleSidebar]);
9733
9773
  const sidebarMode = Boolean(initialMode && onModeChange) && initialMode ? initialMode : uncontrolledSidebarMode;
9734
9774
  const [treeScrollTarget, setTreeScrollTarget] = useState(null);
9735
- const { bumpItemVersion, collapsed, expandedGenerated, itemVersionByKey, selectedPath, setSelectedPath, toggleCollapsed, toggleViewed, viewed } = useReviewFileState({ initialSelectedPath: snapshot.files[0]?.path ?? null });
9775
+ const { bumpItemVersion, collapsed, expandedReviewKeys, itemVersionByKey, selectedPath, setSelectedPath, toggleCollapsed, toggleViewed, viewed } = useReviewFileState({ initialSelectedPath: snapshot.files[0]?.path ?? null });
9736
9776
  const { resizeSidebar, sidebarWidth } = useResizableSidebar({
9737
9777
  collapseThreshold: 80,
9738
9778
  onCollapse: () => {
@@ -10107,7 +10147,7 @@ function ReviewSurface({ commenting, externalUrl, gitIdentity = null, initialMod
10107
10147
  diffLineHeight,
10108
10148
  diffStyle: snapshot.preferences.diffStyle,
10109
10149
  disableWorkerPool: true,
10110
- expandedGenerated,
10150
+ expandedReviewKeys,
10111
10151
  focusCommentId,
10112
10152
  focusCommentRequest,
10113
10153
  gitIdentity,
package/dist/style.css CHANGED
@@ -5797,6 +5797,10 @@ html[data-codiff-platform="darwin"] .sidebar {
5797
5797
  background: var(--sidebar-vibrancy-tint);
5798
5798
  }
5799
5799
 
5800
+ .app-shell.command-bar-open > :not(.command-bar-overlay) {
5801
+ filter: blur(4px);
5802
+ }
5803
+
5800
5804
  .merge-request-nav-button {
5801
5805
  color: var(--muted);
5802
5806
  cursor: pointer;
@@ -8601,7 +8605,6 @@ diffs-container .review-comment-thread {
8601
8605
  }
8602
8606
 
8603
8607
  .command-bar-overlay, .open-review-source-overlay {
8604
- backdrop-filter: blur(4px);
8605
8608
  background: #ffffff47;
8606
8609
  justify-content: center;
8607
8610
  align-items: flex-start;
@@ -8611,6 +8614,10 @@ diffs-container .review-comment-thread {
8611
8614
  inset: 0;
8612
8615
  }
8613
8616
 
8617
+ .open-review-source-overlay {
8618
+ backdrop-filter: blur(4px);
8619
+ }
8620
+
8614
8621
  .command-bar-overlay {
8615
8622
  z-index: 100;
8616
8623
  }
@@ -8638,6 +8645,7 @@ diffs-container .review-comment-thread {
8638
8645
  flex-direction: column;
8639
8646
  width: min(520px, 90vw);
8640
8647
  max-height: 400px;
8648
+ padding-top: 6px;
8641
8649
  display: flex;
8642
8650
  overflow: hidden;
8643
8651
  }
@@ -8645,15 +8653,16 @@ diffs-container .review-comment-thread {
8645
8653
  .command-bar-input {
8646
8654
  color: var(--text);
8647
8655
  corner-shape: squircle;
8648
- font: 14px/1.35 var(--font-sans);
8656
+ font: 13px/1.35 var(--font-sans);
8649
8657
  background: #7f7f7f1a;
8650
8658
  border: 0;
8651
8659
  border-radius: 16px;
8652
8660
  outline: none;
8653
8661
  width: calc(100% - 20px);
8654
8662
  height: 34px;
8655
- margin: 10px;
8656
- padding: 0 12px;
8663
+ min-height: 34px;
8664
+ margin: 4px 10px 8px;
8665
+ padding: 0 10px;
8657
8666
  }
8658
8667
 
8659
8668
  .command-bar-input:focus {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nkzw/codiff-core",
3
- "version": "1.12.0",
3
+ "version": "1.13.0",
4
4
  "description": "A fast diff viewer.",
5
5
  "license": "MIT",
6
6
  "author": {