Refactor BarButton to use rounded shape and update AI Chat tab hint to utilize BarButton

This commit is contained in:
abue-ammar
2026-08-27 02:13:00 +06:00
parent fd626a0347
commit a0967ccb6f
2 changed files with 14 additions and 12 deletions
+5 -5
View File
@@ -1,16 +1,16 @@
import SwiftUI
/// A bar control's hover chrome. The footer's buttons are capsules; one that opens a menu takes
/// that menu's own corner instead, so the control and what it opens read as one piece.
/// A bar control's hover chrome. The footer's buttons are capsules; a header control takes the
/// menu row's own corner instead, so every control along that row reads as one family.
enum BarButtonChrome {
case capsule
case menu
case rounded
var shape: AnyShape {
switch self {
case .capsule:
return AnyShape(Capsule())
case .menu:
case .rounded:
return AnyShape(
RoundedRectangle(cornerRadius: Theme.Radius.menuRow, style: .continuous))
}
@@ -66,7 +66,7 @@ struct HeaderMenuButton: View {
}
var body: some View {
BarButton(chrome: .menu, action: action) {
BarButton(chrome: .rounded, action: action) {
HStack(spacing: Theme.Spacing.sm) {
switch icon {
case .symbol(let name):
+9 -7
View File
@@ -543,15 +543,17 @@ struct RootPaletteView: View {
}
/// Nothing else advertises Tab, so the launcher says where it goes — the footer's own pairing
/// of a label with its cap, never a click target: the header belongs to the field.
/// of a label with its cap, and the click does exactly what the key it names does.
private var aiChatTabHint: some View {
HStack(spacing: Theme.Spacing.sm) {
Text("AI Chat")
.font(Theme.Typography.bar)
.foregroundStyle(Theme.Colors.textSecondary)
KeyCapChip(text: "⇥", style: .outline)
BarButton(chrome: .rounded, action: cycleMode) {
HStack(spacing: Theme.Spacing.sm) {
Text("AI Chat")
.font(Theme.Typography.bar)
.foregroundStyle(Theme.Colors.textSecondary)
KeyCapChip(text: "⇥", style: .outline)
}
}
.allowsHitTesting(false)
.help("Open AI Chat ⇥")
}
/// Resolved through `PaletteTabAction` rather than restated, so the hint cannot promise a