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
No reviewers
Labels
No labels
area/build
area/install
area/mods
area/saves
area/tooling
area/ui
area/updates
ci: approved
good first issue
gpu/amd
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
platform/linux
platform/steam-deck
platform/windows
priority
critical
priority
high
priority
low
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/LongshotLauncher!357
Loading…
Reference in a new issue
No description provided.
Delete branch "Jiro113/LongshotLauncher:journaux-colonne"
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?
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:longshot_log.txt(selected build)last-launch.loglongshot_update.log(selected build)launcher.loglast-build.logplay.loglongshot_log.1.txt(selected build)launcher.1.logplay.1.logWhy 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.logis not "the previous session": the shortcut appends toplay.logand 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.logis 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 fromPressable, 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 arelist-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.sessionsis now aLogSessionmodel (ui/log-viewer.slint), and the selected row'skeyis its file name.selected()andrefresh()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 itsSource; Save all logs (#354) names each log inindex.txtby 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.pyone88e38e: ko: missing 2 messages): #353 added Needs an update and Add Longshot Launcher to Steam without Korean, Polish and Traditional Chinese, which stoppedtests/test_launcher_core.pybefore the Rust tests. A separate commit adds them (my translations, not reviewed by a native speaker).The page fits the window again:
LogsPagehadwidth: 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).
maine88e38e)Another log selected (Dernière compilation):
Testing
play.1.loghere), and Open logs folder is visible at the bottom. Selecting Dernière compilation (throughLogbook.select, as a click does) fills that row, titles the viewer Dernière compilation and shows its one ERROR line.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 onmain(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 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]>Screenshots at 1280×800, from a launcher home made for them (a fake build and synthetic logs, no real ones).
French — before (
maine88e38e): file names in English, button-like rows, and the bottom of the page cut off.French — after
French — after, another log selected (Dernière compilation: its row filled, the viewer titled with it, its one ERROR line)
English — before
English — after
Added 8 px above Save all logs and below the bug-report hint.
edda9911343d244df882