Ship the Share fonts and the design system's strings inside FjordDesignSystem (GRD-486) #4
Loading…
Reference in a new issue
No description provided.
Delete branch "stephen/grd-486-fonts-strings"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
GRD-486. The design system no longer needs its host to supply the Share font or its own strings.
Fonts/OFL.txt) live inFjordDesignSystem.FjordFonts.register()registers them with CoreText for the process the first time the theme builds a font (FontFamily.regularFontNameandboldFontNamecall it), so noUIAppFontsentry and no copy of the files in the app, and an app extension gets them too. A host that still lists them getsalreadyRegistered, which is ignored.Theme.Typography.fontFamily = .systemstill selects the system font.Resources/Localizable.xcstrings: 22 keys in the 11 shipped languages, copied from fjord-ios's catalog with their translations and comments (error alert defaults, "Loading", the stale-data sentences, "Cached data", "Refresh", "now", the appearance and accent names, "Fjord"). They resolve in the module bundle:Text(..., bundle: .module),String(localized:bundle:), andLocalizedStringResourcefor the appearance and accent names.Package.swiftgetsdefaultLocalization: "en"and the resources. ALocalizedStringKeya host passes in still resolves in the host.errorAlert(title:buttonTitle:)take optional keys (nil uses the module's text); callers that pass a key are unchanged.FjordLogotakes anaccessibilityLabelso an app can name itself.Breaking? No source break for hosts. A host that keeps its own copies keeps working; fjord-ios drops its copies in the adoption PR after the 0.3.0 tag.
Known edge cases (follow-up):
LocalizedStringResourcecapturesLocale.currentwhen created, so the accent swatch names (astatic let) do not follow an in-process locale change; the app does not change locale in process. A missing font file would log a fault and fall back to the system font; the files ship in the package and a test registers them.Automated Codex review (read-only) of head
31c14067ce.Low
Sources/FjordDesignSystem/FjordFonts.swift:35. Invariant: a host that already provides the Share fonts must see no failure (the PR body: "A host that keeps its own copies keeps working"). Only error code 105 (alreadyRegistered) is filtered out. I could not run CoreText here, so I am relying on my recollection that a same-named font from a different file URL returnsduplicatedName(305), not 105. If so, fjord-ios will hit it. The PR says fjord-ios keeps its ownUIAppFontscopies until the adoption PR, and those are different files from the module's. Scenario: on first theme build,registerAll()gets 305 for each of the four files. It logs fourlog.errorlines andregister()returns false. The fonts still work through the host's copies, so the impact is log noise and a misleading false return. Fix: also ignoreCTFontManagerError.duplicatedName, or treat the batch as successful whenUIFont(name:size:)already resolves every name. Run on a device withUIAppFontsset to confirm the code.Low
Tests/FjordDesignSystemTests/FjordDesignSystemTests.swift:41-58. Standards item 13 (tests test the claim).testRegisteringTwiceIsHarmlessonly reads the cachedstatic let registered, so it never calls CoreText a second time. It would pass with thealreadyRegisteredfilter deleted. The host-lists-the-fonts path the README and PR body promise has no test. Fix: callCTFontManagerRegisterFontsForURLson the same URLs first, then check thatregister()still returns true. Better, factorregisterAllso a test can call it twice. The string tests also cover only four keys, in German. A key typo at a call site, such asModuleStrings.resource("Tealz")or a changedTextkey, silently shows English and no test fails. Fix: add a test that resolves every call-site key through thedebundle.Low (edge case, unclaimed behavior change)
ErrorAlert.swift,HarborLoaders.swift,Theme.swift,FjordLogo.swift. Default strings used to resolve in the host's catalog and now resolve in the module's. A host with its own wording for "Loading", "OK" or "System", or its own extra languages, is silently overridden. A host that localizes into fewer languages than the module's 11 will show module-language text on devices set to those languages. The PR body says the sources are compatible but does not mention this. It is acceptable for fjord-ios, which copied the catalog. Add one line to the README.Low (known deferral) The accent swatch names are a
static letofLocalizedStringResource, which captures the locale at creation. The PR body already lists this as an accepted edge case, and the diff gives no new evidence against it.Process note: the PR body has no "Failure paths" or "Fix scope" section as the standards ask. This is not a code defect.
BLOCKING: 0
Reviewed head
31c14067ceat 2026-11-19T03:22:06Z by claude -p, read-only tools (Codex unavailable).Automated Codex review (read-only) of head
659372d321.Low
Sources/FjordDesignSystem/FjordFonts.swift:34. Invariant: the PR says "a host that keeps its own copies keeps working" and that a host still listing the files getsalreadyRegistered, which is ignored.alreadyRegisteredcode (the same file URL registered again) is tolerated. A host app that bundles its ownShare-*.ttfand lists them inUIAppFontshas those fonts registered from a different URL. I'm going from memory here: CoreText returns a different code for that case, probablyduplicatedName. I didn't check it, and no test covers it.register()returnsfalse,log.errorfires for each of the four fonts, and the failed result is cached inregistered. Rendering still works through the host's copies, so the impact is log noise and a misleadingfalsefor anyone who checks the return value.UIFont(name:size:)already resolves the name. Say which case is covered in the PR body.Low
Sources/FjordDesignSystem/Theme.swift:113. Invariant: copy matches behavior (standards item 11).UIAppFontsin project.yml". Both claims are now false. The fonts live inFonts/inside the package and register themselves.UIAppFontsentry or a copy of the files, which is exactly what the PR removes.FjordFonts.Low
Tests/FjordDesignSystemTests/FjordDesignSystemTests.swift:57. Invariant: tests test the claim (standards item 13).de.lprojand that four keys are translated there. They do not prove the views resolve through.module. Nothing exerciseserrorAlert's nil-title fallback,FjordLogo's default label,Theme.Appearance.localizedLabel, the accent preset names,SharedFormatters.relativeorStaleCue. Nothing checks that the 22 keys in the catalog match the keys used in code.bundle: .modulefrom one call site, or renames a key without updating the catalog. The strings silently fall back to the host's catalog or to the English key, and every test stays green.localizedLabel,StaleCueandspokenLabel. Also assert that the catalog's key set equals the keys the code uses.Low
Package.swift:4. Invariant: the title and body claim all behavior changes.//header comment became///. That is unrelated churn, and it attaches a doc comment tolet package.Edge case, already deferred in the PR body and not re-raised as blocking: the accent swatch names capture
Locale.currentwhen thestatic letis created. The deferred missing-font fallback is also unchanged.I found no high or medium issues. The catalog has all 22 keys, every module-owned literal I could find now resolves through
.module, and the newerrorAlertandFjordLogoparameters are source-compatible.BLOCKING: 0
Reviewed head
659372d321at 2026-11-19T03:27:05Z by claude -p, read-only tools (Codex unavailable).Automated Codex review (read-only) of head
3cb8d8c4d9.No high or medium findings. I read the diff and the call sites but did not build it or run the tests. I checked the font and string paths against
~/fleet-week/STANDARDS.md.Low
Tests/FjordDesignSystemTests/FjordDesignSystemTests.swift:52(standard 13, tests test the claim).testRegisteringTwiceIsHarmlessdoes not exercise the second-registration path.FjordFonts.registeredis astatic let, so the secondregister()returns the cachedBooland never calls CoreText. The benignalreadyRegisteredandduplicatedNamefilter inFjordFonts.swift:34is therefore untested. That filter is what keeps a host that still lists the fonts inUIAppFontsworking. Fix: factorregisterAll()so a test can call it directly twice, or register the four URLs withCTFontManagerRegisterFontsForURLsfirst and then assertregisterAll()still returns true.Low PR body (standards "Failure paths" and "Fix scope"). The body has no "Failure paths" section answering the applicable checklist items, and no "Fix scope" section. Items 4 (a failed font registration falls back to the system font, and
register()returns false and logs) and 13 apply, and the body covers them only in passing. Fix: add the two short sections. Process only; the code is fine.Low
Package.swift:4. The header comment changed from//to///, which attaches it as a doc comment tolet package. It is unrelated churn that the title and body do not mention. Revert it or note it.Low (edge case, already deferred in the PR body). The accent swatch
LocalizedStringResources are built once in astatic let, so they do not follow an in-process locale change. Nothing in the diff shows normal-operation impact, so I'm not re-raising it.I checked several things and found no problem:
Theme.swift:178,Theme.swift:221,FjordLogo.swift:69) goes throughregularFontNameorboldFontName, which callregister()first.%@interpolation keys.AccentColorPreset.namewas already aLocalizedStringResource, so the type change does not break callers.BLOCKING: 0
Reviewed head
3cb8d8c4d9at 2026-11-19T03:31:16Z by claude -p, read-only tools (Codex unavailable).