diff --git a/staged/src/lib/Sidebar.svelte b/staged/src/lib/Sidebar.svelte index 0d23df0..bf052c6 100644 --- a/staged/src/lib/Sidebar.svelte +++ b/staged/src/lib/Sidebar.svelte @@ -159,6 +159,7 @@ let collapsedDirs = $state(new Set()); let collapsedSearchResults = $state(new Set()); + let collapsedSections = $state(new Set()); let treeView = $state(false); let showCommitModal = $state(false); let copiedFeedback = $state(false); @@ -473,6 +474,20 @@ return collapsedDirs.has(path); } + function toggleSection(sectionName: string) { + const newSet = new Set(collapsedSections); + if (newSet.has(sectionName)) { + newSet.delete(sectionName); + } else { + newSet.add(sectionName); + } + collapsedSections = newSet; + } + + function isSectionCollapsed(sectionName: string): boolean { + return collapsedSections.has(sectionName); + } + async function toggleSearchResults(path: string) { const newSet = new Set(collapsedSearchResults); if (newSet.has(path)) { @@ -1174,6 +1189,17 @@ {#if needsReview.length > 0}
+
-
    - {#if treeView} - {@render treeNodes(needsReviewTree, 0, false)} - {:else} - {@render flatFileList(needsReview, false)} - {/if} -
+ {#if !isSectionCollapsed('changed')} +
    + {#if treeView} + {@render treeNodes(needsReviewTree, 0, false)} + {:else} + {@render flatFileList(needsReview, false)} + {/if} +
+ {/if} {/if} {#if reviewed.length > 0}
+ +
REFERENCE {#if referenceFilesState.files.length > 0} @@ -1284,7 +1335,7 @@
- {#if referenceFilesState.files.length > 0} + {#if referenceFilesState.files.length > 0 && !isSectionCollapsed('reference')}
    {#each referenceFilesState.files as refFile (refFile.path)}
  • @@ -1321,7 +1372,19 @@
    -
    +
    + +
    COMMENTS {#if commentsState.comments.length > 0} @@ -1348,7 +1411,7 @@ {/if}
    - {#if commentsState.comments.length > 0} + {#if commentsState.comments.length > 0 && !isSectionCollapsed('comments')}
      {@render commentList()}
    @@ -1357,7 +1420,19 @@ {#if agentState}
    -
    +
    + +
    AGENT
    @@ -1404,7 +1479,7 @@
    - {#if agentState} + {#if agentState && !isSectionCollapsed('agent')} {/if} {/if} @@ -1645,6 +1720,31 @@ color: var(--text-muted); } + .section-collapse-btn { + display: flex; + align-items: center; + justify-content: center; + padding: 2px; + background: none; + border: none; + border-radius: 3px; + color: var(--text-muted); + cursor: pointer; + transition: + background-color 0.1s, + color 0.1s; + } + + .section-collapse-btn:hover { + background-color: var(--bg-hover); + color: var(--text-primary); + } + + .section-collapse-btn:focus-visible { + outline: 2px solid var(--text-accent); + outline-offset: -2px; + } + .view-toggle { display: flex; align-items: center; diff --git a/staged/src/lib/features/agent/AgentPanel.svelte b/staged/src/lib/features/agent/AgentPanel.svelte index b4fa9ba..e52e130 100644 --- a/staged/src/lib/features/agent/AgentPanel.svelte +++ b/staged/src/lib/features/agent/AgentPanel.svelte @@ -805,7 +805,7 @@ display: flex; flex-direction: column; flex: 1; - min-height: 0; + min-height: 250px; padding: 0 12px; } @@ -815,9 +815,11 @@ } .agent-bottom { - flex-shrink: 0; + flex: 1; + display: flex; + flex-direction: column; + min-height: 0; padding: 8px 0 0; - margin-top: auto; } .agent-input-wrapper { @@ -1131,6 +1133,10 @@ border: 1px solid var(--border-subtle); border-radius: 6px; overflow: hidden; + flex: 1; + display: flex; + flex-direction: column; + min-height: 0; } .agent-response-header { @@ -1227,8 +1233,9 @@ font-size: var(--size-sm); color: var(--text-primary); word-break: break-word; - max-height: 200px; + flex: 1; overflow-y: auto; + min-height: 0; } /* Markdown content styles */