feat(logs): the Logs page groups its logs under what a player looks for, in their language, with when each changed and its errors #357

Merged
HumanBean merged 4 commits from Jiro113/LongshotLauncher:journaux-colonne into main 2026-11-29 04:14:22 +00:00
Contributor

The Logs page's list doesn't tell a player which log to open after a problem: its entries describe files ("Build · latest session", "Launch · latest session"), stay in English whatever the launcher's language, come in the order the files were read, and look like action buttons.

What changed

  • Groups a player recognises (src/logbook.rs, SOURCES), each heading shown only when one of its logs exists:

    Group Name File
    LATEST GAME Game longshot_log.txt (selected build)
    Game launch last-launch.log
    Game update longshot_update.log (selected build)
    LAUNCHER Launcher (running) launcher.log
    Latest build last-build.log
    Play shortcut play.log
    EARLIER Game longshot_log.1.txt (selected build)
    Launcher launcher.1.log
    Play shortcut (older) play.1.log

    Why this grouping: after a crash or a bug in the game, the three logs of that run come first. The launcher's own work (this session, the last build, the desktop shortcut) comes next. The copies kept from before come last. play.1.log is not "the previous session": the shortcut appends to play.log and only rotates it when it reaches the size limit (src/diagnostics.rs), so it is named "older". The heading is EARLIER rather than "previous session" for the same reason. last-launch.log is the launcher's transcript of starting the game, so it sits with the game run.

  • Each row has a second line with how long ago the file changed (just now, 12 min ago, 2 h ago, yesterday, 4 days ago) and, when there are any, its error count in the error colour. Errors are counted with the viewer's own reader (entries::Reader), on the same last-MiB window the viewer shows, so the count matches what the ERROR filter lists. It is cached per file, size and change time, so clicking through the list doesn't parse the logs again; a log that can't be read shows no count and is tried again next time.

  • List rows instead of buttons (ui/logs.slint, LogItem): modelled on Settings' category rows. The selected row is filled with a gold dot, hover fills too, and the focus ring and Enter/Space come from Pressable, as for Settings' rows. A refresh that lists the same logs updates the rows in place instead of replacing the model, so the row that had focus isn't rebuilt. Rows are list-items with the selected state exposed to screen readers. A rule separates Open logs folder.

  • The viewer's title is the log's new name, with what tells it apart where the same name is in another group: Game · latest session and Game · previous session, Launcher · this session and Launcher · previous session. A log whose name is unique keeps it (Latest build).

  • Selection by file name. Logbook.sessions is now a LogSession model (ui/log-viewer.slint), and the selected row's key is its file name. selected() and refresh() look the log up by that key, not by its label, so a translation or a rename cannot lose it. When a log appears above the selected one, the selection follows the file instead of the row index. available() still returns each log's path, now with its Source; Save all logs (#354) names each log in index.txt by its English title.

  • Translations: every new string is in the 12 catalogs (fr-CA and es-419 take fr and es). The plural catalog objects aren't read by i18n::lookup, so counts use forms without agreement where a language needs one (ru Ошибок: {0}, pl Błędy: {0}, {0} дн. назад). The unused LOCAL SESSIONS is removed. Since the list now shows the word Launcher on its own, the catalogs say it the same way everywhere: Spanish lanzador (was Lancero, lancero and LANCER), Korean 런처 (was 래처 in seven strings), and Italian Lanciatore as Settings already said.

  • The catalog check fails on main (scripts/translations.py on e88e38e: ko: missing 2 messages): #353 added Needs an update and Add Longshot Launcher to Steam without Korean, Polish and Traditional Chinese, which stopped tests/test_launcher_core.py before the Rust tests. A separate commit adds them (my translations, not reviewed by a native speaker).

  • The page fits the window again: LogsPage had width: 100%; height: 100%, which made it as tall as the whole window under the title bar. The bottom of the page was cut off at 1280×800, hiding Open logs folder and STORED ON THIS PC (see the before screenshots). It now sizes like the Settings page.

  • Rebased on #354: Save all logs and its hint stay between the title and the list, and replace the old LOCAL SESSIONS heading.

Screenshots

At 1280×800, from a launcher home made for them (a fake build and synthetic logs, no real ones).

Before (main e88e38e) After
French Before, French After, French
English Before, English After, English

Another log selected (Dernière compilation):

After, French, another log selected

Testing

  • On Windows 11, by hand, at 1280×800: the French list shows French names, headings and times, 2 erreurs on the game log and 1 erreur on the build log, which matches the two ERROR lines the viewer lists. A log that doesn't exist isn't listed (play.1.log here), and Open logs folder is visible at the bottom. Selecting Dernière compilation (through Logbook.select, as a click does) fills that row, titles the viewer Dernière compilation and shows its one ERROR line.
  • New Rust tests in src/logbook.rs: the order and the headings with every log present; hidden logs and an emptied group; a launcher home without a selected build; every name, title and heading translated in French; the relative times, including a clock set back; each row's time, error count and title; the error count matching the ERROR filter, counted again when only the change time moves, and not cached for an unreadable log; the time boundaries at one minute, one hour and one day; and the selection following the file when a log appears above it.
  • cargo fmt --check, locked Clippy with -D warnings, scripts/translations.py (15 catalogs), check_interface_glyphs, and all 46 Tooling release tests (test_release.py) passed.
  • cargo test --locked: 195 passed, 3 ignored, 20 failed. The same 20 fail on main (e88e38e) on this PC, compared by test name (188 passed there): folders, versions, registry, recovery, prune, Steam library, home, storage and release-fixture tests. This PR touches none of them.

Not checked: the other ten languages on screen (the catalogs pass the validator; the strings are short); widths narrower than 1280 px (the error count now elides like the time); hover, the focus ring and Enter/Space by hand, and focus staying on a row after Enter; a screen reader on the new rows.

Risks

Small and local to the Logs page. The error count reads at most 1 MiB per log, once per change of the file. Launcher (running) changes on every refresh because the launcher keeps writing to it, so it is read again each time.

🤖 Generated with Claude Code

The Logs page's list doesn't tell a player which log to open after a problem: its entries describe files ("Build · latest session", "Launch · latest session"), stay in English whatever the launcher's language, come in the order the files were read, and look like action buttons. ## What changed - **Groups a player recognises** (`src/logbook.rs`, `SOURCES`), each heading shown only when one of its logs exists: | Group | Name | File | |---|---|---| | LATEST GAME | Game | `longshot_log.txt` (selected build) | | | Game launch | `last-launch.log` | | | Game update | `longshot_update.log` (selected build) | | LAUNCHER | Launcher (running) | `launcher.log` | | | Latest build | `last-build.log` | | | Play shortcut | `play.log` | | EARLIER | Game | `longshot_log.1.txt` (selected build) | | | Launcher | `launcher.1.log` | | | Play shortcut (older) | `play.1.log` | Why this grouping: after a crash or a bug in the game, the three logs of that run come first. The launcher's own work (this session, the last build, the desktop shortcut) comes next. The copies kept from before come last. `play.1.log` is not "the previous session": the shortcut appends to `play.log` and only rotates it when it reaches the size limit (`src/diagnostics.rs`), so it is named "older". The heading is **EARLIER** rather than "previous session" for the same reason. `last-launch.log` is the launcher's transcript of starting the game, so it sits with the game run. - **Each row has a second line** with how long ago the file changed (*just now*, *12 min ago*, *2 h ago*, *yesterday*, *4 days ago*) and, when there are any, its error count in the error colour. Errors are counted with the viewer's own reader (`entries::Reader`), on the same last-MiB window the viewer shows, so the count matches what the ERROR filter lists. It is cached per file, size and change time, so clicking through the list doesn't parse the logs again; a log that can't be read shows no count and is tried again next time. - **List rows instead of buttons** (`ui/logs.slint`, `LogItem`): modelled on Settings' category rows. The selected row is filled with a gold dot, hover fills too, and the focus ring and Enter/Space come from `Pressable`, as for Settings' rows. A refresh that lists the same logs updates the rows in place instead of replacing the model, so the row that had focus isn't rebuilt. Rows are `list-item`s with the selected state exposed to screen readers. A rule separates *Open logs folder*. - **The viewer's title** is the log's new name, with what tells it apart where the same name is in another group: *Game · latest session* and *Game · previous session*, *Launcher · this session* and *Launcher · previous session*. A log whose name is unique keeps it (*Latest build*). - **Selection by file name.** `Logbook.sessions` is now a `LogSession` model (`ui/log-viewer.slint`), and the selected row's `key` is its file name. `selected()` and `refresh()` look the log up by that key, not by its label, so a translation or a rename cannot lose it. When a log appears above the selected one, the selection follows the file instead of the row index. `available()` still returns each log's path, now with its `Source`; *Save all logs* (#354) names each log in `index.txt` by its English title. - **Translations**: every new string is in the 12 catalogs (fr-CA and es-419 take fr and es). The plural catalog objects aren't read by `i18n::lookup`, so counts use forms without agreement where a language needs one (ru *Ошибок: {0}*, pl *Błędy: {0}*, *{0} дн. назад*). The unused *LOCAL SESSIONS* is removed. Since the list now shows the word *Launcher* on its own, the catalogs say it the same way everywhere: Spanish *lanzador* (was *Lancero*, *lancero* and *LANCER*), Korean *런처* (was *래처* in seven strings), and Italian *Lanciatore* as Settings already said. - **The catalog check fails on `main`** (`scripts/translations.py` on e88e38e: *ko: missing 2 messages*): #353 added *Needs an update* and *Add Longshot Launcher to Steam* without Korean, Polish and Traditional Chinese, which stopped `tests/test_launcher_core.py` before the Rust tests. A separate commit adds them (my translations, not reviewed by a native speaker). - **The page fits the window again**: `LogsPage` had `width: 100%; height: 100%`, which made it as tall as the whole window under the title bar. The bottom of the page was cut off at 1280×800, hiding *Open logs folder* and *STORED ON THIS PC* (see the *before* screenshots). It now sizes like the Settings page. - Rebased on #354: *Save all logs* and its hint stay between the title and the list, and replace the old *LOCAL SESSIONS* heading. ## Screenshots At 1280×800, from a launcher home made for them (a fake build and synthetic logs, no real ones). | | Before (`main` e88e38e) | After | |---|---|---| | French | ![Before, French](https://git.magicbean.dev/attachments/79697d76-d7bb-4c1d-885e-402a3cef3d4e) | ![After, French](https://git.magicbean.dev/attachments/9d189bfb-cf86-431f-aa3d-1d4d5f95237d) | | English | ![Before, English](https://git.magicbean.dev/attachments/553c1dd3-975d-4641-9677-29e3182b9261) | ![After, English](https://git.magicbean.dev/attachments/a468b358-441e-407c-adb2-31ecc3800651) | Another log selected (*Dernière compilation*): ![After, French, another log selected](https://git.magicbean.dev/attachments/76660f2b-b41f-41ea-8c18-e0c49e754760) ## Testing - **On Windows 11, by hand**, at 1280×800: the French list shows French names, headings and times, *2 erreurs* on the game log and *1 erreur* on the build log, which matches the two ERROR lines the viewer lists. A log that doesn't exist isn't listed (`play.1.log` here), and *Open logs folder* is visible at the bottom. Selecting *Dernière compilation* (through `Logbook.select`, as a click does) fills that row, titles the viewer *Dernière compilation* and shows its one ERROR line. - New Rust tests in `src/logbook.rs`: the order and the headings with every log present; hidden logs and an emptied group; a launcher home without a selected build; every name, title and heading translated in French; the relative times, including a clock set back; each row's time, error count and title; the error count matching the ERROR filter, counted again when only the change time moves, and not cached for an unreadable log; the time boundaries at one minute, one hour and one day; and the selection following the file when a log appears above it. - `cargo fmt --check`, locked Clippy with `-D warnings`, `scripts/translations.py` (15 catalogs), `check_interface_glyphs`, and all 46 Tooling release tests (`test_release.py`) passed. - `cargo test --locked`: 195 passed, 3 ignored, 20 failed. The same 20 fail on `main` (e88e38e) on this PC, compared by test name (188 passed there): folders, versions, registry, recovery, prune, Steam library, home, storage and release-fixture tests. This PR touches none of them. **Not checked:** the other ten languages on screen (the catalogs pass the validator; the strings are short); widths narrower than 1280 px (the error count now elides like the time); hover, the focus ring and Enter/Space by hand, and focus staying on a row after Enter; a screen reader on the new rows. ## Risks Small and local to the Logs page. The error count reads at most 1 MiB per log, once per change of the file. *Launcher (running)* changes on every refresh because the launcher keeps writing to it, so it is read again each time. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The sidebar listed file descriptions ("Build · latest session") in English
whatever the language, in the order they were read, as action buttons. It
now groups them under LATEST GAME, LAUNCHER and EARLIER with short names,
shows each log's age and error count under its name, and draws them as
list rows. The selection is kept by file name, and the page no longer runs
past the bottom of the window, which hid "Open logs folder".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Spanish said "lancero" or "LANCER" in three strings, and Korean "래처" in
six; the Logs page now shows the word on its own next to the new strings.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
fix(i18n): Korean, Polish and Traditional Chinese have the two strings #353 added, so the catalog check passes again
Some checks failed
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (actionlint, ShellCheck, gitleaks) (pull_request) Has been cancelled
CI / Rust formatting, lint and tests (pull_request) Has been cancelled
CI / Release packages and stable upgrades (pull_request) Has been cancelled
PR title / Conventional Commit title (pull_request) Has been cancelled
df19790a37
"Needs an update" and "Add Longshot Launcher to Steam" were missing from
ko, pl and zh-Hant on main, which stops tests/test_launcher_core.py at the
catalog check before the Rust tests run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Contributor

Screenshots at 1280×800, from a launcher home made for them (a fake build and synthetic logs, no real ones).

French — before (main e88e38e): file names in English, button-like rows, and the bottom of the page cut off.

Before, French

French — after

After, French

French — after, another log selected (Dernière compilation: its row filled, the viewer titled with it, its one ERROR line)

After, French, another log selected

English — before

Before, English

English — after

After, English

Screenshots at 1280×800, from a launcher home made for them (a fake build and synthetic logs, no real ones). **French — before** (`main` e88e38e): file names in English, button-like rows, and the bottom of the page cut off. ![Before, French](https://git.magicbean.dev/attachments/79697d76-d7bb-4c1d-885e-402a3cef3d4e) **French — after** ![After, French](https://git.magicbean.dev/attachments/9d189bfb-cf86-431f-aa3d-1d4d5f95237d) **French — after, another log selected** (*Dernière compilation*: its row filled, the viewer titled with it, its one ERROR line) ![After, French, another log selected](https://git.magicbean.dev/attachments/76660f2b-b41f-41ea-8c18-e0c49e754760) **English — before** ![Before, English](https://git.magicbean.dev/attachments/553c1dd3-975d-4641-9677-29e3182b9261) **English — after** ![After, English](https://git.magicbean.dev/attachments/a468b358-441e-407c-adb2-31ecc3800651)
fix(logs): increase spacing around the log export section
Some checks failed
CI / What the change needs (pull_request) Successful in 5s
CI / Lint (actionlint, ShellCheck, gitleaks) (pull_request) Successful in 10s
PR title / Conventional Commit title (pull_request) Successful in 4s
CI / Rust formatting, lint and tests (pull_request) Has been cancelled
CI / Release packages and stable upgrades (pull_request) Has been cancelled
edda991134
Owner

Added 8 px above Save all logs and below the bug-report hint.

Updated Logs sidebar

Added 8 px above **Save all logs** and below the bug-report hint. ![Updated Logs sidebar](https://git.magicbean.dev/attachments/16dfe6f7-b71f-4a3c-9639-029102ef1498)
HumanBean force-pushed journaux-colonne from edda991134
Some checks failed
CI / What the change needs (pull_request) Successful in 5s
CI / Lint (actionlint, ShellCheck, gitleaks) (pull_request) Successful in 10s
PR title / Conventional Commit title (pull_request) Successful in 4s
CI / Rust formatting, lint and tests (pull_request) Has been cancelled
CI / Release packages and stable upgrades (pull_request) Has been cancelled
to 3d244df882
Some checks failed
CI / What the change needs (pull_request) Successful in 5s
PR title / Conventional Commit title (pull_request) Successful in 6s
CI / Lint (actionlint, ShellCheck, gitleaks) (pull_request) Successful in 10s
CI / Release packages and stable upgrades (pull_request) Failing after 1m33s
CI / Rust formatting, lint and tests (pull_request) Successful in 12m15s
2026-11-29 03:56:39 +00:00
Compare
HumanBean deleted branch journaux-colonne 2026-11-29 04:14:23 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/LongshotLauncher!357
No description provided.