Repository navigation
feat: show + button in collapsed group header and expand on click - #51
Conversation
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>
|
Warning Rate limit exceeded
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 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe 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. ChangesDocumentation and UI Updates
Possibly related PRs
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the 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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (3)
macos/Sources/Ocak/Views/SessionListView.swift (3)
705-710: ⚡ Quick winRemove unused
collapsedTrailingproperty.The
collapsedTrailingcomputed 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 winConsider 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 usewithAnimation(.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 valueConsider 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
📒 Files selected for processing (2)
README.mdmacos/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>
Summary
+(new terminal) button in the collapsed group header+while the group is collapsed now expands the group before creating the new terminalTest plan
+button appears instead of the terminal count+on a collapsed group and verify it expands and creates a new terminal+still works as expected when the group is already expanded🤖 Generated with Claude Code
Summary by CodeRabbit
Documentation
Improvements