Repository navigation
fix(sidebar): put the path row above recent activity and bound its scan - #561
Merged
Merged
Conversation
The recents list loads asynchronously above the path row, so the input and Browse button moved down under the pointer once the scan finished and a click meant for Browse landed on a recent project. The path row now comes first and the list loads below it. Each recent project lists its conversations per provider in words, and the section states that choosing a project also imports those conversations.
The session walk followed directory symlinks, so a link back to an ancestor in the Codex sessions tree branched without end: with three such links the scan never finished and Add Project stayed on its loading row. Symlinked directories are no longer walked. Directory existence and project exclusion were checked per thread, with every project root canonicalized again for every thread; the scan grew by about 4 ms per project on 850 threads. They now run once per directory, with project roots canonicalized once.
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.
Behaviour
Claude Code: 3 conversations · Codex CLI: 1 conversation(zh:Claude Code:3 条对话). Previously it showedClaude Code ×3.No new abstractions;
tool_countskeeps its owner and only switches to localized strings. New keys are in bothlocales/en.ymlandlocales/zh-CN.yml.Checks run
cargo fmt --all --checkcargo clippy -p tcode-ui --all-targets --locked -- -D warningscargo nextest run -p tcode-ui --locked: 322 passed, including locale parityRecent-activity scan bounds (second commit)
I reviewed the host-side scan that feeds this list (
crates/services/src/import) and measured it on a real profile (341 Claude Code and 3,493 Codex transcripts, 9 GB):collect_filesfollowed directory symlinks, so a link back to an ancestor under~/.codex/sessionsmade the walk branch without end. Measured: two links took 5.4 s, three links were still running after 60 s, and the dialog stayed on "Looking for recent activity…" the whole time. The walk now usesDirEntry::file_typeand does not descend into symlinked directories; the same case takes 36 µs. The existing scanner test now has a loop link under its Codex fixture: without the fix that session is listed 17 times instead of once, and the test fails.is_diron its cwd and canonicalized every project root again. On 850 threads that added about 4 ms per project (25 projects: 185 ms, 55 projects: 295 ms). The checks now run once per distinct directory, with project roots canonicalized once: 92 ms whatever the project count. The result is unchanged (87 directories either way), and exclusion stays covered byscanner_groups_attributes_orders_and_excludes. Doing the checks per directory also means a cwd on a slow or unreachable mount blocks once, not once per thread.Checked and left alone:
cwd. On real data the most read before that was 415 KB. A synthetic 400 MB file with nocwdline scans in about 110 ms.Host::unblock). The path row and Browse work while it loads.Still unbounded: a cwd on an unreachable network mount can block
is_dirfor as long as the OS lets it. There is no timeout. The dialog keeps showing the loading row, and typing a path or using Browse still works.cargo clippy -p tcode-services --all-targets --locked -- -D warningsandcargo nextest run -p tcode-services --locked(78 passed) also run.