Add refresh to re-scan on-disk history (host CLIs + currently-running WSL distros)#344
Conversation
Add an F5 keybinding in the WTA session-management (Agents) view that
refetches the session list, and surface it in the footer hint.
- app.rs: F5 in the Agents view calls schedule_agents_refetch_for_tab
(no-ops when the view isn't primed and coalesces with an in-flight
fetch). Adds a unit test asserting F5 dispatches a sessions/list request.
- locales: append the "F5 <refresh>" segment to agents.footer_hint and add
"F5" to the {Locked} key-name list across all 89 locales. Translations
follow each locale's existing "Esc <exit>" style and the Microsoft term
for "Refresh". RTL and the three pseudo-locales keep their wrappers (the
segment is inserted before the closing paren); am-ET / lo-LA keep the
English placeholder their footer_hint currently uses.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds an F5 refresh affordance to the WTA session-management (Agents) TUI view so users can manually refetch the session list, and updates the localized footer hint accordingly across all locales.
Changes:
- Handle
KeyCode::F(5)in the Agents view by callingschedule_agents_refetch_for_tab. - Add a unit test ensuring F5 dispatches a
sessions/listrequest. - Update
agents.footer_hint(and its{Locked=...}key list) across all locale YAMLs to include “F5 to refresh” in each language’s existing style.
Reviewed changes
Copilot reviewed 90 out of 90 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tools/wta/src/app.rs | Add F5 handling for Agents view refresh + a unit test asserting SessionsList is dispatched. |
| tools/wta/locales/af-ZA.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/am-ET.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/ar-SA.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/as-IN.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/az-Latn-AZ.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/bg-BG.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/bn-IN.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/bs-Latn-BA.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/ca-Es-VALENCIA.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/ca-ES.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/cs-CZ.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/cy-GB.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/da-DK.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/de-DE.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/el-GR.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/en-GB.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/en-US.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/es-ES.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/es-MX.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/et-EE.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/eu-ES.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/fa-IR.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/fi-FI.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/fil-PH.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/fr-CA.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/fr-FR.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/ga-IE.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/gd-gb.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/gl-ES.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/gu-IN.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/he-IL.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/hi-IN.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/hr-HR.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/hu-HU.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/hy-AM.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/id-ID.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/is-IS.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/it-IT.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/ja-JP.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/ka-GE.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/kk-KZ.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/km-KH.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/kn-IN.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/ko-KR.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/kok-IN.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/lb-LU.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/lo-LA.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/lt-LT.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/lv-LV.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/mi-NZ.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/mk-MK.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/ml-IN.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/mr-IN.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/ms-MY.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/mt-MT.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/nb-NO.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/ne-NP.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/nl-NL.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/nn-NO.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/or-IN.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/pa-IN.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/pl-PL.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/pt-BR.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/pt-PT.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/qps-ploc.yml | Append localized “F5 refresh” segment to agents.footer_hint (pseudo-locale wrapper preserved) and lock F5. |
| tools/wta/locales/qps-ploca.yml | Append localized “F5 refresh” segment to agents.footer_hint (pseudo-locale wrapper preserved) and lock F5. |
| tools/wta/locales/qps-plocm.yml | Append localized “F5 refresh” segment to agents.footer_hint (pseudo-locale wrapper preserved) and lock F5. |
| tools/wta/locales/quz-PE.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/ro-RO.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/ru-RU.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/sk-SK.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/sl-SI.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/sq-AL.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/sr-Cyrl-BA.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/sr-Cyrl-RS.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/sr-Latn-RS.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/sv-SE.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/ta-IN.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/te-IN.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/th-TH.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/tr-TR.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/tt-RU.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/ug-CN.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/uk-UA.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/ur-PK.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/uz-Latn-UZ.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/vi-VN.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/zh-CN.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
| tools/wta/locales/zh-TW.yml | Append localized “F5 refresh” segment to agents.footer_hint and lock F5. |
@check-spelling-bot Report
|
| Dictionary | Entries | Covers | Uniquely |
|---|---|---|---|
| cspell:csharp/csharp.txt | 32 | 2 | 2 |
| cspell:aws/aws.txt | 232 | 2 | 2 |
| cspell:fonts/fonts.txt | 536 | 1 | 1 |
Consider adding to the extra_dictionaries array (in the .github/actions/spelling/config.json file):
"cspell:csharp/csharp.txt",
"cspell:aws/aws.txt",
"cspell:fonts/fonts.txt",
To stop checking additional dictionaries, put (in the .github/actions/spelling/config.json file):
"check_extra_dictionaries": []Warnings ⚠️ (1)
See the 📂 files view, the 📜action log, 👼 SARIF report, or 📝 job summary for details.
| Count | |
|---|---|
| 54 |
See
✏️ Contributor please read this
By default the command suggestion will generate a file named based on your commit. That's generally ok as long as you add the file to your commit. Someone can reorganize it later.
If the listed items are:
- ... misspelled, then please correct them instead of using the command.
- ... names, please add them to
.github/actions/spelling/allow/names.txt. - ... APIs, you can add them to a file in
.github/actions/spelling/allow/. - ... just things you're using, please add them to an appropriate file in
.github/actions/spelling/expect/. - ... tokens you only need in one place and shouldn't generally be used, you can add an item in an appropriate file in
.github/actions/spelling/patterns/.
See the README.md in each directory for more information.
🔬 You can test your commits without appending to a PR by creating a new branch with that extra change and pushing it to your fork. The check-spelling action will run in response to your push -- it doesn't require an open pull request. By using such a branch, you can limit the number of typos your peers see you make. 😉
If the flagged items are 🤯 false positives
If items relate to a ...
-
binary file (or some other file you wouldn't want to check at all).
Please add a file path to the
excludes.txtfile matching the containing file.File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.
^refers to the file's path from the root of the repository, so^README\.md$would exclude README.md (on whichever branch you're using). -
well-formed pattern.
If you can write a pattern that would match it,
try adding it to thepatterns.txtfile.Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.
Note that patterns can't match multiline strings.
Make F5 in the session-management (Agents) view reload the on-disk
historical session logs via master — the same `load_for_cli` scan the
startup history seed runs — instead of just re-listing master's cached
registry snapshot.
- Thread a `rescan` flag helper->master on `sessions/list`: F5 sets a
sticky `pending_rescan` (survives in-flight coalescing); the helper
forwards it; master, on rescan, runs `load_for_cli` off the LocalSet
(spawn_blocking), upserts the results into the registry, then answers.
A normal 5s poll / view-open / `wta sessions list` stay snapshot-only,
and legacy empty `{}` params deserialize as rescan=false.
- After a successful rescan, master broadcasts `sessions/changed` so every
window/tab with the view open refetches immediately (matching the
startup scan) rather than waiting up to 5s. The triggered refetches are
rescan=false, so they neither re-scan disk nor re-broadcast (no loop).
- Show the loading shimmer for the whole F5 refresh via a new
`rescan_in_flight` flag, so F5 has visible feedback even when the list
already has rows. A normal poll keeps it false and never flashes.
Adds unit tests for the rescan threading, the wire round-trip, and the
loading-during-rescan signal.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The WSL scan extracts all four CLIs' session files from the running distro into a temp $HOME-mirror, then parsed all four and discarded the non-selected ones via retain_wsl_cli. Since a master is single-CLI, that parsed (and threw away) up to three CLIs' transcripts on every scan. Move the filter ahead of the parse: load_all_in now takes a cli_filter and reuses cli_scan_flags (the host path's dispatch) to run only the selected CLI's loader, so the other CLIs' transcripts in the extracted mirror are never parsed. Thread cli_filter through scan_running_distros -> scan_distros -> scan_distro_with -> load_all_in and drop the now-redundant retain_wsl_cli. The tar/extract is unchanged (the fetch script still tars all four), so this saves only the parse cost, not the per-distro wsl.exe + tar/extract overhead. Behavior is preserved: None / custom agents still scan all four. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 99 out of 99 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
tools/wta/src/session_registry.rs:246
build_sessions_list_request(false)now serializes params as{ "rescan": false }instead of the historical empty{}. A pre-flag (older) master that still deserializesSessionsListParamsas an empty struct would reject this as an unknown field, breaking even the normal snapshot-only sessions/list path in mixed-version scenarios (e.g. during upgrade/rollback). Consider keeping the on-wire params{}whenrescan == false, and only include the field for the newrescan == truebehavior.
…mt-esc-restore # Conflicts: # tools/wta/src/app.rs
The F5 history rescan (and the startup history seed) upserted disk-loaded rows — status Historical, no pane binding — straight into master's registry. `upsert` is insert-or-replace, so a reloaded Historical row overwrote a live session's entry, dropping its status and pane binding; the session list then showed the open session as Historical. Add `SessionRegistry::upsert_if_absent` (atomic check-and-insert in InMemoryRegistry, lookup-then-upsert default on the trait) and use it in both the F5 rescan and the startup scan, so a reloaded row never replaces a session already in the registry. Titles still refresh for existing rows via the post-rescan `try_refresh_title_from_disk_with` pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds F5 to refresh the session list — re-scans on-disk history so sessions from a WSL distro that wasn't running at startup show up once it's running.

What
• F5 to refresh, localized across all 89 locales.How
F5 footer hint + localization
app.rs: F5 in the Agents view triggers a refetch (schedule_agents_refetch_for_tab).locales: append the translated• F5 <refresh>segment toagents.footer_hintand addF5to the{Locked}key-name list across all 89 locales. Translations follow each locale's existing "Esc " style and the Microsoft term for "Refresh"; RTL and the three pseudo-locales keep their wrappers;am-ET/lo-LAkeep their English placeholder.F5 = master re-scan (not just a cached re-list)
rescanflag helper->master onsessions/list. F5 sets a stickypending_rescan(survives in-flight coalescing); the helper forwards it; master, on rescan, runshistory_loader::load_for_clioff the LocalSet (spawn_blocking), upserts into the registry, then answers. Normal 5s polls / view-open /wta sessions liststay snapshot-only; a legacy empty{}params object deserializes asrescan=false.SessionRegistry::upsert_if_absent, so a reloaded disk row (statusHistorical, no pane binding) can't clobber a live session already in the registry — an open session keeps its status / pane binding across F5. Titles for existing rows still refresh via the post-rescantry_refresh_title_from_disk_withpass. (The startup seed uses the same guard.)sessions/changed, so every open view refetches immediately (matching the startup scan) instead of waiting up to 5s. The triggered refetches arerescan=false→ they neither re-scan disk nor re-broadcast (no loop).rescan_in_flightflag drives the loading shimmer for the whole refresh, so F5 has visible feedback even when the list already has rows; a normal poll keeps it false and never flashes.WSL: filter by CLI before parsing
load_all_innow takes acli_filterand reusescli_scan_flags(the host path's dispatch) to parse only the selected CLI's transcripts out of the extracted distro mirror. Previously all four CLIs were parsed and the others discarded viaretain_wsl_cli(now removed). The fetch/tar/extract is unchanged (still fetches all four), so this saves parse cost only; behavior is preserved (None/ custom agents still scan all four).Tests
f5_in_session_view_refetches_sessions— F5 ->rescan=true, view-open ->rescan=false.agents_view_loading_shows_during_f5_rescan— shimmer shows during a rescan even with rows present.build_sessions_list_request_round_trips_rescan— wire round-trip + legacy{}backward-compat.scan_distro_with_cli_filter_parses_only_selected_cli— parse-time WSL CLI filter.upsert_if_absent_preserves_existing_row_and_adds_new— a rescan can't downgrade a live row to Historical or drop its pane binding, and still adds genuinely new sessions.