prototype
MAmattpocock/skills337k4,978 new stars in the last 7 days
Guide for building and updating macOS Launcher SwiftUI interfaces (NXLauncher / NX2AppleUI) using the centralized Theme Style System (LauncherTheme.ButtonShape, ButtonSize, buttonSpec, LauncherFlowRow, LauncherBadge) and Gamepad Focus Ring / B-key rules. Use whenever adding, modifying, or reviewing macOS launcher views, buttons, sheets, toolbars, badges, toggles, checkboxes, radios, or gamepad navigation in launchers/macos/frontend.
Use this skill whenever editing SwiftUI views in launchers/macos/frontend/Sources/NXLauncher or launchers/macos/frontend/Sources/NX2Apple. All button geometry, icon spacing, typography, badges, and gamepad focus ring parameters are centralized in LauncherTheme (LauncherTheme.swift / LauncherStyles.swift) — never hardcode ad-hoc button frames or shapes inside feature views.
| UI Surface | Shape (ButtonShape) | Size (ButtonSize) | Style / Component |
|---|---|---|---|
| Main window toolbar status / task pills | .capsule | .compact (30 pt) | LauncherSecondaryButtonStyle(size: .compact, shape: .capsule) |
| Home Hero primary / secondary actions | .capsule | .hero (52 pt) | ConsolePlayButtonStyle() / ConsolePillButtonStyle() |
| Sheets, settings, forms, cards, console panels | .rounded (r = 10) | .regular (36 pt) | LauncherPrimaryButtonStyle() / LauncherSecondaryButtonStyle() |
| Job / failure / risk-confirmation pages | .rounded (r = 10) | .prominent (48 pt) | LauncherPrimaryButtonStyle(size: .prominent) / LauncherSecondaryButtonStyle(size: .prominent) |
Update popup (UpdatePopupView) | .capsule | .regular (36 pt) | LauncherPrimaryButtonStyle(shape: .capsule) / LauncherSecondaryButtonStyle(shape: .capsule) |
| Square icon button (forms / popovers / list rows) | .rounded | 36×36, r=10 or 28×28, r=8 | LauncherIconButtonStyle(size:cornerRadius:) |
Circular icon button (toolbar / Hero / sheet ×) | Circle | 32 / 40 / 52 | ConsoleIconButtonStyle(size:backgroundless:accent:) |
Status / version / BETA pill tags | .circular capsule | 18–24 pt | LauncherBadge(_:...) |
| Switch / Checkbox / Standalone Radio | — | — | LauncherSwitchStyle() / PadToggleStyle(.checkbox) / LauncherRadioRow |
All button heights, horizontal paddings, fonts, icon sizes, icon spacings, and min widths come from
LauncherTheme.buttonSpec(_:primary:). To restyle the entire app, editLauncherTheme.swiftinstead of individual views.
Place side-by-side actions in a standard HStack using uniform horizontal padding (LauncherTheme.buttonSpec) and natural label width — do not force equal widths, so long localized labels (French / Spanish / Japanese) never overflow or clip:
HStack(spacing: LauncherTheme.Space.medium) {
Button(loc.t("s2arm.env.recheck")) { model.checkEnvironment() }
.controllerButtonStyle(LauncherSecondaryButtonStyle())
Button(loc.t("launch.done")) { dismiss() }
.controllerButtonStyle(LauncherPrimaryButtonStyle())
}
When a row can contain 2–4 buttons with long localized text (e.g. failure recovery actions), use LauncherFlowRow instead of HStack so buttons wrap cleanly instead of clipping icons or truncating text:
LauncherFlowRow(spacing: 12, rowSpacing: 10) {
Button { retry() } label: { Label(t("phone.retry"), systemImage: "arrow.clockwise") }
.controllerButtonStyle(LauncherPrimaryButtonStyle(size: .prominent))
CopyReportButton(model: model, gameID: id, operations: ops, fallback: msg, size: .prominent)
}
有新版, BETA)Always use LauncherBadge (which uses Capsule(style: .circular) and integer height) rather than Text(...).overlay(Capsule().strokeBorder(...)):
LauncherBadge("BETA", foreground: Self.gold, background: .clear,
border: Self.gold.opacity(0.55), font: .manrope(9.5, .bold),
tracking: 1.4, horizontalPadding: 8, height: 20)
HStack / LauncherFlowRow must use the same ButtonShape (all .rounded or all .capsule) and the same ButtonSize.Capsule() (.continuous) with .strokeBorder(...): On macOS SwiftUI, continuous capsules at small heights (18–36 pt) render vertical straight-line artifacts at left/right ends. Always use Capsule(style: .circular), LauncherControlShape, or LauncherBadge..fixedSize() on buttons and never truncate button text: Every square or capsule button uses its natural content width plus uniform horizontal padding from LauncherTheme.buttonSpec(_:primary:) (no .fixedSize()). Wrap multi-button long-label rows with LauncherFlowRow. Verify all 6 UI languages (zh, zh-Hant, en, ja, es, fr) at minimum window width.LauncherHeroActionLabel: Always pass Label(title, systemImage:) into LauncherPrimaryButtonStyle / LauncherSecondaryButtonStyle so LauncherLabelStyle governs icon slot and spacing uniformly..clipShape(Capsule()) outside a button style: Pass shape: .capsule so PadRingShaped reports .infinity to the gamepad focus ring..controllerButtonStyle(...), PadToggleStyle(.checkbox), LauncherRadioRow, or LauncherSwitchStyle() — never raw .buttonStyle(...) (mouse-only exceptions must use .controllerExcluded(...)). Note: checkboxes where left/right D-pad must stay reserved for navigation (such as SGradeCard export.sgrade.toggle) keep .toggleStyle(.checkbox) + .controllerControl(id:activate:) instead of PadToggleStyle(.checkbox)..plain cards/rows/chips must declare .controllerRingRadius(r) matching their container corner radius.outset: LauncherTheme.Focus.creamOutset; dark/bordered controls use outset: 0; LauncherRadioRow uses outset: 0).B via .controllerShortcut(.back) or .controllerBackAction(...) without falling through to Esc beep.When changing UI styles, spacing, or button layouts:
zh, zh-Hant, en, ja, es, fr) at minimum window width via NSHostingView + NSWindow + bitmapImageRepForCachingDisplay (same pattern as SettingsLayoutTests.swift) and inspect BEFORE vs AFTER side-by-side comparison images.Whenever you add, change, or deprecate any Theme Style token, reusable UI component, button/badge rule, or gamepad focus convention:
skills/macos-launcher-theme-ui/SKILL.md in the same PR so every AI agent and contributor follows the exact same specification without drift.zh-Hant) UI strings aligned with Simplified Chinese (zh) and verify all 6 languages (zh, zh-Hant, en, ja, es, fr) have no truncated button text or hardcoded single-language labels.ButtonShape, ButtonSize, buttonSpec, Focus, LauncherPrimaryButtonStyle, LauncherIconButtonStyle, LauncherLabelStyle, LauncherFlowRow, LauncherBadgeLauncherSecondaryButtonStyle, LauncherSwitchStyle, LauncherRadioRow, LauncherSegmented, LauncherSliderConsolePlayButtonStyle, ConsolePillButtonStyle, ConsoleIconButtonStyleLauncherPadRing, PadRingShaped, B-key layeringMAmattpocock/skills337k4,978 new stars in the last 7 days
AFaffaan-m/ECC315k4,381 new stars in the last 7 days
FIfirecrawl/firecrawl215k5,595 new stars in the last 7 days
ANanthropics/skills203k3,265 new stars in the last 7 days
Set visual direction and typography for UI, avoiding templated defaults.
ANanthropics/skills203k3,265 new stars in the last 7 days
Build complex HTML artifacts with React, Tailwind CSS, state management and routing.
ANanthropics/skills203k3,265 new stars in the last 7 days