Skip to content

Commit b7555b5

Browse files
Refine branch item spacing and header-content merging
Improve visual cohesion by adjusting margins and padding in BranchItem: - Normalize margins on toggle header - Add conditional spacing based on shouldMergeHeader flag - Use negative margin to merge header with content seamlessly - Adjust padding to eliminate gaps when merged This creates a more polished appearance for collapsed/expanded states. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
1 parent b8c867f commit b7555b5

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

cli/src/components/branch-item.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ export const BranchItem = ({
162162
paddingRight: 4,
163163
paddingTop: 0,
164164
paddingBottom: 0,
165+
marginTop: 0,
166+
marginBottom: 0,
165167
}}
166168
onMouseDown={onToggle}
167169
>
@@ -200,7 +202,14 @@ export const BranchItem = ({
200202
</text>
201203
)}
202204
{!isCollapsed && content && (
203-
<box style={{ flexDirection: 'column', gap: 0, marginTop: 1 }}>
205+
<box
206+
style={{
207+
flexDirection: 'column',
208+
gap: 0,
209+
marginTop: shouldMergeHeader ? -1 : 1,
210+
marginBottom: shouldMergeHeader ? 0 : 0,
211+
}}
212+
>
204213
<box
205214
style={{
206215
flexDirection: 'column',
@@ -211,7 +220,7 @@ export const BranchItem = ({
211220
borderColor: cornerColor,
212221
paddingLeft: 1,
213222
paddingRight: 2,
214-
paddingTop: 1,
223+
paddingTop: shouldMergeHeader ? 0 : 1,
215224
paddingBottom: 1,
216225
}}
217226
>
@@ -228,6 +237,7 @@ export const BranchItem = ({
228237
paddingBottom: 0,
229238
marginBottom: 1,
230239
width: '100%',
240+
marginTop: 0,
231241
}}
232242
onMouseDown={onToggle}
233243
>

0 commit comments

Comments
 (0)