Remove "Revert" button functionality #81

Closed
opened 2026-04-09 07:12:43 +00:00 by maxtkc · 0 comments
Owner

Summary

Remove the per-patch cherry-pick "Revert" buttons from the Changes tab (the confusing functionality called out in #81), delete the now-dead revertPatch method from PatchManager, and redesign the "Feed loaded" baseline row to look and behave like a regular change card — styled consistently, with an "origin" badge, and clickable to jump to version 0 (replacing the old "Revert all" button).

The changes are entirely confined to src/modules/history-controller.ts and src/modules/patch-manager.ts.

Relevant context

  • src/modules/history-controller.tsrender() method (lines 128–228) builds the Changes panel DOM. Per-patch Revert buttons are appended in the if (applied) block at lines 177–191. The baseline row is rendered at lines 208–227.
  • src/modules/patch-manager.tsrevertPatch(version) at line 326 is only called from the now-removed button; it will become dead code. jumpToVersion(target) at line 395 is what the baseline click should call with target = 0.
  • The change card styling uses: flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-base-200 transition-colors plus a border-l-2 border-primary bg-base-200 highlight when isCurrent. The "Feed loaded" baseline is version 0, so it should highlight when currentVersion === 0.

Phase 1 — Remove per-patch Revert buttons and dead code

Goal: Strip the cherry-pick UI and its backing method. Clean and self-contained.

  • In history-controller.ts, delete the if (applied) { ... revertBtn ... } block (lines 177–191) that creates and appends the per-patch Revert button
  • In patch-manager.ts, delete the revertPatch method (line 326 through its closing brace, ~55 lines)
  • Remove the textClass / line-through strikethrough logic on the patch label — specifically const textClass = applied ? '' : 'opacity-50 line-through' and its use in the li.innerHTML template. Patches that aren't currently applied should remain visually distinguishable (keep opacity-50) but without the line-through

Phase 2 — Redesign baseline row as a change card

Goal: Make "Feed loaded" look like a peer of the patch cards rather than a footer widget.

  • Replace the baseline <ul>/<li> block (lines 208–227) with a new <li> appended to the existing ul (or a separate ul below, consistent with current structure)
  • Style the baseline <li> identically to patch cards: flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-base-200 transition-colors
  • Show highlight (bg-base-200 border-l-2 border-primary) when currentVersion === 0
  • Render an <span class="badge badge-ghost badge-sm">origin</span> and a <span class="text-xs">Feed loaded</span> inside a flex column, matching the inner layout of patch cards
  • Attach a click listener that calls this.patchManager.jumpToVersion(0)
  • Remove the revert-all-btn button entirely — the whole row is now the click target

Original Issue

Lets remove the buttons in the Changes tab where you can "cherry-pick" a patch to revert. This is confusing and not very useful.

## Summary Remove the per-patch cherry-pick "Revert" buttons from the Changes tab (the confusing functionality called out in #81), delete the now-dead `revertPatch` method from `PatchManager`, and redesign the "Feed loaded" baseline row to look and behave like a regular change card — styled consistently, with an "origin" badge, and clickable to jump to version 0 (replacing the old "Revert all" button). The changes are entirely confined to `src/modules/history-controller.ts` and `src/modules/patch-manager.ts`. ## Relevant context - **`src/modules/history-controller.ts`** — `render()` method (lines 128–228) builds the Changes panel DOM. Per-patch Revert buttons are appended in the `if (applied)` block at lines 177–191. The baseline row is rendered at lines 208–227. - **`src/modules/patch-manager.ts`** — `revertPatch(version)` at line 326 is only called from the now-removed button; it will become dead code. `jumpToVersion(target)` at line 395 is what the baseline click should call with `target = 0`. - The change card styling uses: `flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-base-200 transition-colors` plus a `border-l-2 border-primary bg-base-200` highlight when `isCurrent`. The "Feed loaded" baseline is version 0, so it should highlight when `currentVersion === 0`. ## Phase 1 — Remove per-patch Revert buttons and dead code Goal: Strip the cherry-pick UI and its backing method. Clean and self-contained. - [x] In `history-controller.ts`, delete the `if (applied) { ... revertBtn ... }` block (lines 177–191) that creates and appends the per-patch Revert button - [x] In `patch-manager.ts`, delete the `revertPatch` method (line 326 through its closing brace, ~55 lines) - [x] Remove the `textClass` / `line-through` strikethrough logic on the patch label — specifically `const textClass = applied ? '' : 'opacity-50 line-through'` and its use in the `li.innerHTML` template. Patches that aren't currently applied should remain visually distinguishable (keep `opacity-50`) but without the line-through ## Phase 2 — Redesign baseline row as a change card Goal: Make "Feed loaded" look like a peer of the patch cards rather than a footer widget. - [x] Replace the baseline `<ul>/<li>` block (lines 208–227) with a new `<li>` appended to the existing `ul` (or a separate `ul` below, consistent with current structure) - [x] Style the baseline `<li>` identically to patch cards: `flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-base-200 transition-colors` - [x] Show highlight (`bg-base-200 border-l-2 border-primary`) when `currentVersion === 0` - [x] Render an `<span class="badge badge-ghost badge-sm">origin</span>` and a `<span class="text-xs">Feed loaded</span>` inside a flex column, matching the inner layout of patch cards - [x] Attach a click listener that calls `this.patchManager.jumpToVersion(0)` - [x] Remove the `revert-all-btn` button entirely — the whole row is now the click target --- ## Original Issue Lets remove the buttons in the Changes tab where you can "cherry-pick" a patch to revert. This is confusing and not very useful.
maxtkc self-assigned this 2026-04-09 07:12:43 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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
gtfs.zone/coloring-book#81
No description provided.