Repository navigation
imp: web: transaction tooltips use a fixed-width font, so amounts line up (#2716) - #2754
Merged
Merged
Conversation
acinader
force-pushed
the
web-entry-tooltip
branch
from
September 29, 2026 18:32
9dbb382 to
2e0d1f0
Compare
…e up (hledgerorg#2716) Hovering a transaction in the journal or a register shows its journal entry, as before, but hledger-web now draws the tooltip itself rather than leaving it to the browser. It uses a fixed-width font, so amounts and comments line up as they do in the journal; long lines wrap only at the window edge, indented under their line; and it stays within the window. The rows carry the entry in a data-entry attribute instead of a title, which browsers draw in a proportional font, wrapped at their own narrow width. It comes and goes like the browser's own tooltip: it appears after a short pause, and goes away when the pointer leaves, and on a click, a key press, or a scroll. Over an account link, the link's own title shows instead. It follows the mouse only, since a touch has no hover. New browser tests check that it shows and hides that way, that account links keep their titles, and that the entry's text is shown as text, not markup. AI usage: Claude Opus 5.5, ~190k output tokens.
acinader
force-pushed
the
web-entry-tooltip
branch
from
September 30, 2026 05:01
2e0d1f0 to
0e26ab5
Compare
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.
Hovering a transaction in the journal or a register shows its journal entry in the browser's own tooltip, drawn in a proportional font and wrapped at the browser's narrow width: amounts and comments don't line up, and a long entry is hard to read. Fixes #2716.
This PR keeps the tooltip's content and behavior and changes only its format, so the entry reads exactly as it does in the journal. hledger-web now draws the tooltip itself:
The rows carry the entry in a
data-entryattribute instead of atitle, so the browser doesn't show its own tooltip as well.Before (Safari's own tooltip, from #2716) and after (this PR), for four of the eight cases in the issue:
CASE01: basic alignment
CASE02: long inline metadata
CASE04: long accounts and mixed amount widths
CASE08: thirty postings
The tooltip's colors are written out (dark gray on white), like the rest of hledger.css on main. #2752 (dark mode) moves the page's colors into a palette; whichever of the two lands second, I'll rebase it so the tooltip takes its colors from the palette.
Tests: two browser tests in webui.spec.js: a journal entry shows on hover and goes away when the pointer leaves or clicks, staying away after a click while the pointer is still on the row; and a register row shows its entry too, while an account link keeps its own title. One in security.spec.js: an entry carrying the fixture's html payload shows it as text in the tooltip. Each failed under a mutation of the new code (the lines set as markup, the click handler removed, an account link's title overridden, the register rows'
data-entryremoved). All 36 browser tests and the yesod suite pass.How to test
Open http://127.0.0.1:5080/journal and hover a transaction's date or description: after a moment its journal entry appears in a fixed-width font, with the amounts in a column. Move to the next transaction and its entry replaces the first at once. Click, and it goes away until the pointer leaves the row.
AI usage: Claude Opus 5.5: ~205k output tokens