Skip to content

Large folders shown a page at a time, so the folder tree stays responsive - #41

Merged
JE-Chen merged 2 commits into
mainfrom
dev
Nov 19, 2026
Merged

JE-Chen merged 2 commits into
mainfrom
dev

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Releases what dev has added since 0.2.13.

Large folders no longer freeze the folder tree

  • QTreeView lays out every row of every expanded folder on each expand, sort and live refresh, calling the Python model about twice per row. That dispatch alone is the cost: a model that does nothing else needs about 2 s to expand 150,000 rows, a C++ model 86 ms.
  • Folders with more than 2,000 entries now show the first 2,000 in the current order, followed by a display-only row counting the rest and their size. Clicking it or pressing Enter shows the next page and moves to its first entry. Picking a hidden entry in a chart or list shows the page it is on.
  • The row is never an entry to act on: selection, removal and copying skip it. While filtering, it stays as long as a hidden entry matches.
  • The tree's selected entries are now read from whole selected ranges instead of Qt's per-row selectedRows().
  • Measured on the same made-up folders in one session, before → after:
Action Before After
Expand a folder of 150,000 files 1.0–2.7 s 14–37 ms
Ctrl+A in the tree 17–41 s 96 ms
Longest stall during a scan with that folder open 1.0–1.1 s 0.10–0.17 s
Expand 30 folders of 3,000 files 0.7–1.6 s 0.39 s
  • Two new texts in all five languages; the guides describe the pages.

Not verified

  • Measured on made-up folders in a hidden window, not on the reporter's own drive or screen. With many large folders open at once, layout still grows with the total number of shown rows.
  • Japanese and Korean texts were not reviewed by a native speaker.

Test plan

  • ruff check .
  • Related tests locally: tree, GUI, copy and export, archives, removals, charts and strings, 507 passed (the known long-path test excluded)
  • New test_tree_paging.py (12 cases); the copy and macOS Enter cases fail without their fixes
  • Tests workflow on dev: the first run caught Return not activating on macOS, fixed in the second commit

QTreeView lays out every row of every expanded folder on each expand, sort
and live refresh, calling the Python model about twice per row. A folder of
150,000 files took 1.0-2.7 s to expand and froze a live scan for about 1 s
per refresh; Ctrl+A in the tree took up to 41 s.

Folders with more than 2,000 entries now show the first page in the current
order and a display-only last row counting the rest. Clicking it or pressing
Enter shows the next page; picking a hidden entry in a chart or list shows
its page. The filter keeps the row while a hidden entry matches, selection
never returns it and copying skips it. The tree's selected entries are read
from whole selected ranges instead of Qt's per-row selectedRows().
Qt's item views do not emit activated for Return on macOS, so pressing Enter
on a large folder's last row did nothing there. The tree now handles Return
and Enter on that row itself on every platform.
@sonarqubecloud

Copy link
Copy Markdown

@JE-Chen
JE-Chen merged commit 8c728a3 into main Nov 19, 2026
35 checks passed

This branch was previously deployed

1 inactive deployment
windows-signing — b3a44daf Deployed Nov 19, 2026 by JE-Chen via build-exe #16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant