Skip to content

fix(explorer): retry a no_root listing until the pane reports its cwd - #452

Merged
amirlehmam merged 1 commit into
amirlehmam:masterfrom
stlindenau:fix/explorer-retry-no-root
Nov 13, 2026
Merged

amirlehmam merged 1 commit into
amirlehmam:masterfrom
stlindenau:fix/explorer-retry-no-root

Conversation

@stlindenau

Copy link
Copy Markdown
Contributor

Problem

The explorer shows "This pane has not reported a working directory yet" when main has no cwd for the pane (no_root). That state is not permanent: a pane restored after a wmux restart (a devcontainer shell, for example) reports its cwd only when its shell next speaks, and a pane started as bash -c <cmd> may not report again for a long time. Nothing re-fetches when the report finally lands, so the error stays on screen until the user presses Refresh.

Change

In ExplorerPanel.tsx, while the panel is showing exactly no_root and has a surface and root, it asks again every 3s (NO_ROOT_RETRY_MS). A counter re-arms the timer, because a retry answered with no_root again sets the same error and would not re-run the effect on its own. Any other outcome changes or clears error and the loop stops; unmounting clears the timer.

Testing

  • Checked by hand: after a wmux restart the explorer for a restored devcontainer pane filled in by itself once the pane reported, without pressing Refresh.
  • tsc and eslint are clean. The file stays LF (22 lines added, none removed).
  • No automated test. The existing explorer tests cover store/state logic and don't render components, so I did not add one for this effect.

Cost

One explorer:list-dir IPC call every 3s per panel while the error is showing, and nothing otherwise.

🤖 Generated with Claude Code

A pane restored after a wmux restart reports its cwd only when its shell next
speaks, and nothing re-fetched when that report landed, so the explorer kept
showing 'has not reported a working directory' until Refresh was pressed. Ask
again every 3s while that exact error is showing.
@amirlehmam
amirlehmam merged commit 8483195 into amirlehmam:master Nov 13, 2026
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.

2 participants