Reine Umbenennung, kein Verhalten geändert — bewusst als eigener Commit, damit „umbenannt" und „umgebaut" im Nachhinein auseinanderzuhalten sind. 712 mal `Flixy`, 778 mal `flixy`, 7 mal `FLIXY` in 169 Dateien, dazu 25 Pfade. Ziele: `Halo`, `HaloTV`, `HaloTopShelf`, `HaloUITests`, `HaloKit` mit `HaloDesign`, `HaloDownloads`, `HaloPlayback` und `HaloProbe`. `MediaKit`, `JellyfinKit` und `DownloadWidget` tragen den Namen nicht und bleiben. `docs/superpowers/specs/` ist ausgenommen. Datierte Entwurfsdokumente sind ein Protokoll getroffener Entscheidungen; sie nachträglich umzuschreiben hiesse, die Vergangenheit zu glätten. **Die Bundle-ID wandert mit** — ausdrücklich so gewollt, mit bekanntem Preis: `com.scarriffleservices.halo` ist für iOS eine *andere* App. Die installierte Fassung bleibt daneben stehen, mit Downloads und Anmeldung in ihrem Container; Halo startet leer. Einmal neu anmelden, heruntergeladene Folgen einmal neu laden. Dasselbe gilt für die App-Gruppe, die sich TV-App und Top Shelf teilen. **Eine Folge davon, die beim Entscheiden noch nicht auf dem Tisch lag:** der Aufräumschritt aus dem vorigen Commit kommt an die alten Plex-Token nicht mehr heran. Der Schlüsselbund grenzt nach Team und Bundle-Kennung ab — was unter `…flixy` liegt, ist für `…halo` unerreichbar. Erledigt wird es trotzdem, nur anders: **die alte App löschen.** iOS räumt deren Schlüsselbund-Einträge beim Deinstallieren mit ab. Der Code bleibt stehen, weil er für jeden Stand vor dieser Umbenennung richtig ist und im Jahr einen Startvergleich kostet. Die Projektdatei ist aus `project.yml` neu erzeugt, der alte Ordner gelöscht statt umbenannt — sie steht ohnehin nicht im Repo. Das Verzeichnis des Repos selbst heißt weiter `Flixy`; das umzubenennen ist ein Handgriff ausserhalb des Projekts. 368 Tests grün. iOS und tvOS bauen. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
171 lines
6.3 KiB
Swift
171 lines
6.3 KiB
Swift
import SwiftUI
|
|
import HaloDesign
|
|
|
|
/// Die Farbeinstellungen.
|
|
///
|
|
/// Kuratierte Kacheln plus eine freie Farbe. Die kuratierten sind so gewählt,
|
|
/// dass sie auf dem dunklen Grund ohne Nachhilfe lesbar sind; bei einer freien
|
|
/// Farbe greift die Kontrastkorrektur — und sagt es auch, statt die Farbe
|
|
/// stillschweigend zu verändern.
|
|
struct AppearanceView: View {
|
|
@Environment(HaloTheme.self) private var theme
|
|
@Environment(HomeLayoutSettings.self) private var layout
|
|
@State private var customHex: String = ""
|
|
@State private var showsCustomField = false
|
|
|
|
private let columns = [GridItem(.adaptive(minimum: 64), spacing: HaloSpacing.regular)]
|
|
|
|
var body: some View {
|
|
Form {
|
|
Section {
|
|
LazyVGrid(columns: columns, spacing: HaloSpacing.regular) {
|
|
ForEach(AccentOption.palette) { option in
|
|
swatch(option)
|
|
}
|
|
}
|
|
.padding(.vertical, HaloSpacing.snug)
|
|
} header: {
|
|
Text("appearance.accent")
|
|
} footer: {
|
|
Text("appearance.accentExplanation")
|
|
}
|
|
|
|
// Die Kachelgröße steht bei der Darstellung und nicht bei der
|
|
// Startseite: sie gilt für Reihen **und** Mediathek, und es geht
|
|
// ums Aussehen, nicht um den Aufbau einer bestimmten Seite.
|
|
Section {
|
|
@Bindable var layout = layout
|
|
|
|
LabeledContent {
|
|
Text(layout.cardScale.formatted(.percent.precision(.fractionLength(0))))
|
|
.foregroundStyle(Color.haloTextSecondary)
|
|
.monospacedDigit()
|
|
} label: {
|
|
Text("appearance.cardScale")
|
|
}
|
|
Slider(
|
|
value: $layout.cardScale,
|
|
in: HomeLayoutSettings.cardScaleRange,
|
|
step: 0.1
|
|
)
|
|
.accessibilityLabel(Text("appearance.cardScale"))
|
|
} footer: {
|
|
Text("appearance.cardScaleExplanation")
|
|
}
|
|
.listRowBackground(Color.haloSurface)
|
|
|
|
Section {
|
|
Toggle("appearance.customColor", isOn: $showsCustomField.animation(.snappy))
|
|
|
|
if showsCustomField {
|
|
HStack {
|
|
TextField("appearance.hexPlaceholder", text: $customHex)
|
|
.haloPlainEntry()
|
|
.onSubmit(applyCustomColor)
|
|
|
|
Button("action.apply", action: applyCustomColor)
|
|
.disabled(RGB(string: customHex) == nil)
|
|
}
|
|
|
|
if !customHex.isEmpty, RGB(string: customHex) == nil {
|
|
Text("appearance.invalidHex")
|
|
.font(.haloCaption)
|
|
.foregroundStyle(Color.haloDestructive)
|
|
}
|
|
}
|
|
|
|
if theme.accentWasAdjusted {
|
|
// Ohne diesen Hinweis wirkt die Korrektur wie ein Fehler:
|
|
// die gewählte Farbe sieht auf dem Bildschirm heller aus
|
|
// als im Farbwähler, und niemand wüsste warum.
|
|
Label {
|
|
Text("appearance.adjusted \(theme.accent.hexString)")
|
|
.font(.haloCaption)
|
|
} icon: {
|
|
Image(systemName: "info.circle")
|
|
}
|
|
.foregroundStyle(Color.haloTextSecondary)
|
|
}
|
|
}
|
|
|
|
Section("appearance.preview") {
|
|
PreviewRow()
|
|
}
|
|
}
|
|
.haloForm()
|
|
.scrollContentBackground(.hidden)
|
|
.background(Color.haloCanvas)
|
|
.navigationTitle(Text("appearance.title"))
|
|
.haloInlineTitle()
|
|
.onAppear {
|
|
if theme.selection.id == AccentOption.customIdentifier {
|
|
customHex = theme.selection.color.hexString
|
|
showsCustomField = true
|
|
}
|
|
}
|
|
}
|
|
|
|
private func swatch(_ option: AccentOption) -> some View {
|
|
Button {
|
|
theme.select(option)
|
|
} label: {
|
|
Circle()
|
|
.fill(option.color.swiftUIColor)
|
|
.frame(height: 44)
|
|
.overlay {
|
|
if theme.selection == option {
|
|
Image(systemName: "checkmark")
|
|
.font(.headline)
|
|
// Dunkel auf der Farbe, nicht weiß: die Palette
|
|
// enthält helle Töne wie Amber, auf denen Weiß
|
|
// verschwinden würde.
|
|
.foregroundStyle(Color.haloCanvas)
|
|
}
|
|
}
|
|
.overlay {
|
|
Circle()
|
|
.strokeBorder(
|
|
theme.selection == option ? Color.haloTextPrimary : .clear,
|
|
lineWidth: 2
|
|
)
|
|
.padding(-4)
|
|
}
|
|
}
|
|
.buttonStyle(.plain)
|
|
.accessibilityLabel(Text(option.name))
|
|
.accessibilityAddTraits(theme.selection == option ? [.isButton, .isSelected] : .isButton)
|
|
}
|
|
|
|
private func applyCustomColor() {
|
|
guard let color = RGB(string: customHex) else { return }
|
|
theme.select(.custom(color))
|
|
}
|
|
}
|
|
|
|
/// Zeigt die gewählte Farbe an den Stellen, an denen sie später auftaucht.
|
|
private struct PreviewRow: View {
|
|
@Environment(\.haloAccent) private var accent
|
|
|
|
var body: some View {
|
|
VStack(alignment: .leading, spacing: HaloSpacing.regular) {
|
|
HStack(spacing: HaloSpacing.regular) {
|
|
Label("hero.play", systemImage: "play.fill")
|
|
.font(.haloCardTitle)
|
|
.padding(.horizontal, HaloSpacing.loose)
|
|
.padding(.vertical, HaloSpacing.snug)
|
|
.background(accent, in: .rect(cornerRadius: HaloRadius.control))
|
|
.foregroundStyle(Color.haloCanvas)
|
|
|
|
Label("sidebar.downloads", systemImage: "arrow.down.circle")
|
|
.font(.haloCardTitle)
|
|
.foregroundStyle(accent)
|
|
}
|
|
|
|
WatchProgressBar(fraction: 0.45)
|
|
}
|
|
.padding(.vertical, HaloSpacing.snug)
|
|
.listRowBackground(Color.haloSurface)
|
|
}
|
|
}
|
|
|