Skip to content

Re-read the explorer's directory while it is open - #31

Merged
tdwd merged 1 commit into
mainfrom
refresh-explorer
Nov 17, 2026
Merged

tdwd merged 1 commit into
mainfrom
refresh-explorer

Conversation

@tdwd

@tdwd tdwd commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

The Add project explorer read its directory once, on opening. A directory made in another pane stayed invisible until the explorer was closed and reopened.

Change

  • dirList.refresh re-reads the open directory once the listing is older than dirRefresh. The frame tick calls it.
  • The cursor stays on the same name when a new row sorts above it. If the highlighted row is removed, the cursor keeps its position, clamped to the new end.
  • docs/architecture.md records the cost: the read is synchronous, so a slow mount stalls the UI on each re-read. It also corrects the old claim of one Stat per entry. The code stats symlinks only.

Verification

  • Reproduced in tmux against a throwaway workspace, before and after the fix.
  • TestBrowserShowsADirectoryMadeWhileOpen and TestBrowserRefreshSurvivesTheCursorRowGoing go red when the tick call, the name match, the throttle or the clamp is broken.
  • make test and make race pass. A test merge with current main passes go vet and go test ./....

The Add project explorer read its directory once, on opening. A directory
made in another pane stayed invisible until the explorer was closed and
reopened.

The frame tick now calls dirList.refresh, which re-reads the directory once
the listing is older than dirRefresh. The cursor stays on the same name. If
that row has gone, the cursor keeps its position, clamped to the new end.

The architecture doc records the cost: the read is synchronous, so a slow
mount stalls the UI on each re-read. It also corrects the old claim of one
Stat per entry. The code stats symlinks only.
@tdwd
tdwd merged commit ea62732 into main Nov 17, 2026
3 checks passed
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