Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ jobs:
- uses: actions/checkout@v4
- uses: jdx/mise-action@v3
- run: ./swiftformat --lint
# Catalogs drift out of Xcode's serialization the moment one is written by
# anything but Xcode, and the cost lands on whoever next builds in the IDE
# (see "Formatting" in AGENTS.md). This rides along in the format job
# rather than a job of its own because branch protection pins the two
# check names.
- name: String Catalog lint
run: ./xcstrings --lint

test:
name: Build & Test (iOS)
Expand Down
12 changes: 10 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ Xcode project](#generating-the-xcode-project)). A fresh machine needs `./ide
generating; plain `./ide` fails fast pointing at it.

The executables in the repo root are the dev scripts — `ide`, `swiftformat`,
`sync-agents`, `profile`, `icons`, `flaky`, `simulator` — and each takes
`--help`. Reach for one rather than hand-rolling its job: `icons` and
`sync-agents`, `profile`, `icons`, `flaky`, `simulator`, `xcstrings` — and each
takes `--help`. Reach for one rather than hand-rolling its job: `icons` and
`simulator` in particular own state that is easy to corrupt by hand (see
[Managing app icons](#managing-app-icons) and [Selecting a
simulator](#selecting-a-simulator--address-it-by-udid-not-name)).
Expand All @@ -66,6 +66,14 @@ Run `./ide --no-open` after adding one.
format the tree, or `./swiftformat --lint` to check only (as in CI).
- The pre-commit hook (enabled by `./ide` via `core.hooksPath`) formats staged
`*.swift` files in place and re-stages them.
- **String Catalogs are stored exactly as Xcode serializes them**, and
`./xcstrings` (`--lint` in CI) enforces it. Xcode rewrites a `.xcstrings` in
place during an *IDE* build whenever extraction finds a key the catalog
lacks — writing the entire file with its own serializer — so a catalog
written by anything else (a migration script's `json.dump`, a hand edit)
parses fine but turns the next build into thousands of lines of whitespace
churn around the one real entry. Write a catalog through Xcode, or normalize
it afterwards; the script only touches formatting, never content.

## Agent instructions sync

Expand Down
5 changes: 4 additions & 1 deletion Shared/LifecycleKit/Sources/Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"sourceLanguage" : "en",
"strings" : {
"App content" : {

},
"failure.launch.retry" : {
"extractionState" : "manual",
"localizations" : {
Expand All @@ -25,4 +28,4 @@
}
},
"version" : "1.0"
}
}
10 changes: 10 additions & 0 deletions Where/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,16 @@ Add the key to the catalog as a **manual** entry first (so its symbol
generates), then reference `.thatSymbol` — never ship English literals in
SwiftUI `Text` or `errorDescription`, and never reintroduce a raw-key facade.

The catalogs also carry a few **auto-extracted** entries with no
`extractionState` and no value — `""`, `%lld`, an English literal from a
`#Preview`. Those are Xcode's, not ours: extraction picks up every string
literal that could be a key (`Marker("", …)`, `Text("\(count)")`), and an IDE
build re-adds any that's missing, so deleting one by hand just brings it back
with a full reserialization behind it. Remove the *source* literal if you want
the entry gone — interpolating an `Int` into `Text` is worth fixing anyway (it
skips `WhereFormat`'s number styling). Catalog files stay byte-identical to
Xcode's own serialization; see [Formatting](../AGENTS.md#formatting).

## Dates & presentation

- **A logical day is a `CalendarDay` (Y-M-D), not a `Date`.** It is the
Expand Down
2 changes: 1 addition & 1 deletion Where/RegionKit/Sources/Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@
}
},
"version" : "1.0"
}
}
1 change: 1 addition & 0 deletions Where/TODOs.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ This feels like it might result in a cleaner "pipeline-esque" code layout, and a
- Move `let calendar = Calendar.current` into a var on the controller? There’s a few of these
- Move test only code behind @_spi
- Add comments to strings in xcstrings files
- fix: Four literals in source get auto-extracted into the catalogs as value-less entries, which is why an IDE build had anything to write back at all (see the serialization normalization PR). They're committed as Xcode writes them; removing an entry for good means removing the literal. `Marker("", coordinate:)` in `RecordedPointsMap` produces the empty `""` key (an unlabeled dev-map pin — `Annotation` with an explicit accessibility label would say what it means); `Text("\(group.outlineCount)")` in `RegionMapView` and `Text("\(day.dayOfMonth)")` in `CalendarContentView` produce `%lld` and bypass `WhereFormat`'s number styling; and a `Button("Log today here")` in an `IntentSnippets` `#Preview` hardcodes copy the `snippet.logTodayHere` symbol already owns. `App content` comes from a `LifecycleContainer` `#Preview` in LifecycleKit.

# Completed issues

Expand Down
2 changes: 1 addition & 1 deletion Where/WhereCore/Sources/Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,4 @@
}
},
"version" : "1.0"
}
}
Loading
Loading