@@ -33,7 +33,6 @@ import { FilesPane } from "./components/panes/FilesPane";
3333import { PaneDivider } from "./components/panes/PaneDivider" ;
3434import { useHunkSessionBridge } from "./hooks/useHunkSessionBridge" ;
3535import { useMenuController } from "./hooks/useMenuController" ;
36- import { getSelectedAnnotations } from "./lib/agentAnnotations" ;
3736import { buildAppMenus } from "./lib/appMenus" ;
3837import { buildFileListEntry } from "./lib/files" ;
3938import { buildHunkCursors , findNextHunkCursor } from "./lib/hunks" ;
@@ -94,7 +93,6 @@ function AppShell({
9493 const [ filesPaneWidth , setFilesPaneWidth ] = useState ( 34 ) ;
9594 const [ resizeDragOriginX , setResizeDragOriginX ] = useState < number | null > ( null ) ;
9695 const [ resizeStartWidth , setResizeStartWidth ] = useState < number | null > ( null ) ;
97- const [ dismissedAgentNoteIds , setDismissedAgentNoteIds ] = useState < string [ ] > ( [ ] ) ;
9896 const [ selectedFileId , setSelectedFileId ] = useState ( bootstrap . changeset . files [ 0 ] ?. id ?? "" ) ;
9997 const [ selectedHunkIndex , setSelectedHunkIndex ] = useState ( 0 ) ;
10098 const deferredFilter = useDeferredValue ( filter ) ;
@@ -109,7 +107,6 @@ function AppShell({
109107 } , [ ] ) ;
110108
111109 const openAgentNotes = useCallback ( ( ) => {
112- setDismissedAgentNoteIds ( [ ] ) ;
113110 setShowAgentNotes ( true ) ;
114111 } , [ ] ) ;
115112
@@ -176,8 +173,6 @@ function AppShell({
176173 ( responsiveLayout . showFilesPane || ( forceSidebarOpen && canForceShowFilesPane ) ) ;
177174 const centerWidth = bodyWidth ;
178175 const resolvedLayout = responsiveLayout . layout ;
179- const currentHunk = selectedFile ?. metadata . hunks [ selectedHunkIndex ] ;
180- const activeAnnotations = getSelectedAnnotations ( selectedFile , currentHunk ) ;
181176 const availableCenterWidth = showFilesPane
182177 ? Math . max ( 0 , centerWidth - DIVIDER_WIDTH )
183178 : Math . max ( 0 , centerWidth ) ;
@@ -247,11 +242,6 @@ function AppShell({
247242 filesScrollRef . current ?. scrollChildIntoView ( fileRowId ( selectedFile . id ) ) ;
248243 } , [ selectedFile ] ) ;
249244
250- useEffect ( ( ) => {
251- // Dismissed notes are hunk-local, so reset them when the review focus moves.
252- setDismissedAgentNoteIds ( [ ] ) ;
253- } , [ selectedFile ?. id , selectedHunkIndex ] ) ;
254-
255245 /** Move the review focus across hunks in stream order. */
256246 const moveHunk = ( delta : number ) => {
257247 const nextCursor = findNextHunkCursor ( hunkCursors , selectedFile ?. id , selectedHunkIndex , delta ) ;
@@ -287,20 +277,9 @@ function AppShell({
287277 jumpToFile ( nextFile . id ) ;
288278 } ;
289279
290- /** Toggle the note layer while keeping dismissals scoped to the visible hunk . */
280+ /** Toggle the global agent note layer on or off . */
291281 const toggleAgentNotes = ( ) => {
292- if ( showAgentNotes ) {
293- setShowAgentNotes ( false ) ;
294- setDismissedAgentNoteIds ( [ ] ) ;
295- return ;
296- }
297-
298- openAgentNotes ( ) ;
299- } ;
300-
301- /** Hide one visible note card until the selection changes. */
302- const dismissAgentNote = ( noteId : string ) => {
303- setDismissedAgentNoteIds ( ( current ) => [ ...current , noteId ] ) ;
282+ setShowAgentNotes ( ( current ) => ! current ) ;
304283 } ;
305284
306285 /** Toggle line-number gutters without changing the diff content itself. */
@@ -337,10 +316,9 @@ function AppShell({
337316 setShowHunkHeaders ( ( current ) => ! current ) ;
338317 } ;
339318
340- /** Jump to the annotated hunk before opening the note layer . */
319+ /** Jump to an annotated hunk without changing the global note visibility toggle . */
341320 const openAgentNotesAtHunk = ( fileId : string , hunkIndex : number ) => {
342321 jumpToFile ( fileId , hunkIndex ) ;
343- openAgentNotes ( ) ;
344322 } ;
345323
346324 /** Leave the app through the shell-owned shutdown path. */
@@ -784,9 +762,7 @@ function AppShell({
784762 ) : null }
785763
786764 < DiffPane
787- activeAnnotations = { activeAnnotations }
788765 diffContentWidth = { diffContentWidth }
789- dismissedAgentNoteIds = { dismissedAgentNoteIds }
790766 files = { filteredFiles }
791767 pagerMode = { pagerMode }
792768 headerLabelWidth = { diffHeaderLabelWidth }
@@ -802,7 +778,6 @@ function AppShell({
802778 wrapLines = { wrapLines }
803779 theme = { activeTheme }
804780 width = { diffPaneWidth }
805- onDismissAgentNote = { dismissAgentNote }
806781 onOpenAgentNotesAtHunk = { openAgentNotesAtHunk }
807782 onSelectFile = { jumpToFile }
808783 />
0 commit comments