Repository navigation
Fix iOS chat toolbar glass separation #7111
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
Changes from all commits
e857082
07aa5f4
ea79f27
f474e4a
656e8a8
3878c9a
eb3e4f8
8d523c7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,7 +28,8 @@ struct AgentChatDemoScreen: View { | |
| } else { | ||
| ProgressView() | ||
| .task { | ||
| let (messages, descriptor) = ChatFixtureConversation().make() | ||
| let (messages, fixtureDescriptor) = ChatFixtureConversation().make() | ||
| let descriptor = demoDescriptor(from: fixtureDescriptor) | ||
| let source = FixtureChatEventSource(backlog: messages, replyToSends: true) | ||
| stack = DemoStack( | ||
| store: ChatConversationStore(descriptor: descriptor, source: source) | ||
|
|
@@ -68,6 +69,7 @@ struct AgentChatDemoScreen: View { | |
| badgeContrast: .darkBackground, | ||
| action: {} | ||
| ) | ||
| .mobileIsolatedGlassCompactToolbarControl(horizontalPadding: 16) | ||
| } | ||
| ToolbarItem(placement: .principal) { | ||
| WorkspaceTitleMenu( | ||
|
|
@@ -122,6 +124,15 @@ struct AgentChatDemoScreen: View { | |
| } | ||
| } | ||
|
|
||
| private func demoDescriptor(from descriptor: ChatSessionDescriptor) -> ChatSessionDescriptor { | ||
| let demoState = ProcessInfo.processInfo.environment["CMUX_UITEST_AGENT_CHAT_STATE"]? | ||
| .trimmingCharacters(in: .whitespacesAndNewlines) | ||
| guard demoState == "idle" else { | ||
| return descriptor | ||
| } | ||
| return descriptor.withState(.idle) | ||
| } | ||
|
Comment on lines
+127
to
+134
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Rule Used: Flag Swift files under a production Sources path (... (source) Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Comment on lines
+127
to
+134
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Confirm UITestConfig.value's trimming/matching semantics before reuse.
rg -n -A 15 'struct UITestConfig|enum UITestConfig' --type=swift
rg -n -A 15 'func value\(' --type=swift -g '*UITestConfig*'Repository: manaflow-ai/cmux Length of output: 154 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '--- AgentChatDemoScreen.swift slice ---'
sed -n '1,220p' Packages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/AgentChatDemoScreen.swift
echo
echo '--- Search for UITestConfig and value(for:) ---'
rg -n 'UITestConfig|value\(for:|CMUX_UITEST_AGENT_CHAT_STATE|inlineWorkspaceTitle|inlineWorkspaceSubtitle' Packages -g '*.swift'Repository: manaflow-ai/cmux Length of output: 34268 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '--- UITestConfig.swift ---'
sed -n '1,260p' Packages/iOS/CmuxMobileSupport/Sources/CmuxMobileSupport/UITestConfig.swift
echo
echo '--- UITestConfigTests.swift ---'
sed -n '1,220p' Packages/iOS/CmuxMobileSupport/Tests/CmuxMobileSupportTests/UITestConfigTests.swiftRepository: manaflow-ai/cmux Length of output: 13404 🏁 Script executed: #!/bin/bash
set -euo pipefail
sed -n '1,260p' Packages/iOS/CmuxMobileSupport/Sources/CmuxMobileSupport/UITestConfig.swiftRepository: manaflow-ai/cmux Length of output: 7795 Use 🤖 Prompt for AI Agents |
||
|
|
||
| private func header(for stack: DemoStack) -> some View { | ||
| ChatSessionHeaderView( | ||
| descriptor: stack.store.descriptor, | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -93,6 +93,26 @@ public extension View { | |||||
| #endif | ||||||
| } | ||||||
|
|
||||||
| /// Compact toolbar glass that must remain visually separate from adjacent | ||||||
| /// glass controls. | ||||||
| @ViewBuilder | ||||||
| func mobileIsolatedGlassCompactToolbarControl(horizontalPadding: CGFloat = 14) -> some View { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! |
||||||
| #if os(iOS) | ||||||
| if #available(iOS 26.0, *) { | ||||||
| self | ||||||
| .buttonStyle(.plain) | ||||||
| .controlSize(.small) | ||||||
| .padding(.horizontal, horizontalPadding) | ||||||
| .frame(minHeight: 44) | ||||||
| .glassEffect(.regular.interactive(), in: .capsule) | ||||||
| } else { | ||||||
| self | ||||||
| } | ||||||
| #else | ||||||
| self | ||||||
| #endif | ||||||
| } | ||||||
|
|
||||||
| /// Non-interactive compact glass title backing. | ||||||
| @ViewBuilder | ||||||
| func mobileGlassCompactNavigationTitle() -> some View { | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: The leading hard-stop overlay is painted black, not used as a mask, so it can render a visible black bar in the chip row. Use a background-matching style/material or remove the visible fill instead of hard-coding black.
Prompt for AI agents