feat: welcome page + fix stale diff panes after git operations#305
Merged
esmuellert merged 8 commits intomainfrom Mar 4, 2026
Merged
feat: welcome page + fix stale diff panes after git operations#305esmuellert merged 8 commits intomainfrom
esmuellert merged 8 commits intomainfrom
Conversation
Show a centered CodeDiff logo with hint text when the explorer refreshes and finds 0 files (all changes staged/committed/stashed). Uses the same single_pane mechanism as A/D files in side-by-side mode, and buffer swap in inline mode. - welcome.lua: pure buffer factory (create_buffer, is_welcome_buffer) - side_by_side.lua: show_welcome via existing show_single_file - inline_view.lua: show_welcome via buffer swap (no window changes) - refresh.lua: hook on 0 files, routes by layout mode - welcome_spec.lua: unit tests + E2E test with real git repo Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
After git operations, the explorer tree refreshed correctly but diff panes showed stale content because on_file_select was never called. Root cause: process_result() in refresh.lua had a broken 'restore selection' block — it searched group nodes (not file children) and used a no-op set_node() call. Diff panes were never updated. Fix: After refresh, search status_result for the currently viewed file (same group first, then all groups). If found, call on_file_select to update diff panes with correct revisions. If not found (committed/removed), show welcome page. Also added pcall guards for optional module loads (move rendering, keymap help) to prevent cascade failures in headless test env. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace raw vim.fn.system('git -C ...') calls with repo.git() and
helpers.git_cmd() across all test files. Fixes Windows CI failures
caused by vim.fn.shellescape() using single quotes incompatible
with cmd.exe, and single-quoted commit messages.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Single-quoted commit messages in stale_buffer_spec.lua fail on Windows cmd.exe where single quotes are literal characters. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Summary
Two major improvements to the explorer mode:
1. Welcome page when changes are resolved
When all changes disappear (staged/committed/stashed) while the explorer is open, a centered CodeDiff logo with hint text replaces the stale diff content. Uses the same single_pane mechanism as A/D files.
welcome.lua: Pure buffer factory — creates centered logo bufferwelcome_window.lua: Manages window options (hides line numbers/gutter for clean display, restores on leave)side_by_side.lua+inline_view.lua:show_welcome()wrappers using existing single-file mechanism2. Fix stale diff panes after git operations
Root cause:
process_result()inrefresh.luarebuilt the explorer tree correctly but never calledon_file_selectto update the diff panes. The old restore selection block searched group nodes (not file children) and used a no-opset_node().Fix: After refresh, search
status_resultfor the currently viewed file (same group first, then all groups). If found, callon_file_selectto update diff panes. If not found, show welcome page.Scenarios fixed (all verified via E2E tests):
3. Resilience improvements
core.lua: pcall for move module, only when moves existkeymaps.lua: pcall inside callback so keymap always registersTesting