Repository navigation
Add push notification onboarding preview #10161
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 1 commit
2670e4f
8d249c6
381be00
1c8aad7
79139f8
105900b
df03af9
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 |
|---|---|---|
|
|
@@ -2,7 +2,8 @@ | |
| import CmuxMobileSupport | ||
| import SwiftUI | ||
|
|
||
| /// Introduces the durable notification feed with a capture of its production UI. | ||
| /// Sets context for the system notification prompt with a faithful preview of | ||
| /// the alert users receive when an agent needs their attention. | ||
| struct OnboardingNotificationsView: View { | ||
| var body: some View { | ||
| ZStack { | ||
|
|
@@ -16,21 +17,153 @@ struct OnboardingNotificationsView: View { | |
| title: title, | ||
| message: L10n.string( | ||
| "mobile.onboarding.notifications.body", | ||
| defaultValue: "Review every agent alert in one feed." | ||
| defaultValue: "Get a push when work finishes or needs your input. Tap to open the right workspace." | ||
| ), | ||
| visual: OnboardingScreenshot( | ||
| content: .notifications, | ||
| accessibilityLabel: title | ||
| ) | ||
| visual: OnboardingPushPreview() | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| private var title: String { | ||
| L10n.string( | ||
| "mobile.onboarding.notifications.title", | ||
| defaultValue: "Every agent alert, in one place" | ||
| defaultValue: "Know when your agent needs you" | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| private struct OnboardingPushPreview: View { | ||
| @Environment(\.colorScheme) private var colorScheme | ||
|
|
||
| var body: some View { | ||
| ZStack { | ||
| RoundedRectangle(cornerRadius: 28, style: .continuous) | ||
| .fill(previewBackground) | ||
|
|
||
| Image("CmuxLogo") | ||
| .resizable() | ||
| .renderingMode(.template) | ||
| .scaledToFit() | ||
| .foregroundStyle(Color.primary.opacity(colorScheme == .dark ? 0.07 : 0.05)) | ||
| .frame(width: 270, height: 270) | ||
| .offset(x: 88, y: 44) | ||
|
|
||
| VStack(spacing: 0) { | ||
| Image(systemName: "lock.fill") | ||
| .font(.caption2.weight(.semibold)) | ||
| .foregroundStyle(.secondary) | ||
| .accessibilityHidden(true) | ||
|
|
||
| Text("9:41") | ||
| .font(.system(size: 54, weight: .semibold, design: .rounded)) | ||
| .monospacedDigit() | ||
| .foregroundStyle(.primary) | ||
| .accessibilityHidden(true) | ||
|
|
||
| Spacer(minLength: 24) | ||
|
|
||
| OnboardingPushBanner() | ||
| } | ||
| .padding(18) | ||
| } | ||
| .frame(maxWidth: .infinity) | ||
| .frame(height: 330) | ||
| .clipShape(RoundedRectangle(cornerRadius: 28, style: .continuous)) | ||
|
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. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Description: Inspect OnboardingSceneContent layout and the compact-height UI test assertions.
set -euo pipefail
fd -e swift OnboardingSceneContent
rg -n -C5 'compact' ios/cmuxUITests/cmuxUITests.swift 2>/dev/null || true
rg -n -C5 'OnboardingSceneContent' Packages/iOS/CmuxMobileShellUI/SourcesRepository: manaflow-ai/cmux Length of output: 13872 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '--- OnboardingSceneContent ---'
cat -n Packages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/OnboardingSceneContent.swift | sed -n '1,180p'
echo '--- OnboardingNotificationsView ---'
cat -n Packages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/OnboardingNotificationsView.swift | sed -n '1,110p'
echo '--- compact-height test context ---'
cat -n Packages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/OnboardingSceneContent.swift | sed -n '330,430p'
echo '--- helper definition and onboarding container references ---'
rg -n -C12 'func assertPageContentFitsWithoutScrolling|assertPageContentFitsWithoutScrolling|OnboardingSceneContent|OnboardingNotificationsView' --glob '*.swift' .Repository: manaflow-ai/cmux Length of output: 38413 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '--- compact-layout test setup and helper ---'
cat -n ios/cmuxUITests/cmuxUITests.swift | sed -n '100,220p'
cat -n ios/cmuxUITests/cmuxUITests.swift | sed -n '350,425p'
echo '--- onboarding flow container and chrome ---'
cat -n Packages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/OnboardingFlowView.swift | sed -n '1,180p'
rg -n -C8 'pageViewport|MobileOnboardingPage|footer|OnboardingFlowView' Packages/iOS/CmuxMobileShellUI/Sources ios/cmuxUITests/cmuxUITests.swiftRepository: manaflow-ai/cmux Length of output: 50373 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '--- relevant onboarding files ---'
fd -i 'Onboarding.*(Container|PageViewport|Chrome)' Packages/iOS/CmuxMobileShellUI/Sources
rg -l 'struct OnboardingSceneContainer|struct OnboardingSceneChrome' Packages/iOS/CmuxMobileShellUI/Sources
echo '--- page viewport ---'
cat -n Packages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/OnboardingPageViewport.swift | sed -n '1,110p'
echo '--- scene container implementation ---'
container_file=$(rg -l 'struct OnboardingSceneContainer' Packages/iOS/CmuxMobileShellUI/Sources | head -n 1)
cat -n "$container_file" | sed -n '1,260p'
echo '--- viewport and chrome identifiers in production source ---'
rg -n -C6 'MobileOnboardingPageViewport|MobileOnboardingHeader|MobileOnboardingFooter|MobileOnboardingProgressIndicator' Packages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUIRepository: manaflow-ai/cmux Length of output: 11683 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '--- compact header ---'
cat -n Packages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/OnboardingSceneHeader.swift | sed -n '1,100p'
echo '--- compact footer ---'
cat -n Packages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/OnboardingSceneFooter.swift | sed -n '1,100p'
echo '--- test launch/device configuration ---'
cat -n ios/cmuxUITests/cmuxUITests.swift | sed -n '1,105p'
rg -n -C5 'iPhone SE|iPhone 8|device|destination|scheme|platform' ios .github Package.swift --glob '*.json' --glob '*.yaml' --glob '*.yml' --glob '*.xcscheme' --glob '*.swift' 2>/dev/null | head -n 240Repository: manaflow-ai/cmux Length of output: 28020 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '--- prominent button sizing ---'
rg -n -C10 'func mobileGlassProminentButton|mobileGlassProminentButton' Packages/iOS/CmuxMobileShellUI/Sources Packages/iOS/CmuxMobileSupport/Sources
echo '--- copy layout ---'
rg -n -C8 'struct OnboardingSceneCopy|OnboardingSceneCopy' Packages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI
echo '--- deterministic compact-height lower-bound check ---'
python3 - <<'PY'
screen_height = 375 # iPhone SE (2nd/3rd generation) landscape logical height
preview_height = 330
header_minimum = 44 + 4 # header control frame + top padding
footer_padding = 8 + 8 # compact footer top + bottom padding
footer_control_minimum = 44 # primary button's standard minimum hit target
required_height = header_minimum + preview_height + footer_padding + footer_control_minimum
remaining_page_height = screen_height - header_minimum - footer_padding - footer_control_minimum
print(f"screen_height={screen_height}")
print(f"required_height={required_height}")
print(f"remaining_page_height_upper_bound={remaining_page_height}")
print(f"preview_fits={preview_height <= remaining_page_height}")
PYRepository: manaflow-ai/cmux Length of output: 24948 Make the compact-height preview fit the page viewport
🤖 Prompt for AI Agents |
||
| .overlay { | ||
| RoundedRectangle(cornerRadius: 28, style: .continuous) | ||
| .stroke(Color.primary.opacity(0.1), lineWidth: 1) | ||
| } | ||
| .accessibilityElement(children: .contain) | ||
| .accessibilityIdentifier("MobileOnboardingPushPreview") | ||
| } | ||
|
|
||
| private var previewBackground: Color { | ||
| colorScheme == .dark | ||
| ? Color(uiColor: .secondarySystemBackground) | ||
| : Color(uiColor: .systemGray5) | ||
| } | ||
| } | ||
|
|
||
| private struct OnboardingPushBanner: View { | ||
| var body: some View { | ||
| VStack(alignment: .leading, spacing: 8) { | ||
| HStack(spacing: 9) { | ||
| OnboardingPushAppIcon() | ||
|
|
||
| Text(L10n.string( | ||
| "mobile.onboarding.pushPreview.appName", | ||
| defaultValue: "cmux" | ||
| )) | ||
| .font(.caption.weight(.semibold)) | ||
|
|
||
| Spacer(minLength: 8) | ||
|
|
||
| Text(L10n.string( | ||
| "mobile.onboarding.pushPreview.time", | ||
| defaultValue: "now" | ||
| )) | ||
| .font(.caption) | ||
| .foregroundStyle(.secondary) | ||
| } | ||
|
|
||
| Text(L10n.string( | ||
| "mobile.onboarding.pushPreview.title", | ||
| defaultValue: "Codex needs your input" | ||
| )) | ||
| .font(.subheadline.weight(.semibold)) | ||
|
|
||
| Text(L10n.string( | ||
| "mobile.onboarding.pushPreview.body", | ||
| defaultValue: "Approve the command to keep work moving." | ||
| )) | ||
| .font(.subheadline) | ||
| .foregroundStyle(.primary.opacity(0.82)) | ||
| .fixedSize(horizontal: false, vertical: true) | ||
| } | ||
| .padding(14) | ||
| .modifier(OnboardingPushBannerMaterial()) | ||
| .overlay { | ||
| RoundedRectangle(cornerRadius: 26, style: .continuous) | ||
| .stroke(Color.white.opacity(0.18), lineWidth: 0.5) | ||
| } | ||
| .shadow(color: Color.black.opacity(0.12), radius: 18, y: 8) | ||
| .accessibilityElement(children: .combine) | ||
| .accessibilityIdentifier("MobileOnboardingPushBanner") | ||
| } | ||
| } | ||
|
|
||
| private struct OnboardingPushAppIcon: View { | ||
| var body: some View { | ||
| Image("CmuxLogo") | ||
| .resizable() | ||
| .scaledToFit() | ||
| .padding(5) | ||
| .frame(width: 32, height: 32) | ||
| .background(Color.white, in: RoundedRectangle(cornerRadius: 8, style: .continuous)) | ||
| .overlay { | ||
| RoundedRectangle(cornerRadius: 8, style: .continuous) | ||
| .stroke(Color.black.opacity(0.08), lineWidth: 0.5) | ||
| } | ||
| .accessibilityHidden(true) | ||
| } | ||
| } | ||
|
|
||
| private struct OnboardingPushBannerMaterial: ViewModifier { | ||
| @ViewBuilder | ||
| func body(content: Content) -> some View { | ||
| if #available(iOS 26.0, *) { | ||
| content | ||
| .glassEffect( | ||
| .regular, | ||
| in: RoundedRectangle(cornerRadius: 26, style: .continuous) | ||
| ) | ||
| } else { | ||
| content | ||
| .background( | ||
| .regularMaterial, | ||
| in: RoundedRectangle(cornerRadius: 26, style: .continuous) | ||
| ) | ||
| } | ||
| } | ||
| } | ||
| #endif | ||
Uh oh!
There was an error while loading. Please reload this page.