Skip to content

feat: show + button in collapsed group header and expand on click - #51

Merged
bgultekin merged 2 commits into
mainfrom
feat/collapsed-group-plus-button
May 14, 2026
Merged

bgultekin merged 2 commits into
mainfrom
feat/collapsed-group-plus-button

Conversation

@bgultekin

@bgultekin bgultekin commented May 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Replaces the terminal count label with the + (new terminal) button in the collapsed group header
  • Clicking + while the group is collapsed now expands the group before creating the new terminal

Test plan

  • Collapse a group and verify the + button appears instead of the terminal count
  • Click + on a collapsed group and verify it expands and creates a new terminal
  • Verify + still works as expected when the group is already expanded

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • Removed the roadmap section from the documentation.
  • Improvements

    • The new session button now displays in collapsed group views and automatically expands the group before creating a new session.

Review Change Stack

Replace the terminal count label with the new-terminal button when a
group is collapsed. Clicking + while collapsed now expands the group
before creating the new terminal.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented May 14, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

@bgultekin has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 54 minutes and 4 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5cf562bf-f6f8-41f8-a595-7fd6d645525f

📥 Commits

Reviewing files that changed from the base of the PR and between 1a4ef68 and 5a93e0f.

📒 Files selected for processing (1)
  • macos/Sources/Ocak/Views/SessionListView.swift
📝 Walkthrough

Walkthrough

The pull request removes the "Roadmap" section from README.md and updates the macOS SessionListView to position the new-session button in the collapsed group header's trailing area, with logic to expand the group before creating a new session.

Changes

Documentation and UI Updates

Layer / File(s) Summary
README roadmap section removal
README.md
"Roadmap" section describing Windows client, Linux support, and additional agents is removed; "Acknowledgements" now directly follows the module breakdown reference.
Collapsed session group header button UI and behavior
macos/Sources/Ocak/Views/SessionListView.swift
Collapsed-group header trailing area now displays newSessionButton instead of collapsedTrailing (while preserving optional VS Code button). Button behavior updated to expand the group if currently collapsed before invoking onNewSessionInGroup().

Possibly related PRs

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 A roadmap fades like morning dew,
As buttons find their home anew,
The header blooms with swift design,
Where new sessions now align—
One click expands, creates with cheer! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: showing a + button in collapsed group headers that expands the group on click, which aligns with the primary code changes in SessionListView.swift.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/collapsed-group-plus-button

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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.

@bgultekin
bgultekin marked this pull request as ready for review May 14, 2026 10:27

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (3)
macos/Sources/Ocak/Views/SessionListView.swift (3)

705-710: ⚡ Quick win

Remove unused collapsedTrailing property.

The collapsedTrailing computed property is no longer used after replacing the terminal count label with the + button in the collapsed group header. This is dead code that should be removed.

🧹 Proposed fix to remove dead code
-    private var collapsedTrailing: some View {
-        let count = sessions.count
-        return Text("\(count) terminal\(count == 1 ? "" : "s")")
-            .font(.system(size: 11))
-            .foregroundColor(OcakTheme.sectionLabel.opacity(0.7))
-    }
-
     private var groupTitleColor: Color {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@macos/Sources/Ocak/Views/SessionListView.swift` around lines 705 - 710,
Remove the dead computed property collapsedTrailing from SessionListView: delete
the private var collapsedTrailing: some View { ... } block (the Text(...)
terminal count view) since the collapsed group header now uses the `+` button
and there are no remaining references; ensure no other code refers to
collapsedTrailing and run a build to confirm no unused-symbol warnings remain.

682-687: ⚡ Quick win

Consider wrapping the group expansion in withAnimation.

The group expansion at line 684 is not wrapped in withAnimation, but other similar expand operations in this file use withAnimation(.easeInOut(duration: 0.2)) (see lines 611, 618, 634, 640). This inconsistency may cause the expansion to appear less smooth when clicking the + button on a collapsed group.

🎨 Proposed fix to add animation wrapper
 private var newSessionButton: some View {
     Button(action: {
         if group.isCollapsed {
-            store.setGroupCollapsed(group.id, collapsed: false)
+            withAnimation(.easeInOut(duration: 0.2)) {
+                store.setGroupCollapsed(group.id, collapsed: false)
+            }
         }
         onNewSessionInGroup()
     }) {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@macos/Sources/Ocak/Views/SessionListView.swift` around lines 682 - 687, The
group expansion triggered by the Button action should be wrapped in an animation
to match other expand/collapse behavior: replace the direct call to
store.setGroupCollapsed(group.id, collapsed: false) inside the Button action
with a withAnimation(.easeInOut(duration: 0.2)) {
store.setGroupCollapsed(group.id, collapsed: false) } (keep the
group.isCollapsed check) and then call onNewSessionInGroup() as before (either
after the animated block or inside it if you want the session creation to be
part of the animated sequence).

505-515: 💤 Low value

Consider factoring out duplicated trailing button logic.

The trailing button logic (VS Code button + new session button) is nearly identical in both the collapsed (lines 506-509) and expanded (lines 511-515) branches. The only difference is the outer condition. You could extract this into a computed property or ViewBuilder to reduce duplication.

♻️ Optional refactor to reduce duplication
+    `@ViewBuilder`
+    private var trailingButtons: some View {
+        if group.openInVSCode, let dir = group.directory, !dir.isEmpty {
+            vsCodeButton(directory: dir)
+        }
+        newSessionButton
+    }
+
     private var headerRow: some View {
         HStack(spacing: 6) {
             // ... existing code ...
             
             Spacer()
             
             if group.isCollapsed && !isEditingSettings {
-                if group.openInVSCode, let dir = group.directory, !dir.isEmpty {
-                    vsCodeButton(directory: dir)
-                }
-                newSessionButton
+                trailingButtons
             } else if !isEditingSettings {
-                if group.openInVSCode, let dir = group.directory, !dir.isEmpty {
-                    vsCodeButton(directory: dir)
-                }
-                newSessionButton
+                trailingButtons
             }
         }
     }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@macos/Sources/Ocak/Views/SessionListView.swift` around lines 505 - 515, The
duplicated trailing button block appearing in both the collapsed and expanded
branches should be extracted into a single reusable view: create a private
computed property or ViewBuilder function (e.g. trailingButtons or
trailingButtonsView) that returns the same combination of
vsCodeButton(directory:) when group.openInVSCode and group.directory are valid,
followed by newSessionButton; then replace the duplicated blocks in the branches
with a call to that new trailingButtons view and keep the outer conditions
(group.isCollapsed / !isEditingSettings) unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@macos/Sources/Ocak/Views/SessionListView.swift`:
- Around line 705-710: Remove the dead computed property collapsedTrailing from
SessionListView: delete the private var collapsedTrailing: some View { ... }
block (the Text(...) terminal count view) since the collapsed group header now
uses the `+` button and there are no remaining references; ensure no other code
refers to collapsedTrailing and run a build to confirm no unused-symbol warnings
remain.
- Around line 682-687: The group expansion triggered by the Button action should
be wrapped in an animation to match other expand/collapse behavior: replace the
direct call to store.setGroupCollapsed(group.id, collapsed: false) inside the
Button action with a withAnimation(.easeInOut(duration: 0.2)) {
store.setGroupCollapsed(group.id, collapsed: false) } (keep the
group.isCollapsed check) and then call onNewSessionInGroup() as before (either
after the animated block or inside it if you want the session creation to be
part of the animated sequence).
- Around line 505-515: The duplicated trailing button block appearing in both
the collapsed and expanded branches should be extracted into a single reusable
view: create a private computed property or ViewBuilder function (e.g.
trailingButtons or trailingButtonsView) that returns the same combination of
vsCodeButton(directory:) when group.openInVSCode and group.directory are valid,
followed by newSessionButton; then replace the duplicated blocks in the branches
with a call to that new trailingButtons view and keep the outer conditions
(group.isCollapsed / !isEditingSettings) unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2e596eab-8f0e-4169-aa3f-f61416423f44

📥 Commits

Reviewing files that changed from the base of the PR and between 88a234e and 1a4ef68.

📒 Files selected for processing (2)
  • README.md
  • macos/Sources/Ocak/Views/SessionListView.swift
💤 Files with no reviewable changes (1)
  • README.md

Extract trailingButtons view to eliminate duplicated vsCodeButton +
newSessionButton blocks. Wrap setGroupCollapsed in withAnimation to
match existing expand/collapse behavior. Remove unused collapsedTrailing
computed property.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bgultekin
bgultekin merged commit 24be8c4 into main May 14, 2026
2 checks passed
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