feat: improves print history loading - #1943
Merged
pedrolamas merged 1 commit intoAug 26, 2026
Merged
Conversation
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the History widget/store to clearly distinguish between “loaded” history vs complete history, and improves lookup performance when correlating files to history jobs.
Changes:
- Add
history.allLoadedderived from theserver.history.listrequestlimit, and use it to disable Load all when exhausted. - Localize and override the History table footer to display “of N loaded” while history is partial.
- Optimize
getHistoryByIdto use aMapindex (avoids per-file linear scans) and raise the initial history load limit to 100.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/store/history/types.ts | Adds allLoaded to history state. |
| src/store/history/state.ts | Initializes allLoaded to false. |
| src/store/history/mutations.ts | Adds setAllLoaded mutation. |
| src/store/history/getters.ts | Introduces getHistoryByIdMap and switches getHistoryById to O(1) lookup. |
| src/store/history/actions.ts | Computes allLoaded from the originating request’s limit via __request__. |
| src/locales/en.yaml | Adds localized footer strings and a history load-behavior tooltip. |
| src/globals.ts | Increases JOB_HISTORY_LOAD from 50 → 100. |
| src/components/widgets/history/PrintHistoryCard.vue | Adds persistent help tooltip and disables Load all when allLoaded. |
| src/components/widgets/history/JobHistory.vue | Overrides Vuetify footer text to show “loaded” vs complete state via i18n. |
| docs/docs/features/printing.md | Documents the new default load size and Load all behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The History table paginated over only the loaded jobs, so the footer read "1–15 of 50" and reaching the last page looked like reaching the end of the history. Load all was always rendered and always active, so it signalled nothing either way.
No truthful total is available to print instead —
server.history.listreturnscountas rows returned, andjob_totals.total_jobsis a lifetime counter that is never decremented on delete. So the footer now states what it actually knows.Changes
allLoadedstate, derived from the originating request'slimit(a short page means the table is exhausted)JOB_HISTORY_LOAD50 → 100getHistoryByIdnow reads aMapindex instead of.find()ing the whole history per file — removes an O(files × jobs) term from every directory render, which is what makes the higher limit a non-event on phones$t, so they're localised via Weblate — Vuetify's own footer text is hardcoded English todayNotes
allLoadedflag and short-page detection are Mainsail's design (src/store/server/history/actions.ts,HistoryListPanel.vue); the chained multi-page fetch it sits on there is not adoptedallLoadedas-is; an empty loaded list isn't proof the server is emptyResolves #1921