Skip to content

feat: flip graph layout — commit details left, graph dots right + re-center button#25

Merged
homeles merged 5 commits into
mainfrom
feat/graph-layout-flip
Apr 16, 2026
Merged

feat: flip graph layout — commit details left, graph dots right + re-center button#25
homeles merged 5 commits into
mainfrom
feat/graph-layout-flip

Conversation

@lupita-hom

Copy link
Copy Markdown
Collaborator

Changes

Layout flip

  • Commit details (SHA, message, date) → moved to the LEFT side
  • Graph dots/edges → now render on the RIGHT side

This matches the annotated screenshot direction — text info is immediately readable on the left, with the visual branch graph flowing on the right.

Re-center button

  • ⊙ button in the top-right corner of the graph area
  • Smoothly animates (400ms transition) to the latest commit at scale 1
  • Positions the latest commit near the top-center of the viewport (15% from top)
  • Styled to match Obsidian dark theme with hover effects (blue border highlight)

Technical details

  • Label area is a fixed-width region: SHA (64px) + message (460px) + date (80px) + padding
  • Graph dots are offset by LABEL_AREA_WIDTH to sit after the text
  • recenter() uses useCallback and calls d3svg.transition().call(zoom.transform, ...) for smooth animation
  • Clean tsc -b build (strict mode)

… button

- Moved SHA, commit message, and date labels to the LEFT side
- Graph dots/edges now render on the RIGHT side (offset by label area width)
- Added re-center button (⊙) in top-right corner that smoothly
  animates to the latest commit at scale 1, positioned near top-center
- Button uses Obsidian dark theme styling with hover effects
- Fixed coordinate calculation: accounts for LABEL_AREA_WIDTH offset
  so the full row (labels + graph dot) is visible
- Scale fits content width to viewport (capped at 1x)
- Latest commit positioned 40px from the top of the viewport
- Content centered horizontally when narrower than viewport
Two bugs fixed:

1. AppLayout URL-sync effect was overriding user's explicit org selection.
   When clicking 'Personal', selectedOwner was set to null, but the
   sync effect immediately saw params.owner !== null and reverted it.
   Added a ref flag (userSelectedOwnerRef) to skip the sync effect
   after intentional selections.

2. useOrgRepos was resetting accumulated repos when switching between
   null and userLogin (both resolve to Personal). The reset effect
   keyed on raw owner, but both values hit the same API endpoint.
   Now uses an effectiveOwner key ('__personal__' for both null and
   userLogin) so it only resets when the actual data source changes.
Swapped the ambiguous ⊙ character for a proper crosshair icon
(circle + 4 tick marks) — unmistakably a 're-center' button.
@homeles homeles self-requested a review April 15, 2026 17:33
All dropdowns, buttons, and pickers now share:
- height: 36px (explicit)
- border-radius: 8px
- padding: 0.375rem 0.75rem
- box-sizing: border-box

Components standardized:
- Org dropdown (AppLayout header)
- Repo dropdown (AppLayout header)
- BranchSelector button
- DateRangePicker preset select (also removed native appearance
  for consistent cross-browser rendering + custom dropdown arrow)
- DateRangePicker date range button
@homeles homeles merged commit 8baaaa0 into main Apr 16, 2026
1 check passed
@homeles homeles deleted the feat/graph-layout-flip branch April 16, 2026 19:36
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