Skip to content

Open a commit's details under its row in History - #110

Open
vivi7 wants to merge 1 commit into
doctly:mainfrom
vivi7:fix/git-history-details-under-row
Open

vivi7 wants to merge 1 commit into
doctly:mainfrom
vivi7:fix/git-history-details-under-row

Conversation

@vivi7

@vivi7 vivi7 commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #99.

Problem

In Git > History, clicking a commit put its details after the last loaded row, and every repaint of the table (the "Loading…" paint, then the loaded one) started the table again from the top. So:

  • the table jumped when a commit was clicked;
  • the details showed up at the end of the list, far from the commit you clicked. In a long history (300 commits plus Load More) they ended up hundreds of rows away, often out of view, so the panel looked like it never opened.

Fix

  • The details open right under the clicked row. For a comparison they open under the row clicked first. They only fall back to the end of the list when that row is no longer loaded.
  • The panel leaves the graph column free, so the lanes run on beside it. Next to the panel a lane change still bends within one row and then runs straight, instead of stretching one curve over the whole panel.
  • Opening, loading, switching Tree/List, folding a folder and closing all repaint with the scroll position preserved.
  • Once the details have loaded, the table scrolls so the clicked row and its details are centered, or the row goes to the top if they are taller than the table. Only the table scrolls: the old scrollIntoView could also move the containers around it.

Testing

  • New tests in test/project-git-graph-view.test.js: the panel goes under the clicked row (and under the first row of a comparison), scroll is kept across open/load/close, centering waits for the loaded details and stays inside the table, and the bend beside the panel stays one row tall. All six fail on main and pass with this change.
  • npm test: everything passes except two git tests (fileDiff reads tracked and untracked changes…, projectGitInfo and projectGitDiff expose read-only data…). They fail the same way on a clean main here because of a global color.ui = always, and they pass with GIT_CONFIG_GLOBAL=/dev/null.
  • Checked by hand in a dev instance: a 48-commit repository and a 300-commit one with Load More, clicking commits near the top and far down the list, opening a file's diff from the panel, Tree/List, and closing with × and Escape.

Clicking a commit in History put its details after the last loaded row,
and every paint of the table started it again from the top. So the table
jumped when a commit was clicked, and the details showed up at the end of
the list, far from the commit and out of view in a long history.

The details now open right under the clicked row (a comparison under the
row clicked first), and the graph's lanes run on beside them. Opening,
loading, switching Tree/List, folding a folder and closing keep the table
where it was. Once the details have loaded, the table scrolls to center the
row and its details, and only the table scrolls, not the tab around it.
Beside the details a lane still bends within one row, then runs straight.
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