Release v1.28.1 — Gravity Sync Merge UI Fixes #54

Merged
Mike Bros merged 22 commits from release/1.28.1 into master 2026-03-16 08:21:49 +00:00
Collaborator

Release v1.28.1 — Gravity Sync Merge UI Fixes

Changes

  • OP#2249: Fix hunk acceptance persistence in merge view
  • OP#2250: Clarify diff preview labels: repo vs local
  • OP#2251: Add accept-local-and-create-override action in merge view
  • OP#2252: Add inline help to merge view
  • OP#2256: Test gravity sync merge UI fixes
  • OP#2278: Hunk navigation with counter and persistent status bar
  • OP#2279: Per-hunk accept with < and > directional keys
  • OP#2280: Save menu with local/repo/override options and automated release

Summary

Comprehensive overhaul of the gravity sync merge view:

  • Persistence fix: Change detection baseline corrected — auto-sync no longer overwrites merge results
  • Clear labels: "Repository" / "Local" instead of generic "left" / "right"
  • Hunk navigation: n/p to move, </> to accept repo or keep local, counter in statusline
  • Save workflow: Enter opens a menu with save locally, update repo, or create override options
  • 20 tests passing including 6 new merge persistence and override test cases

Checklist

  • All version tasks closed in Gravity PM
  • Tests passing (20/20)
  • Version file matches Gravity PM version
  • Draft release created

References

Version: v1.28.1 (Gravity PM)

## Release v1.28.1 — Gravity Sync Merge UI Fixes ### Changes - OP#2249: Fix hunk acceptance persistence in merge view - OP#2250: Clarify diff preview labels: repo vs local - OP#2251: Add accept-local-and-create-override action in merge view - OP#2252: Add inline help to merge view - OP#2256: Test gravity sync merge UI fixes - OP#2278: Hunk navigation with counter and persistent status bar - OP#2279: Per-hunk accept with < and > directional keys - OP#2280: Save menu with local/repo/override options and automated release ### Summary Comprehensive overhaul of the gravity sync merge view: - **Persistence fix**: Change detection baseline corrected — auto-sync no longer overwrites merge results - **Clear labels**: "Repository" / "Local" instead of generic "left" / "right" - **Hunk navigation**: `n`/`p` to move, `<`/`>` to accept repo or keep local, counter in statusline - **Save workflow**: Enter opens a menu with save locally, update repo, or create override options - **20 tests passing** including 6 new merge persistence and override test cases ### Checklist - [x] All version tasks closed in Gravity PM - [x] Tests passing (20/20) - [x] Version file matches Gravity PM version - [x] Draft release created ### References Version: v1.28.1 (Gravity PM)
Closes OP#2253

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Change detection now compares current hashes against what was recorded
at resolution time (prev.source_hash / prev.system_hash) rather than
against resolved_hash. This prevents auto-sync from overwriting merge
results on next VimEnter when source intentionally differs from the
merged content.

Also fixes trailing newline handling in _resolve() to check both source
and system files, preventing hash mismatches after "Accept All Left".

Closes OP#2249

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Rename merge view buffers: gravity://left → gravity://repo,
  gravity://right → gravity://local
- Update merge notification: "Left=Repository, Right=Local"
- Add legend to diff preview: "--- Local Copy" / "+++ Repository"
- Change picker descriptions: "source changed" → "repo changed",
  "system changed" → "local changed"
- Update floating diff header: "Comparing: Local Copy vs Repository"

Closes OP#2250

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
New OV keybinding in merge view keeps local content and writes it to
configs.overrides/{filename}, so future syncs compare against the
override instead of the base config. Prevents recurring diffs for
intentional local divergence.

- New _accept_local_override() action in merge.lua
- OV keybinding + right-click menu entry
- Resolve callback in init.lua handles create_override flag
- Override directory created automatically via utils.write_file()

Closes OP#2251

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Press ? in the merge view to show a floating help window listing all
available keybindings with descriptions. Closes on Esc or BufLeave.

Closes OP#2252

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 4 tests for merge resolution persistence (partial merge, keep right,
  external source change, external system change)
- 2 tests for override creation from merge view
- All 20 tests pass

Closes OP#2256

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Gravity Sync Merge UI Fixes (v1.28.1):
- Fix hunk acceptance persistence (OP#2249)
- Clarify diff preview labels: repo vs local (OP#2250)
- Add accept-local-and-create-override action (OP#2251)
- Add inline help to merge view (OP#2252)
- Test coverage for merge persistence and overrides (OP#2256)

Refs OP#2255

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace ephemeral vim.notify with persistent winbar on both windows
  showing role labels and key hints
- Left winbar: "Repository (read-only)" + navigation/hunk keys
- Right winbar: "Local (editable)" + save/accept/override/quit keys
- Reset cursor to top and equalize windows on open so content is
  visible immediately without scrolling
- Run diffupdate after setup to ensure diff highlighting renders

Refs OP#2249

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
JetBrains-style hunk navigation for the merge view:
- Count hunks on open, jump to first one automatically
- Winbar shows "◄ Hunk 3/7 ►" persistently on the left pane
- n/p keys navigate between hunks (also keeps ]c/[c)
- do accepts the repo version of current hunk and auto-advances
- Hunk count updates dynamically after accepting a hunk
- Shows "✓ No differences" when all hunks are resolved

Refs OP#2249

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Press d in the merge view to open a floating window showing the full
unified diff with +/- format and color highlighting. Shows the
--- Local / +++ Repository legend at the top. Close with q or Esc.

Refs OP#2249

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Move command hints from nvim_echo (ephemeral) to statusline (persistent)
- Both windows show: hunk counter + key commands at the bottom
- Winbars now just show "Repository <file>" / "Local <file>"
- Enter now confirms via vim.ui.select if unresolved hunks remain

Refs OP#2249

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Refs OP#2249

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Refs OP#2249

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Refs OP#2249

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Refs OP#2249

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The side-by-side diff is already showing the diff — a unified diff
popup on top is redundant. Removed d keybinding, statusline hint,
and help entry.

Refs OP#2249

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- ← accepts repo version of current hunk and advances (also do)
- → keeps local version and advances to next hunk
- Statusline shows ←/→ hints
- Help text reorganized into Per-Hunk and Bulk sections

Refs OP#2249

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- AL: accept repo (left) hunk and advance
- AR: keep local (right) hunk and advance
- RA: accept all repo and save (was AL)
- KR: keep all local and save (unchanged)

Refs OP#2249

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Visual directional keys: < points at left pane (accept repo),
> points at right pane (keep local). Replaces AL/AR bindings.

Refs OP#2249

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When keeping local with >, use diffput to copy right→left buffer.
This makes both sides match at that hunk so it disappears from the
diff and the hunk counter decreases. The left buffer change is
cosmetic — only the right buffer content gets saved.

Refs OP#2249

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Enter now opens a save menu with three choices:
1. Save locally — writes merged result to system file only
2. Save + update repo — writes to both system and source config file,
   then optionally offers to launch a background agent for automated
   release (WP creation, version bump, release PR)
3. Save + create override — writes to system and configs.overrides/
   to prevent this diff from recurring on future syncs

Replaces the old separate OV/RA/KR keybindings with a unified flow.
Right-click menu simplified to match.

Refs OP#2249

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix(gravity): normalize trailing newlines to prevent phantom hunk
All checks were successful
CI / json-check (pull_request) Successful in 7s
CI / lua-check (pull_request) Successful in 11s
PR Validation / validate-branch (pull_request) Successful in 2s
CI / security (pull_request) Successful in 9s
CI / manifest (pull_request) Successful in 6s
PR Validation / validate-release-pr (pull_request) Successful in 5s
CI / sast (pull_request) Successful in 13s
2bdf075d2c
Strip trailing newlines from both buffers on load so trailing
whitespace differences don't create a ghost hunk that can't be
resolved visually. The _resolve function still preserves trailing
newlines when writing to disk.

Refs OP#2249

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Mike Bros approved these changes 2026-03-16 08:21:43 +00:00
Mike Bros merged commit c83584fed9 into master 2026-03-16 08:21:49 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mike/kickstart.nvim!54
No description provided.