Skip to content

feat: improves print history loading - #1943

Merged
pedrolamas merged 1 commit into
fluidd-core:developfrom
pedrolamas:pedrolamas/history-loading
Aug 26, 2026
Merged

feat: improves print history loading#1943
pedrolamas merged 1 commit into
fluidd-core:developfrom
pedrolamas:pedrolamas/history-loading

Conversation

@pedrolamas

Copy link
Copy Markdown
Member

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.list returns count as rows returned, and job_totals.total_jobs is a lifetime counter that is never decremented on delete. So the footer now states what it actually knows.

Changes

  • Footer reads "1–15 of 100 loaded" while the history is partial, and drops back to the plain range once everything is in
  • Load all disables itself when there is nothing left to fetch
  • New allLoaded state, derived from the originating request's limit (a short page means the table is exhausted)
  • Card gains a permanent help tooltip explaining the load behaviour
  • JOB_HISTORY_LOAD 50 → 100
  • getHistoryById now reads a Map index 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
  • Footer strings go through $t, so they're localised via Weblate — Vuetify's own footer text is hardcoded English today

Notes

  • The allLoaded flag 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 adopted
  • A history holding exactly the requested limit leaves Load all enabled for one redundant click — detecting that needs a total Moonraker doesn't provide
  • Remove all leaves allLoaded as-is; an empty loaded list isn't proof the server is empty

Resolves #1921

Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
@pedrolamas pedrolamas added this to the 1.37.5 milestone Aug 26, 2026
@pedrolamas
pedrolamas requested a lite review from Copilot August 26, 2026 17:03
@pedrolamas pedrolamas added the FR - Enhancement New feature or request label Aug 26, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.allLoaded derived from the server.history.list request limit, 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 getHistoryById to use a Map index (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.

@pedrolamas
pedrolamas merged commit e1f6078 into fluidd-core:develop Aug 26, 2026
6 checks passed
@pedrolamas
pedrolamas deleted the pedrolamas/history-loading branch August 26, 2026 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FR - Enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

History page paginates over the loaded 50 jobs, so the paginator looks complete when it is not

2 participants