From d97993d59a8f1faff11377ce894c15a0e213c906 Mon Sep 17 00:00:00 2001 From: "prompt.ac/@jeffrey" Date: Fri, 9 Oct 2026 11:10:30 -0700 Subject: [PATCH] Whistlegraph: the ware is the piece's extension in the top bar /wgCode.ac is an AC piece and /wgCode.rbx a Roblox room; tapping the extension opens the same ware menu that used to sit on its own row under the header. The row is gone. Test identifiers (ware-picker, ware-piece, ware-roblox) are unchanged. --- .../whistlegraph/Sources/WhistlegraphHeader.swift | 2 ++ .../whistlegraph/Sources/WhistlegraphScreen.swift | 6 ------ apple/whistlegraph/Sources/WhistlegraphWare.swift | 14 ++++++-------- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/apple/whistlegraph/Sources/WhistlegraphHeader.swift b/apple/whistlegraph/Sources/WhistlegraphHeader.swift index e61e38dd2c..f661c4d78a 100644 --- a/apple/whistlegraph/Sources/WhistlegraphHeader.swift +++ b/apple/whistlegraph/Sources/WhistlegraphHeader.swift @@ -179,6 +179,8 @@ struct IdentityHeader: View { ComicTitle(text: "/" + session.snapshot.code, size: size) }.buttonStyle(.plain).accessibilityLabel(session.snapshot.code + ", pieces").accessibilityIdentifier("workspace-settings") } + // The ware is the extension: /code.ac is an AC piece, .rbx a Roblox room. Tap to switch. + if signedIn { WarePicker(session: session, size: size, beforeSwitch: beforeOpening) } } .onChange(of: showingAccount) { _, open in DeviceActionLog.shared.record(.screen, open ? .presented : .dismissed, control: .account) } .onChange(of: showingPieces) { _, open in DeviceActionLog.shared.record(.screen, open ? .presented : .dismissed, control: .pieces) } diff --git a/apple/whistlegraph/Sources/WhistlegraphScreen.swift b/apple/whistlegraph/Sources/WhistlegraphScreen.swift index 2d4f4073bc..35953c3bd5 100644 --- a/apple/whistlegraph/Sources/WhistlegraphScreen.swift +++ b/apple/whistlegraph/Sources/WhistlegraphScreen.swift @@ -127,12 +127,6 @@ struct WhistlegraphScreen: View { .accessibilityLabel("Open story cards").accessibilityIdentifier("play-versions") } }.frame(height: narrator.isPlaying ? 0 : nil).clipped().accessibilityHidden(narrator.isPlaying) - if !narrator.isPlaying && !showComposer { - HStack { - WarePicker(session: session) { narrator.stop(); showComposer = false } - Spacer(minLength: 0) - } - } VStack(spacing: narrator.isPlaying ? 12 : 4) { // This representable never changes identity when cards or versions change. GeometryReader { geometry in diff --git a/apple/whistlegraph/Sources/WhistlegraphWare.swift b/apple/whistlegraph/Sources/WhistlegraphWare.swift index cfe0c68d75..b2c3d05df0 100644 --- a/apple/whistlegraph/Sources/WhistlegraphWare.swift +++ b/apple/whistlegraph/Sources/WhistlegraphWare.swift @@ -4,6 +4,8 @@ enum Ware: String, CaseIterable, Identifiable { case piece, roblox var id: String { rawValue } var title: String { self == .piece ? "Aesthetic.Computer Piece" : "Roblox Room" } + /// The file-extension spelling in the top bar: /code.ac, /code.rbx. + var fileExtension: String { self == .piece ? "ac" : "rbx" } } struct RobloxRoomSnapshot: Decodable { @@ -14,6 +16,7 @@ struct RobloxRoomSnapshot: Decodable { struct WarePicker: View { @ObservedObject var session: WhistlegraphSession + var size: CGFloat = 18 let beforeSwitch: () -> Void var body: some View { Menu { @@ -27,14 +30,9 @@ struct WarePicker: View { }.accessibilityIdentifier("ware-" + ware.rawValue) } } label: { - HStack(spacing: 7) { - if session.snapshot.wareID == "piece" { - (Text("Aesthetic") + Text(".").foregroundColor(Color(red: 180/255, green: 72/255, blue: 135/255)) + Text("Computer Piece")) - } else { Text("Roblox Room") } - Image(systemName: "chevron.down").font(.caption.bold()) - } - .font(.custom("ComicRelief-Regular", size: 18, relativeTo: .body)) - .frame(minHeight: 44) + // The ware reads as the piece's extension, right after its /code. + ComicTitle(text: "." + (Ware(rawValue: session.snapshot.wareID) ?? .piece).fileExtension, size: size) + .opacity(0.75) } .disabled(!session.engineReady || session.snapshot.busy || session.capturePhase != .idle) .accessibilityLabel("Ware, " + (Ware(rawValue: session.snapshot.wareID)?.title ?? Ware.piece.title)) -- 2.51.2