Catalyst: ohne Netz, ohne Übersetzung, ohne Fenstergröße
Drei Fehler auf einmal, und alle drei meine. **Die App kam gar nicht ins Netz.** Ein Catalyst-Programm läuft in der Sandbox und braucht eine ausdrückliche Erlaubnis für ausgehende Verbindungen. Ohne sie gibt es keine Fehlermeldung — der Ladekreis dreht sich einfach für immer, und genau so sah es aus. **In der Seitenleiste standen Schlüssel statt Wörtern** — „sidebar.downloads" statt „Downloads". Ich hatte zwei Fassungen derselben Beschriftung gebaut, eine mit `LocalizedStringKey` und eine mit `String` für Titel, die vom Server kommen. Bei einem Literal darf Swift sich für beide entscheiden, und es entschied sich nicht überall gleich. Jetzt gibt es eine Fassung; wer einen fertigen Text hat, baut sein `Text` selbst. **Das Fenster öffnete wieder in Notizzettelgröße.** Meine Größenangabe hing an `os(macOS)` — unter Catalyst gilt aber `os(iOS)`, also griff sie nicht. Dort hängt die Größe ohnehin an der Szene, nicht am Fenster. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
f296d7ae1a
commit
39d9138911
@@ -191,7 +191,7 @@ struct RootView: View {
|
||||
) {
|
||||
mediaStack { LibraryView(library: library) }
|
||||
} label: {
|
||||
tabLabel(library.title, symbol: symbol(for: library.kind))
|
||||
sidebarLabel(Text(library.title), symbol: symbol(for: library.kind))
|
||||
}
|
||||
.customizationID("flixy.tab.library.\(library.id)")
|
||||
}
|
||||
@@ -292,22 +292,19 @@ struct RootView: View {
|
||||
#endif
|
||||
|
||||
/// Die Beschriftung eines Eintrags.
|
||||
///
|
||||
/// **Ein** Aufruf, nicht zwei. Es gab hier eine zweite Fassung für Titel,
|
||||
/// die vom Server kommen — mit `String` statt `LocalizedStringKey`. Swift
|
||||
/// darf sich bei einem Literal für beide entscheiden, und es entschied sich
|
||||
/// nicht überall gleich: in der Seitenleiste stand plötzlich
|
||||
/// „sidebar.downloads" statt „Downloads". Wer einen fertigen Text hat,
|
||||
/// baut sein `Text` jetzt selbst.
|
||||
private func tabLabel(_ title: LocalizedStringKey, symbol: String) -> some View {
|
||||
let label = Label(title, systemImage: symbol)
|
||||
#if os(macOS)
|
||||
return label.frame(
|
||||
minWidth: Self.sidebarWidth.min - 40,
|
||||
maxWidth: Self.sidebarWidth.max - 40,
|
||||
alignment: .leading
|
||||
)
|
||||
#else
|
||||
return label
|
||||
#endif
|
||||
sidebarLabel(Text(title), symbol: symbol)
|
||||
}
|
||||
|
||||
/// Dieselbe Beschriftung, wenn der Titel erst vom Server kommt.
|
||||
private func tabLabel(_ title: String, symbol: String) -> some View {
|
||||
let label = Label(title, systemImage: symbol)
|
||||
private func sidebarLabel(_ title: Text, symbol: String) -> some View {
|
||||
let label = Label { title } icon: { Image(systemName: symbol) }
|
||||
#if os(macOS)
|
||||
return label.frame(
|
||||
minWidth: Self.sidebarWidth.min - 40,
|
||||
|
||||
Reference in New Issue
Block a user