Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -185,22 +185,12 @@ struct JITPermissionView: View {

@ViewBuilder
private func permissionButton(_ title: String, isPrimary: Bool, action: @escaping () -> Void) -> some View {
Button(action: action) {
Text(title)
.font(VFont.labelDefault)
.foregroundStyle(isPrimary ? VColor.auxWhite : VColor.contentDefault.opacity(0.85))
.frame(maxWidth: .infinity)
.padding(.horizontal, VSpacing.sm)
.padding(.vertical, VSpacing.sm + VSpacing.xxs)
.background(isPrimary ? AnyShapeStyle(VColor.primaryBase) : AnyShapeStyle(Color.clear))
.clipShape(RoundedRectangle(cornerRadius: VRadius.md))
.overlay(
RoundedRectangle(cornerRadius: VRadius.md)
.stroke(isPrimary ? Color.clear : VColor.contentDefault.opacity(0.2), lineWidth: 1)
)
}
.buttonStyle(.plain)
.frame(maxWidth: .infinity)
VButton(
label: title,
style: isPrimary ? .primary : .outlined,
isFullWidth: true,
action: action
)
}

private func dismiss() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ struct ImproveExperienceStepView: View {

if tosAccepted {
VIconView(.check, size: 12)
.foregroundStyle(VColor.auxWhite)
.foregroundStyle(VColor.contentInset)
}
}
.frame(width: 20, height: 20)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -525,30 +525,14 @@ struct ChatGallerySection: View {
}

private func surfaceActionPill(label: String, style: SurfaceActionStyle) -> some View {
Text(label)
.font(VFont.bodyMediumDefault)
.foregroundStyle(surfaceActionForeground(style))
.padding(.horizontal, VSpacing.lg)
.padding(.vertical, VSpacing.sm)
.background(
RoundedRectangle(cornerRadius: VRadius.md)
.fill(surfaceActionBackground(style))
)
VButton(label: label, style: surfaceActionButtonStyle(style)) {}
}

private func surfaceActionForeground(_ style: SurfaceActionStyle) -> Color {
private func surfaceActionButtonStyle(_ style: SurfaceActionStyle) -> VButton.Style {
switch style {
case .primary: return VColor.auxWhite
case .destructive: return VColor.auxWhite
case .secondary: return VColor.contentDefault
}
}

private func surfaceActionBackground(_ style: SurfaceActionStyle) -> Color {
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
case .destructive: return .danger
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Comment on lines +361 to +363
Copy link
Copy Markdown
Contributor Author

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 .regular size uses VFont.bodyMediumEmphasised (bolder weight) at VButton.swift:68. This applies to both InlineSurfaceRouter.swift action buttons and the ChatGallerySection.swift gallery 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 .compact size (which uses VFont.labelDefault) or a tintColor override might be more appropriate.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

) {
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
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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 .secondary style used VColor.borderBase.opacity(0.5) as a filled background, while the new .outlined VButton style uses a transparent background with a VColor.borderElement border stroke (VButton.swift:259-266). This is an intentional design system alignment, but reviewers should verify the visual result is acceptable — the secondary action buttons will look noticeably different (outlined vs filled) in inline surface contexts like tables and lists.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

case .destructive: return .danger
}
}

Expand Down
27 changes: 4 additions & 23 deletions clients/shared/Features/Surfaces/FileUploadSurfaceView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,32 +93,13 @@ public struct FileUploadSurfaceView: View {
HStack(spacing: VSpacing.lg) {
Spacer()

Button(action: { onCancel() }) {
Text("Cancel")
.font(VFont.labelDefault)
.foregroundStyle(VColor.contentSecondary)
.padding(.horizontal, VSpacing.lg)
.padding(.vertical, VSpacing.sm)
.overlay(
RoundedRectangle(cornerRadius: VRadius.sm)
.stroke(VColor.borderBase, lineWidth: 1)
)
VButton(label: "Cancel", style: .outlined, size: .compact) {
onCancel()
}
.buttonStyle(.plain)

Button(action: { submitFiles() }) {
Text("Upload")
.font(VFont.labelDefault)
.foregroundStyle(selectedFiles.isEmpty ? VColor.contentTertiary : VColor.auxWhite)
.padding(.horizontal, VSpacing.lg)
.padding(.vertical, VSpacing.sm)
.background(
RoundedRectangle(cornerRadius: VRadius.sm)
.fill(selectedFiles.isEmpty ? VColor.surfaceOverlay : VColor.primaryBase)
)
VButton(label: "Upload", style: .primary, size: .compact, isDisabled: selectedFiles.isEmpty) {
submitFiles()
}
.buttonStyle(.plain)
.disabled(selectedFiles.isEmpty)
}
}
}
Expand Down