-
Notifications
You must be signed in to change notification settings - Fork 87
fix: replace auxWhite-on-primaryBase with VButton across the app #23802
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
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 |
|---|---|---|
|
|
@@ -358,46 +358,29 @@ public struct InlineSurfaceRouter: View { | |
| } else { | ||
| VStack(alignment: .leading, spacing: VSpacing.sm) { | ||
| ForEach(surface.actions, id: \.uniqueId) { action in | ||
| Button { | ||
| VButton( | ||
| label: action.label, | ||
| style: buttonStyle(for: action.style) | ||
| ) { | ||
| clickedActionLabel = action.label | ||
| // Merge action.data (button payload) with selectionPayload (list selection) | ||
| var merged = selectionPayload ?? [:] | ||
| if let actionData = action.data { | ||
| for (key, value) in actionData { | ||
| merged[key] = value | ||
| } | ||
| } | ||
| onAction(surface.id, action.id, merged.isEmpty ? nil : merged) | ||
| } label: { | ||
| Text(action.label) | ||
| .font(VFont.bodyMediumDefault) | ||
| .foregroundStyle(buttonForeground(action.style)) | ||
| .padding(.horizontal, VSpacing.lg) | ||
| .padding(.vertical, VSpacing.sm) | ||
| .background( | ||
| RoundedRectangle(cornerRadius: VRadius.md) | ||
| .fill(buttonBackground(action.style)) | ||
| ) | ||
| } | ||
| .buttonStyle(.plain) | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| private func buttonForeground(_ style: SurfaceActionStyle) -> Color { | ||
| switch style { | ||
| case .primary: return VColor.auxWhite | ||
| case .destructive: return VColor.auxWhite | ||
| case .secondary: return VColor.contentDefault | ||
| } | ||
| } | ||
|
|
||
| private func buttonBackground(_ style: SurfaceActionStyle) -> Color { | ||
| private func buttonStyle(for style: SurfaceActionStyle) -> VButton.Style { | ||
| switch style { | ||
| case .primary: return VColor.primaryBase | ||
| case .destructive: return VColor.systemNegativeStrong | ||
| case .secondary: return VColor.borderBase.opacity(0.5) | ||
| case .primary: return .primary | ||
| case .secondary: return .outlined | ||
|
Contributor
Author
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. 🚩 Visual behavior change: secondary button background differs between old and new code The old Was this helpful? React with 👍 or 👎 to provide feedback. |
||
| case .destructive: return .danger | ||
| } | ||
| } | ||
|
|
||
|
|
||
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.
🚩 Font weight change for inline surface action buttons
The old inline action buttons used
VFont.bodyMediumDefault(lighter weight). VButton with default.regularsize usesVFont.bodyMediumEmphasised(bolder weight) atVButton.swift:68. This applies to bothInlineSurfaceRouter.swiftaction buttons and theChatGallerySection.swiftgallery pills. The font change is subtle but affects the visual density of action buttons in chat bubbles. If the lighter weight was intentional for these inline contexts, a.compactsize (which usesVFont.labelDefault) or atintColoroverride might be more appropriate.Was this helpful? React with 👍 or 👎 to provide feedback.