Skip to content

Shift titlebar folder icon 7px left - #2030

Merged
lawrencecchen merged 2 commits into
mainfrom
task-titlebar-folder-icon-left
Mar 24, 2026
Merged

lawrencecchen merged 2 commits into
mainfrom
task-titlebar-folder-icon-left

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Mar 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Move the titlebar draggable folder icon 7 points left by adding a negative leading padding in the custom titlebar row.

Testing

  • ./scripts/download-prebuilt-ghosttykit.sh
  • ./scripts/reload.sh --tag task-titlebar-folder-icon-left

Issues

  • Task summary: move titlebar folder icon left by 7px

Summary by cubic

Move the draggable folder icon in the custom titlebar 6px to the left to match the task’s visual alignment. Achieved with negative leading padding (.padding(.leading, -6)), after nudging right by 1px from the initial 7px shift.

Written for commit 7f1e883. Summary will update on new commits.

Summary by CodeRabbit

  • Style
    • Adjusted the folder icon positioning in the app title bar when a directory is focused, shifting it slightly left for improved visual alignment and a more consistent appearance.

@vercel

vercel Bot commented Mar 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cmux Ready Ready Preview, Comment Mar 24, 2026 6:07am

@coderabbitai

coderabbitai Bot commented Mar 24, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 92d7f097-0646-45b0-94bd-91d8f3e505b3

📥 Commits

Reviewing files that changed from the base of the PR and between c544d49 and 7f1e883.

📒 Files selected for processing (1)
  • Sources/ContentView.swift
✅ Files skipped from review due to trivial changes (1)
  • Sources/ContentView.swift

📝 Walkthrough

Walkthrough

When focusedDirectory is non-nil, DraggableFolderIcon in ContentView.customTitlebar receives a .padding(.leading, -6) modifier, shifting the icon horizontally left by 6 points.

Changes

Cohort / File(s) Summary
Layout Adjustment
Sources/ContentView.swift
Added .padding(.leading, -6) to DraggableFolderIcon in customTitlebar to shift the icon's horizontal position when a directory is focused.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A tiny hop, a subtle shove,
Leftward by six, like a gentle glove,
The folder settles, snug and neat,
A rabbit's tweak — precise and sweet.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Shift titlebar folder icon 7px left' directly and clearly summarizes the main change: moving a UI element by a specific distance in a specified direction.
Description check ✅ Passed The description includes a Summary section explaining what changed and why, and a Testing section with specific commands. However, it lacks the Demo Video, Review Trigger checklist, and resolution verification sections from the template.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch task-titlebar-folder-icon-left

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c544d49b79

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/ContentView.swift Outdated
// Draggable folder icon + focused command name
if let directory = focusedDirectory {
DraggableFolderIcon(directory: directory)
.padding(.leading, -7)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve full hit area when shifting folder icon

Applying padding(.leading, -7) to DraggableFolderIcon shifts the rendered image left by drawing it outside its layout bounds, which can shrink the interactive region used for drag and double-click. In this titlebar stack, the leftmost visible pixels can stop hitting DraggableFolderIcon and instead fall through to the underlying drag handle, making folder dragging intermittently fail near the icon’s left edge. Use an offset/container adjustment that keeps the icon’s full 16×16 hit box intact.

Useful? React with 👍 / 👎.

@greptile-apps

greptile-apps Bot commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR makes a minimal, targeted visual adjustment to the custom titlebar by adding .padding(.leading, -7) to the DraggableFolderIcon view, shifting it 7 points to the left within the titlebar HStack.

Key changes:

  • DraggableFolderIcon gains .padding(.leading, -7) so it renders 7 pts closer to the leading edge of the titlebar row.
  • No logic, data, or behavioral changes — purely a layout tweak.

Notes:

  • Because negative leading padding in a SwiftUI HStack reduces the view's allocated layout width on the leading side, the subsequent Text element (and the rest of the row) will also shift slightly left. This appears intentional given the task description, but is worth confirming visually in all sidebar / full-screen combinations since the parent HStack already has three different conditional leading-padding values.
  • No other files are touched; risk is very low.

Confidence Score: 5/5

  • This PR is safe to merge — it is a single-line, purely visual layout adjustment with no behavioural impact.
  • The change is a one-line negative-padding tweak on a display-only icon. It touches no logic, no data flow, and no state management. The risk of regression is negligible, and the developer has provided explicit testing instructions with a matching tag.
  • No files require special attention.

Important Files Changed

Filename Overview
Sources/ContentView.swift Adds .padding(.leading, -7) to the DraggableFolderIcon view inside the titlebar HStack to shift the icon 7 pts to the left; minimal, targeted visual adjustment.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["Titlebar HStack — spacing: 8"] --> B{"isFullScreen and sidebar hidden?"}
    B -- Yes --> C[fullscreenControls]
    C --> D{"focusedDirectory set?"}
    B -- No --> D
    D -- Yes --> E["DraggableFolderIcon\n.padding leading -7\n16×16 pt"]
    E --> F["Text titlebarText\nbold 13pt"]
    D -- No --> F
    F --> G[Spacer]

    style E fill:#ffd700,stroke:#333,stroke-width:2px
Loading

Reviews (1): Last reviewed commit: "Shift titlebar folder icon left" | Re-trigger Greptile

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="Sources/ContentView.swift">

<violation number="1" location="Sources/ContentView.swift:2468">
P3: The new leading padding uses `-6`, which does not match the stated 7px left shift and leaves the icon 1pt short of the requested offset.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread Sources/ContentView.swift
// Draggable folder icon + focused command name
if let directory = focusedDirectory {
DraggableFolderIcon(directory: directory)
.padding(.leading, -6)

@cubic-dev-ai cubic-dev-ai Bot Mar 24, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: The new leading padding uses -6, which does not match the stated 7px left shift and leaves the icon 1pt short of the requested offset.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At Sources/ContentView.swift, line 2468:

<comment>The new leading padding uses `-6`, which does not match the stated 7px left shift and leaves the icon 1pt short of the requested offset.</comment>

<file context>
@@ -2465,7 +2465,7 @@ struct ContentView: View {
                 if let directory = focusedDirectory {
                     DraggableFolderIcon(directory: directory)
-                        .padding(.leading, -7)
+                        .padding(.leading, -6)
                 }
 
</file context>
Suggested change
.padding(.leading, -6)
.padding(.leading, -7)
Fix with Cubic

@lawrencecchen
lawrencecchen merged commit 441118b into main Mar 24, 2026
16 checks passed
bn-l pushed a commit to bn-l/cmux that referenced this pull request Apr 3, 2026
…lder-icon-left

Shift titlebar folder icon 7px left

This branch was successfully deployed

1 active deployment
Preview — 7f1e8835 Deployed Mar 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant