@nkzw/codiff-core 1.8.1 → 1.9.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.
@@ -25,8 +25,9 @@ export type PlanReviewCommenting = {
25
25
  onUpdateMessage: (messageId: string, body: string) => Promise<void>;
26
26
  };
27
27
  export declare const getSharedPlanDownloadContent: (snapshot: SharedPlanSnapshot) => string;
28
- export declare function PlanReviewSurface({ commenting, signInLabel, snapshot, }: {
28
+ export declare function PlanReviewSurface({ commenting, onDeleteShare, signInLabel, snapshot, }: {
29
29
  commenting?: PlanReviewCommenting;
30
+ onDeleteShare?: () => Promise<void> | void;
30
31
  signInLabel?: string;
31
32
  snapshot: SharedPlanSnapshot;
32
33
  }): import("react").JSX.Element;
@@ -29,6 +29,7 @@ export type ReviewSurfaceProps = {
29
29
  walkthroughError?: string | null;
30
30
  walkthroughStatus: ReviewWalkthroughStatus;
31
31
  };
32
+ onDeleteShare?: () => Promise<void> | void;
32
33
  onModeChange?: (mode: ReviewMode) => void;
33
34
  providerLabel?: string;
34
35
  settingsBar?: ReactNode;
@@ -37,4 +38,4 @@ export type ReviewSurfaceProps = {
37
38
  sourceDescriptionFooterAside?: ReactNode;
38
39
  title?: string;
39
40
  };
40
- export declare function ReviewSurface({ commenting, externalUrl, gitIdentity, initialMode, interactive, onModeChange, providerLabel, settingsBar, signInLabel, snapshot, sourceDescriptionFooterAside, title, }: ReviewSurfaceProps): import("react").JSX.Element;
41
+ export declare function ReviewSurface({ commenting, externalUrl, gitIdentity, initialMode, interactive, onDeleteShare, onModeChange, providerLabel, settingsBar, signInLabel, snapshot, sourceDescriptionFooterAside, title, }: ReviewSurfaceProps): import("react").JSX.Element;
@@ -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, isPullRequest, isReadOnly, itemVersionByKey, keymap, loadingSectionIds, onActiveBlockChange, onAskCodex, onCommentDraftChange, onCreateComment, onDeleteComment, onLoadImageContent, onLoadSection, onLoadSectionContents, onOpenFile, onRefreshMarkdown, onResolveThread, onSaveCommentEdit, onSelectPathFromScroll, onSubmitComment, onToggleCollapsed, onToggleViewed, onUpdateComment, onUpdateSourceDescription, onUpdateSourceTitle, onUploadSourceDescriptionAsset, reviewIdentityByPath, scrollTarget, searchQuery, selectedPath, showSourceDescription, showWhitespace, source, sourceDescriptionActions, sourceDescriptionFooter, theme, viewed, walkthroughNotes, wordWrap, }: {
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, onLoadImageContent, onLoadSection, onLoadSectionContents, 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;
@@ -61,7 +61,6 @@ export declare function ReviewCodeView({ activeSearchMatch, agentId, agentLabel,
61
61
  gitIdentity: GitIdentity | null;
62
62
  hunkNavigation: HunkNavigationRequest | null;
63
63
  initialMarkdownPreviewSectionIds?: ReadonlySet<string>;
64
- isPullRequest: boolean;
65
64
  isReadOnly?: boolean;
66
65
  itemVersionByKey: Readonly<Record<string, number>>;
67
66
  keymap: CodiffKeymap;
@@ -95,6 +94,7 @@ export declare function ReviewCodeView({ activeSearchMatch, agentId, agentLabel,
95
94
  source: ReviewSource;
96
95
  sourceDescriptionActions?: ReactNode;
97
96
  sourceDescriptionFooter?: ReactNode;
97
+ supportsReviewCommentActions: boolean;
98
98
  theme?: CodiffPreferences['theme'];
99
99
  viewed: Record<string, string>;
100
100
  walkthroughNotes: ReadonlyMap<string, WalkthroughNote>;
@@ -2,7 +2,7 @@ import type { CodiffKeymap } from '../../config/types.ts';
2
2
  import type { DiffLineCount, PullRequestSource, SidebarMode, WalkthroughError } from '../../lib/app-types.ts';
3
3
  import type { ChangedFile, HistoryEntry, NarrativeWalkthrough, ReviewSource } from '../../types.ts';
4
4
  import type { NarrativeNavigation } from './walkthrough/useNarrativeNavigation.ts';
5
- export declare function Sidebar({ branchSource, commitFiles, commitViewOpen, currentSource, files, historyEntries, historyHasMore, historyLoading, keymap, mode, narrativeNavigation, narrativeWalkthrough, onActivatePath, onLoadMoreHistory, onModeChange, onSearchQueryChange, onSelectSource, onShareWalkthrough, onToggleCommitView, pullRequestSource, reloadDeltaPaths, searchQuery, selectedPath, shareWalkthroughDisabled, showWhitespace, viewed, walkthroughError, walkthroughLoading, walkthroughOutdatedPaths, walkthroughProgress, walkthroughUnread, }: {
5
+ export declare function Sidebar({ branchSource, commitFiles, commitViewOpen, currentSource, files, historyEntries, historyHasMore, historyLoading, keymap, mode, narrativeNavigation, narrativeWalkthrough, onActivatePath, onLoadMoreHistory, onModeChange, onSearchQueryChange, onSelectSource, onShareWalkthrough, onToggleCommitView, pullRequestSource, reloadDeltaPaths, searchQuery, selectedPath, shareWalkthroughDisabled, showWhitespace, viewed, walkthroughError, walkthroughLoading, walkthroughProgress, walkthroughUnread, }: {
6
6
  branchSource: Extract<ReviewSource, {
7
7
  type: 'branch-diff';
8
8
  }> | null;
@@ -33,7 +33,6 @@ export declare function Sidebar({ branchSource, commitFiles, commitViewOpen, cur
33
33
  viewed: Record<string, string>;
34
34
  walkthroughError: WalkthroughError | null;
35
35
  walkthroughLoading: boolean;
36
- walkthroughOutdatedPaths: ReadonlySet<string>;
37
36
  walkthroughProgress: {
38
37
  phase: import('../../types.ts').WalkthroughProgressPhase | null;
39
38
  responseLabelIndex: number;
@@ -0,0 +1 @@
1
+ export declare function Thinking(): import("react").JSX.Element;
@@ -1,8 +1,7 @@
1
1
  import type { ChangedFile, NarrativeWalkthrough } from '../../../types.ts';
2
2
  import type { NarrativeNavigation } from './useNarrativeNavigation.ts';
3
- export declare function NarrativeSidebar({ allowCommit, changedPaths, files, navigation, onShareWalkthrough, shareWalkthroughDisabled, showWhitespace, walkthrough, }: {
3
+ export declare function NarrativeSidebar({ allowCommit, files, navigation, onShareWalkthrough, shareWalkthroughDisabled, showWhitespace, walkthrough, }: {
4
4
  allowCommit?: boolean;
5
- changedPaths?: ReadonlySet<string>;
6
5
  files: ReadonlyArray<ChangedFile>;
7
6
  navigation: NarrativeNavigation;
8
7
  onShareWalkthrough?: () => void;
@@ -24,18 +24,15 @@ export declare const getWalkthroughBlockScrollTarget: ({ activeBlockId, firstSup
24
24
  export type RenderWalkthroughDiffBlocks = (blocks: ReadonlyArray<ReviewDiffBlock>, scrollTarget: WalkthroughBlockScrollTarget | null, onActiveBlockChange: (blockId: string) => void) => ReactNode;
25
25
  type WalkthroughNavigationKeyEvent = Pick<KeyboardEvent, 'altKey' | 'ctrlKey' | 'key' | 'metaKey' | 'shiftKey'>;
26
26
  export declare const getWalkthroughNavigationKeyDirection: (event: WalkthroughNavigationKeyEvent) => -1 | 0 | 1;
27
- export declare function NarrativeWalkthroughView({ allowCommit, changedPaths, files, navigation, onActiveReviewTargetChange, onCommit, onCommitOutput, onRegenerateWalkthrough, onShareWalkthrough, onUpdateCommitMessage, regenerateDisabled, renderDiffBlocks, shareWalkthroughDisabled, showWhitespace, walkthrough, }: {
27
+ export declare function NarrativeWalkthroughView({ allowCommit, files, navigation, onActiveReviewTargetChange, onCommit, onCommitOutput, onShareWalkthrough, onUpdateCommitMessage, renderDiffBlocks, shareWalkthroughDisabled, showWhitespace, walkthrough, }: {
28
28
  allowCommit?: boolean;
29
- changedPaths?: ReadonlySet<string>;
30
29
  files: ReadonlyArray<ChangedFile>;
31
30
  navigation: NarrativeNavigation;
32
31
  onActiveReviewTargetChange: (target: WalkthroughReviewTarget | null) => void;
33
32
  onCommit: CommitHandler;
34
33
  onCommitOutput?: CommitOutputSubscriber;
35
- onRegenerateWalkthrough?: () => void;
36
34
  onShareWalkthrough?: () => void;
37
35
  onUpdateCommitMessage: CommitMessageHandler;
38
- regenerateDisabled?: boolean;
39
36
  renderDiffBlocks: RenderWalkthroughDiffBlocks;
40
37
  shareWalkthroughDisabled?: boolean;
41
38
  showWhitespace: boolean;
@@ -49,7 +49,7 @@ export declare function useAppWalkthrough({ preferencesRef, state, stateGenerati
49
49
  narrativeWalkthroughRef: RefObject<NarrativeWalkthrough | null>;
50
50
  openCommitView: () => void;
51
51
  plainCommitModel: import("../../lib/narrative-walkthrough.ts").CommitModel;
52
- regenerateWalkthrough: () => void;
52
+ refreshWalkthroughForState: (nextState: RepositoryState, previousWalkthrough?: NarrativeWalkthrough | null) => void;
53
53
  setMainMode: import("react").Dispatch<import("react").SetStateAction<MainMode>>;
54
54
  setNarrativeWalkthrough: import("react").Dispatch<import("react").SetStateAction<NarrativeWalkthrough | null>>;
55
55
  setShareWalkthroughEnabled: import("react").Dispatch<import("react").SetStateAction<boolean>>;
@@ -61,7 +61,6 @@ export declare function useAppWalkthrough({ preferencesRef, state, stateGenerati
61
61
  } | null>>;
62
62
  setWalkthroughFileError: import("react").Dispatch<import("react").SetStateAction<WalkthroughFileError | null>>;
63
63
  setWalkthroughLoading: import("react").Dispatch<import("react").SetStateAction<boolean>>;
64
- setWalkthroughOutdatedPaths: import("react").Dispatch<import("react").SetStateAction<ReadonlySet<string>>>;
65
64
  setWalkthroughUnread: import("react").Dispatch<import("react").SetStateAction<boolean>>;
66
65
  showNarrativeWalkthrough: boolean;
67
66
  showPlainCommitView: boolean;
@@ -83,8 +82,6 @@ export declare function useAppWalkthrough({ preferencesRef, state, stateGenerati
83
82
  } | null>;
84
83
  walkthroughFileError: WalkthroughFileError | null;
85
84
  walkthroughLoading: boolean;
86
- walkthroughOutdatedPaths: ReadonlySet<string>;
87
- walkthroughOutdatedPathsRef: RefObject<ReadonlySet<string>>;
88
85
  walkthroughProgress: {
89
86
  phase: WalkthroughProgressEvent['phase'] | null;
90
87
  responseLabelIndex: number;
@@ -112,7 +112,11 @@ export type SourceSession = {
112
112
  selectedPath: string | null;
113
113
  viewed: Record<string, string>;
114
114
  walkthroughError: WalkthroughError | null;
115
- walkthroughOutdatedPaths: ReadonlySet<string>;
115
+ walkthroughFiles: ReadonlyArray<{
116
+ fingerprint: string;
117
+ path: string;
118
+ status: ChangedFile['status'];
119
+ }>;
116
120
  };
117
121
  export type RepositoryLoadError = {
118
122
  kind: 'generic' | 'not-a-repository';
@@ -16,7 +16,9 @@ type ReloadSelection = {
16
16
  export declare const consumeReloadSelection: () => ReloadSelection | null;
17
17
  export declare const getReloadSelectionPath: (selection: ReloadSelection | null, state: RepositoryState) => string | null;
18
18
  export declare const getChangedPaths: (previousFiles: ReadonlyArray<ReloadSelectionFile>, nextFiles: ReadonlyArray<ReloadSelectionFile>) => ReadonlySet<string>;
19
+ export declare const haveChangedFiles: (previousFiles: ReadonlyArray<ReloadSelectionFile>, nextFiles: ReadonlyArray<ReloadSelectionFile>) => boolean;
19
20
  export declare const getReloadDeltaPaths: (selection: ReloadSelection | null, state: RepositoryState) => ReadonlySet<string>;
21
+ export declare const haveReloadedFilesChanged: (selection: ReloadSelection | null, state: RepositoryState) => boolean;
20
22
  export declare const getReloadHistorySource: (selection: ReloadSelection | null, state: RepositoryState) => ReviewSource | null;
21
23
  export declare const getReloadMainMode: (selection: ReloadSelection | null, state: RepositoryState) => ReloadMainMode | null;
22
24
  export declare const writeReloadSelection: (state: RepositoryState | null, selectedPath: string | null, historySource?: ReviewSource | null, mainMode?: ReloadMainMode) => void;
@@ -1,4 +1,4 @@
1
- import type { ChangedFile, PullRequestReviewComment, RepositoryState } from '../types.ts';
1
+ import type { ChangedFile, PullRequestExistingReviewComment, PullRequestReviewComment, RepositoryState } from '../types.ts';
2
2
  import type { CodeViewInstance, ReviewComment } from './app-types.ts';
3
3
  export declare const isInteractiveReviewEvent: (event: PointerEvent) => boolean;
4
4
  export declare const hasActiveTextSelection: () => boolean;
@@ -18,7 +18,11 @@ export declare const getReviewCommentRangeProps: (comment: Pick<ReviewComment, '
18
18
  startLineNumber: number;
19
19
  startSide?: "additions" | "deletions" | undefined;
20
20
  };
21
- export declare const toPullRequestReviewComment: (comment: ReviewComment) => PullRequestReviewComment;
21
+ export declare const toPullRequestReviewComment: (comment: ReviewComment, { includeSectionId }?: {
22
+ includeSectionId?: boolean;
23
+ }) => PullRequestReviewComment;
24
+ export declare const toSubmittedReviewComment: (comment: PullRequestExistingReviewComment, draft: ReviewComment) => ReviewComment;
25
+ export declare const mergeReviewComments: (snapshotComments: ReadonlyArray<ReviewComment>, localComments: ReadonlyArray<ReviewComment>) => ReadonlyArray<ReviewComment>;
22
26
  export declare const getPendingPullRequestReviewComments: (comments: ReadonlyArray<ReviewComment>, activeDraft?: Pick<ReviewComment, 'body' | 'id'> | null) => ReviewComment[];
23
27
  export declare const findReusableReviewCommentDraft: (comments: ReadonlyArray<ReviewComment>, activeDraft?: Pick<ReviewComment, 'body' | 'id'> | null) => ReviewComment | undefined;
24
28
  export declare const getCommentKey: (comment: Pick<ReviewComment, 'anchor' | 'lineNumber' | 'sectionId' | 'side' | 'startLineNumber' | 'startSide'>) => string;
package/dist/react.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export { Button, buttonVariants, type ButtonProps } from './app/components/Button.tsx';
2
+ export { Thinking } from './app/components/Thinking.tsx';
2
3
  export { getPlanCommentAffordancePosition, getPlanCommentColorIndex, getPlanCommentIdentityColorIndex, getSharedPlanDownloadContent, PlanReviewSurface, type PlanReviewCommenting, } from './SharedPlanApp.tsx';
3
4
  export { ReadOnlyGeneralCommentCard, ReviewSurface, type ReviewCommenting, type ReviewMode, type ReviewSurfaceProps, type ReviewWalkthroughStatus, } from './SharedWalkthroughApp.tsx';