diff --git a/src/browser/hooks/useReviewState.ts b/src/browser/hooks/useReviewState.ts index 91f82faeda..8162970376 100644 --- a/src/browser/hooks/useReviewState.ts +++ b/src/browser/hooks/useReviewState.ts @@ -6,19 +6,13 @@ import { useCallback, useMemo, useEffect, useState } from "react"; import { usePersistedState } from "./usePersistedState"; import type { ReviewState, HunkReadState } from "@/common/types/review"; +import { getReviewStateKey } from "@/common/constants/storage"; /** * Maximum number of read states to keep per workspace (LRU eviction) */ const MAX_READ_STATES = 1024; -/** - * Get the localStorage key for review state - */ -function getReviewStateKey(workspaceId: string): string { - return `review-state:${workspaceId}`; -} - /** * Evict oldest read states if count exceeds max * Keeps the newest MAX_READ_STATES entries diff --git a/src/common/constants/storage.ts b/src/common/constants/storage.ts index d2f995af26..426aa880ed 100644 --- a/src/common/constants/storage.ts +++ b/src/common/constants/storage.ts @@ -194,6 +194,15 @@ export const DEFAULT_TUTORIAL_STATE: TutorialState = { completed: {}, }; +/** + * Get the localStorage key for review (hunk read) state per workspace + * Stores which hunks have been marked as read during code review + * Format: "review-state:{workspaceId}" + */ +export function getReviewStateKey(workspaceId: string): string { + return `review-state:${workspaceId}`; +} + /** * Get the localStorage key for hunk expand/collapse state in Review tab * Stores user's manual expand/collapse preferences per hunk @@ -278,6 +287,7 @@ const PERSISTENT_WORKSPACE_KEY_FUNCTIONS: Array<(workspaceId: string) => string> getThinkingLevelKey, getAutoRetryKey, getRetryStateKey, + getReviewStateKey, getReviewExpandStateKey, getFileTreeExpandStateKey, getReviewSearchStateKey,