oficina / base Public

Apply copy review's second batch, and link the runner notes

Luna's batch 2: the Colophon's intro and its Licence label (British
spelling; the licences' own names keep theirs), and the Colophon's words
for Timeless Sans, DM Sans, KeyboardShortcuts and swift-cmark, which no
longer names Equipo (scripts/colophon.py, Colophon.json regenerated).

The norunner and oldrunner rewrites were rejected: the web's wording
stays, with its Markdown link. AskView.runnerNote now draws
[Finish setting it up]({equipo}) and [Update it]({equipo}) as real
links to Equipo, underlined, opening in the browser, and just the words
while Equipo's origin isn't known; a test holds it to a link attribute
and no brackets.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 1d7521d0d4983a091b299586938c4a3a67d01fd6 parent 23219b6
5 files changed, +50 −15
  • native/apple/Sources/BaseKit/Ask/AskView.swift +19 −5
  • native/apple/Sources/BaseKit/Resources/Colophon.json +4 −4
  • native/apple/Sources/BaseKit/Resources/Localizable.xcstrings +2 −2
  • native/apple/Tests/BaseKitTests/AskViewTests.swift +21 −0
  • native/scripts/colophon.py +4 −4
diff --git a/native/apple/Sources/BaseKit/Ask/AskView.swift b/native/apple/Sources/BaseKit/Ask/AskView.swift
index 00ba07e..f307079 100644
--- a/native/apple/Sources/BaseKit/Ask/AskView.swift
+++ b/native/apple/Sources/BaseKit/Ask/AskView.swift
@@ -87,11 +87,25 @@ public struct AskView: View {
.padding(.bottom, layout == .window ? 20 : 12)
}
- /// The web's note, its link to Equipo kept a link.
- private func runnerNote(_ key: String) -> AttributedString {
- let origin = model.equipoOrigin?.absoluteString ?? ""
- let text = BaseText.format(key, ["equipo": origin])
- guard var out = try? AttributedString(markdown: text) else { return AttributedString(text) }
+ private func runnerNote(_ key: String) -> AttributedString { Self.runnerNote(key, equipo: model.equipoOrigin) }
+
+ /// The web's note (norunner, oldrunner), its Markdown link to Equipo
+ /// drawn as a real link, underlined, that opens in the browser (the
+ /// environment's openURL); never as brackets. With no Equipo known yet
+ /// the words stay, without a link.
+ public static func runnerNote(_ key: String, equipo: URL?) -> AttributedString {
+ let raw = BaseText.text(key)
+ let text: String
+ if let equipo, BaseJSON.webURL(equipo.absoluteString) != nil {
+ text = raw.replacingOccurrences(of: "{equipo}", with: "<\(equipo.absoluteString)>")
+ } else {
+ // [words]({equipo}) → words
+ text = raw.replacingOccurrences(of: #"\[([^\]]*)\]\(\{equipo\}\)"#, with: "$1", options: .regularExpression)
+ }
+ let options = AttributedString.MarkdownParsingOptions(interpretedSyntax: .inlineOnlyPreservingWhitespace)
+ guard var out = try? AttributedString(markdown: text, options: options) else {
+ return AttributedString(text.replacingOccurrences(of: #"[\[\]]|\(<[^>]*>\)"#, with: "", options: .regularExpression))
+ }
for run in out.runs where run.link != nil { out[run.range].underlineStyle = .single }
return out
}
diff --git a/native/apple/Sources/BaseKit/Resources/Colophon.json b/native/apple/Sources/BaseKit/Resources/Colophon.json
index 1613595..c61f855 100644
--- a/native/apple/Sources/BaseKit/Resources/Colophon.json
+++ b/native/apple/Sources/BaseKit/Resources/Colophon.json
@@ -6,7 +6,7 @@
{
"id": "dm-sans",
"name": "DM Sans",
- "blurb": "A geometric sans serif by Colophon Foundry for DeepMind, drawn for text at small sizes.",
+ "blurb": "A sans serif typeface made by Colophon Foundry for DeepMind, designed to stay clear at small sizes.",
"usage": "The face Base falls back to where Timeless Sans isn't bundled.",
"author": "The DM Sans Project Authors",
"licence": {
@@ -20,7 +20,7 @@
{
"id": "timeless-sans",
"name": "Timeless Sans",
- "blurb": "A sans serif by Timeless with two cuts on one axis: Grotesk for headings and Sans for text.",
+ "blurb": "A sans serif typeface by Timeless, with two styles: Grotesk for headings and Sans for text.",
"usage": "Base's typeface, as on the web.",
"author": "Timeless",
"licence": {
@@ -39,7 +39,7 @@
{
"id": "keyboardshortcuts",
"name": "KeyboardShortcuts",
- "blurb": "A Swift package for global keyboard shortcuts on the Mac, with a recorder for people to choose their own.",
+ "blurb": "A Swift package for Mac keyboard shortcuts, with a recorder so you can choose your own.",
"usage": "The Mac app's shortcut for Ask Base.",
"author": "Sindre Sorhus",
"licence": {
@@ -88,7 +88,7 @@
"id": "swift-cmark",
"name": "swift-cmark",
"blurb": "GitHub's CommonMark parser in C, packaged for Swift.",
- "usage": "Reads the Assistant's replies, as Equipo's apps do.",
+ "usage": "Formats the Assistant's replies.",
"author": "John MacFarlane, GitHub and others",
"licence": {
"spdx": "BSD-2-Clause",
diff --git a/native/apple/Sources/BaseKit/Resources/Localizable.xcstrings b/native/apple/Sources/BaseKit/Resources/Localizable.xcstrings
index 65c5f94..574e530 100644
--- a/native/apple/Sources/BaseKit/Resources/Localizable.xcstrings
+++ b/native/apple/Sources/BaseKit/Resources/Localizable.xcstrings
@@ -548,7 +548,7 @@
"en": {
"stringUnit": {
"state": "translated",
- "value": "Base is made with other people’s open-source work and typefaces. This is all of it: what each piece is, what the app uses it for, who made it and the license it is under."
+ "value": "Base uses open-source software and typefaces made by others. This list names each one, explains what it does, and links to its source and licence."
}
}
}
@@ -560,7 +560,7 @@
"en": {
"stringUnit": {
"state": "translated",
- "value": "License"
+ "value": "Licence"
}
}
}
diff --git a/native/apple/Tests/BaseKitTests/AskViewTests.swift b/native/apple/Tests/BaseKitTests/AskViewTests.swift
index 4ab968a..6acfb8e 100644
--- a/native/apple/Tests/BaseKitTests/AskViewTests.swift
+++ b/native/apple/Tests/BaseKitTests/AskViewTests.swift
@@ -55,3 +55,24 @@ extension AskViewTests {
XCTAssertEqual(BaseText.text("native.ask.not_linked.button"), "Set up Ask Base on the web")
}
}
+
+extension AskViewTests {
+ /// The web's norunner and oldrunner notes keep their Markdown link, and
+ /// the app draws it as a link to Equipo, never as brackets.
+ func testTheRunnerNotesLinkToEquipo() throws {
+ let equipo = URL(string: "https://equipo.fennel.example")!
+ for (key, words) in [("ask.norunner", "Finish setting it up"), ("ask.oldrunner", "Update it")] {
+ XCTAssertTrue(BaseText.text(key).contains("[\(words)]({equipo})"), "the catalog keeps the web's link")
+ let note = AskView.runnerNote(key, equipo: equipo)
+ let plain = String(note.characters)
+ XCTAssertFalse(plain.contains("[") || plain.contains("]") || plain.contains("("), plain)
+ let links = note.runs.compactMap { run in run.link.map { (String(note[run.range].characters), $0) } }
+ XCTAssertEqual(links.count, 1, plain)
+ XCTAssertEqual(links.first?.0, words)
+ XCTAssertEqual(links.first?.1.host, "equipo.fennel.example")
+ let unlinked = String(AskView.runnerNote(key, equipo: nil).characters)
+ XCTAssertFalse(unlinked.contains("[") || unlinked.contains("{"), unlinked)
+ XCTAssertTrue(unlinked.contains(words))
+ }
+ }
+}
diff --git a/native/scripts/colophon.py b/native/scripts/colophon.py
index ef55075..260b8f0 100755
--- a/native/scripts/colophon.py
+++ b/native/scripts/colophon.py
@@ -34,26 +34,26 @@ def from_estilo(id, usage, licence_file):
EXTRA = [
{"section": "typefaces", "id": "timeless-sans", "name": "Timeless Sans",
- "blurb": "A sans serif by Timeless with two cuts on one axis: Grotesk for headings and Sans for text.",
+ "blurb": "A sans serif typeface by Timeless, with two styles: Grotesk for headings and Sans for text.",
"usage": "Base's typeface, as on the web.", "author": "Timeless",
"licence": {"spdx": "LicenseRef-Timeless-Free-Font-1.2", "name": "Timeless Free Font License 1.2"},
"home": "https://timeless.co/", "source": "https://media.timeless.co/type/Timeless-Type-Family-1.094.zip",
"licenceText": "The Timeless Free Font License 1.2 comes with the fonts as LICENSE.pdf, in the family's download above."},
{"section": "typefaces", "id": "dm-sans", "name": "DM Sans",
- "blurb": "A geometric sans serif by Colophon Foundry for DeepMind, drawn for text at small sizes.",
+ "blurb": "A sans serif typeface made by Colophon Foundry for DeepMind, designed to stay clear at small sizes.",
"usage": "The face Base falls back to where Timeless Sans isn't bundled.", "author": "The DM Sans Project Authors",
"licence": {"spdx": "OFL-1.1", "name": "SIL Open Font License 1.1"},
"home": "https://fonts.google.com/specimen/DM+Sans", "source": "https://github.com/googlefonts/dm-fonts",
"licenceText": text(repo / "internal/look/static/fonts/dm-sans/OFL.txt")},
{"section": "swift", "id": "keyboardshortcuts", "name": "KeyboardShortcuts",
- "blurb": "A Swift package for global keyboard shortcuts on the Mac, with a recorder for people to choose their own.",
+ "blurb": "A Swift package for Mac keyboard shortcuts, with a recorder so you can choose your own.",
"usage": "The Mac app's shortcut for Ask Base.", "author": "Sindre Sorhus",
"licence": {"spdx": "MIT", "name": "MIT License"},
"home": "https://github.com/sindresorhus/KeyboardShortcuts", "source": "https://github.com/sindresorhus/KeyboardShortcuts",
"licenceText": text(checkouts / "KeyboardShortcuts/license"), "platforms": ["mac"]},
{"section": "swift", "id": "swift-cmark", "name": "swift-cmark",
"blurb": "GitHub's CommonMark parser in C, packaged for Swift.",
- "usage": "Reads the Assistant's replies, as Equipo's apps do.", "author": "John MacFarlane, GitHub and others",
+ "usage": "Formats the Assistant's replies.", "author": "John MacFarlane, GitHub and others",
"licence": {"spdx": "BSD-2-Clause", "name": "BSD 2-Clause License"},
"home": "https://github.com/swiftlang/swift-cmark", "source": "https://github.com/swiftlang/swift-cmark",
"licenceText": text(checkouts / "swift-cmark/COPYING")},