Repository navigation
iOS: title/subtitle lower layout priority than trailing toolbar controls #7297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 10 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
0984b06
iOS: give toolbar title/subtitle lower layout priority than trailing …
azooz2003-bit be334ca
iOS: fill principal toolbar width instead of framing to full screen w…
azooz2003-bit 4c6f83e
iOS: extract WorkspaceDetailView toolbar into its own extension file
azooz2003-bit e0b358a
Merge remote-tracking branch 'origin/main' into feat-toolbar-title-la…
azooz2003-bit 0d10bb0
Bump WorkspaceDetailView budget to 644 after merging origin/main
azooz2003-bit 3dbaa75
Merge remote-tracking branch 'origin/main' into feat-toolbar-title-la…
azooz2003-bit afcbaec
iOS UITests: assert workspace toolbar islands pin to the nav bar edges
azooz2003-bit 06ec801
iOS: report the detail width as the principal toolbar item's ideal width
azooz2003-bit e4f6cf9
iOS: keep toolbar width state read-only outside detail view
azooz2003-bit eeae7f4
Merge remote-tracking branch 'origin/main' into feat-toolbar-title-la…
azooz2003-bit abea9a8
iOS: fit unread badge back toolbar island
azooz2003-bit d28c310
iOS: type erase conditional back toolbar island
azooz2003-bit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 0 additions & 31 deletions
31
...ages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/MobileLeadingToolbarTitleWidth.swift
This file was deleted.
Oops, something went wrong.
111 changes: 111 additions & 0 deletions
111
Packages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/WorkspaceDetailView+Toolbar.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| #if os(iOS) | ||
| import CmuxAgentChat | ||
| import CmuxAgentChatUI | ||
| import CmuxMobileBrowser | ||
| import CmuxMobileSupport | ||
| import SwiftUI | ||
|
|
||
| extension WorkspaceDetailView { | ||
| @ToolbarContentBuilder | ||
| var workspaceDetailToolbar: some ToolbarContent { | ||
| ToolbarItem(id: "workspace-toolbar", placement: .principal) { | ||
| workspaceToolbarContainer | ||
| } | ||
| } | ||
|
|
||
| /// The whole top bar as a single principal item: back, title/subtitle, and | ||
| /// the trailing controls in one layout so `.layoutPriority` can rank them. | ||
| /// Each island keeps its own Liquid Glass backing so the bar still reads as | ||
| /// three separate capsules. | ||
| @ViewBuilder | ||
| private var workspaceToolbarContainer: some View { | ||
| if #available(iOS 26.0, *) { | ||
| GlassEffectContainer { | ||
| workspaceToolbarLayout | ||
| } | ||
| } else { | ||
| workspaceToolbarLayout | ||
| } | ||
| } | ||
|
|
||
| private var workspaceToolbarLayout: some View { | ||
| HStack(spacing: workspaceToolbarIslandSpacing) { | ||
| if backButtonConfiguration != nil { | ||
| workspaceBackToolbarIsland | ||
| } | ||
|
|
||
| // The title/subtitle yields first: lower layout priority than the | ||
| // trailing controls, so it truncates rather than pushing them out | ||
| // or collapsing them into the system overflow menu. | ||
| workspaceTitleToolbarMenu | ||
| .layoutPriority(0) | ||
|
|
||
| Spacer(minLength: 0) | ||
|
|
||
| workspaceTrailingToolbarIsland | ||
| .layoutPriority(1) | ||
| } | ||
| // The navigation bar measures a principal item at its ideal width and | ||
| // centers the result. Report the container width as the ideal so UIKit | ||
| // caps it to the inset toolbar region, while `maxWidth` keeps the | ||
| // layout compressible and fills the capped proposal without overflow. | ||
| .frame(idealWidth: workspaceToolbarIdealWidth, maxWidth: .infinity, alignment: .leading) | ||
| } | ||
|
|
||
| private var workspaceToolbarIdealWidth: CGFloat? { | ||
| toolbarContentWidth > 0 ? toolbarContentWidth : nil | ||
| } | ||
|
|
||
| private var workspaceBackToolbarIsland: some View { | ||
| workspaceBackToolbarButton | ||
| .mobileGlassCircle() | ||
| .layoutPriority(1) | ||
| } | ||
|
|
||
| @ViewBuilder | ||
| private var workspaceTrailingToolbarIsland: some View { | ||
| if #available(iOS 26.0, *) { | ||
| toolbarTrailingCluster | ||
| .buttonStyle(.plain) | ||
| .glassEffect(.regular.interactive(), in: .capsule) | ||
| } else { | ||
| toolbarTrailingCluster | ||
| } | ||
| } | ||
|
|
||
| private var workspaceToolbarIslandSpacing: CGFloat { 10 } | ||
|
|
||
| private var workspaceTitleToolbarMenu: some View { | ||
| WorkspaceTitleMenu( | ||
| isEnabled: hasTitleMenuActions, | ||
| menuContent: { titleMenuContent } | ||
| ) { | ||
| toolbarTitleLabel | ||
| } | ||
| } | ||
|
|
||
| @ViewBuilder | ||
| private var toolbarTitleLabel: some View { | ||
| if isChatMode, | ||
| let session = chosenChatSession, | ||
| let conversation = chatConversationStores[session.id] { | ||
| ChatSessionHeaderView( | ||
| descriptor: conversation.descriptor, | ||
| agentState: conversation.agentState, | ||
| isConnected: conversation.isConnected, | ||
| titleOverride: workspace.name, | ||
| subtitle: tabName(for: session), | ||
| style: .toolbarCompact | ||
| ) | ||
| } else if let browser = activeBrowser { | ||
| Text(browser.title ?? workspace.name) | ||
| .font(.headline) | ||
| .lineLimit(1) | ||
| .truncationMode(.tail) | ||
| .foregroundStyle(TerminalPalette.foreground) | ||
| } else { | ||
| WorkspaceToolbarTitleView(title: workspace.name, subtitle: selectedToolbarSubtitle) | ||
| } | ||
| } | ||
| } | ||
| #endif | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.