5 Commits

Author SHA1 Message Date
Álvaro Tejero Cantero
ee9067e154
✨ Apply the branch review vocabulary and drop the pinned revision
Apply the designer's answers on the wording of branch reviews:

- A verdict is two buttons, Approve and Request changes. A stale
  verdict reads Approved an earlier version or Requested changes on
  an earlier version, and Send appears only with a comment.
- Close review everywhere, Branch review in titles, Merges for the
  merge list, Mark as viewed for compare marks, and Merge into main.
- Publishing goes, with the pinned revision it moved. Reviewers see
  the live branch, a verdict goes stale once the branch is saved
  after it, and the review viewer plays the live branch. Migration
  0819 drops the pinned columns and hands their snapshots to the
  snapshot clean-up.
- The frontend takes the branch-review names: namespaces, state
  keys, events, i18n prefixes, and the branch-compare namespace for
  the compare panel.

A failed branch count no longer stays an error after a listing
succeeds: the listing's size stands in for the count.

AI-assisted-by: claude-opus-5-5
2026-11-24 15:00:25 +01:00
Álvaro Tejero Cantero
26d3c45266
✨ Key branch reviews, threads, and tasks to the file family
A branch review, its verdicts, activity, threads, and tasks now hang
off the file family (a file and every branch cut from it), so they
outlive the branch file. Migration 0817:

- adds file_family, family_id on files and on the rows they own, real
  foreign keys for review_id and merge_id, and thread numbers per
  family, renumbered once;
- renames the review entity and its commands (file_branch_review,
  file_branch_reviewer with a nullable verdict, pinned revision
  columns), the compare marks (file_branch_change_mark, directions
  branch->source and source->branch), and the backend's main to
  source;
- derives a review's target from the branch edge.

At a merge, a thread moves to the target only when it holds an open
task, whole with its tasks, or when it was written outside any
review. Every other thread stays on the closed review, survives the
purge of the branch file, and is listed by get-branch-review-threads.
move-branch-review-thread brings one to the target later.

A branch deleted without a merge takes its reviews, threads, and
tasks with it. Branches of branches are built behind the
branch-stacking flag, off by default.

AI-assisted-by: mixed models
2026-11-23 19:23:21 +01:00
Álvaro Tejero Cantero
cd3ba19456
🐛 Follow the branching UI decisions in the Playwright specs
Twelve specs of branches-library, merged-and-archived-branches, and
pull-requests failed on iop-vc-preview before penpot#12780. They still
asserted copy and flows that the branching UI work replaced on purpose:

- The banner of a review now says "Reviewing the design review", and
  its cancel confirmation accepts with "Cancel design review".
- The compare dialog is titled "Review changes".
- A library's header says "Default branch". The popover adds the note
  "Read by library consumers" under the main row.
- Restoring an archived branch asks for confirmation first.
- A merge deletes its branch (penpot#12596), so neither the switcher
  nor the all-branches dialog lists merged branches.

The specs now assert the current behaviour, including that no merged
group or tab shows.

AI-assisted-by: claude-opus-5-5
2026-11-03 12:49:42 +01:00
Álvaro Tejero-Cantero
d669eec0c0
✨ Load the branch list only when the switcher opens (#12571)
* ✨ Add a branch count query for the workspace header

The header shows its branch row only when the file has branches, and
it learnt that from get-file-branches, which compares every diverged
branch against main. get-file-branch-count answers the same question
with one indexed count: archived and merged branches included, counted
from main when the file is itself a branch, with no comparison and no
climit, like the branches_count subquery of the dashboard listings.

The listing keeps its climit, and :get-file-branches/global now sets
the 60 s timeout that the header of climit.edn promises, so a waiter
behind six cold listings gets an error instead of waiting without
bound. Its rationale comment names the callers it serves now.

AI-assisted-by: claude-opus-5-5
Signed-off-by: Álvaro Tejero Cantero <alvorithm@teje.ro>

* ✨ List branches only when the switcher opens

Opening a file ran the counted branch listing for every user, because
the header decided whether to show its branch row from that listing.
A cold listing runs a three-way comparison per diverged branch, and
one save to main makes every branch of the file a cache miss again.

The header now loads the branch count and the branch context with the
file. The listing loads when the branch switcher or the all-branches
dialog opens, and both show "Loading branches…" until it arrives
instead of a list from an earlier opening.

A failed listing used to read as an empty list, which on main hid the
branch row and sent the shortcut to the create dialog. It now ends in
an error state: the switcher and the dialog say "Couldn't load
branches" with a Retry action, and the row stays, since its visibility
comes from the count. A successful listing refreshes the count, so
deleting the last branch from the list still hides the row.

Creating a pull request from the branch banner looked the branch up
in the listing to decide whether to save pending edits first. Without
the listing loaded at open it would skip the save, so it now reads the
branch context of the open file.

AI-assisted-by: claude-opus-5-5
Signed-off-by: Álvaro Tejero Cantero <alvorithm@teje.ro>

* ✨ Show the branch row when the branch count fails

A failed get-file-branch-count left no count, so on main the header
hid its branch row and the shortcut opened the create dialog on a file
that may have branches. The failure is now kept as an error state
under :workspace-branch-count, and has-branches? reads it as true.

The row then shows the Main chip and, where the status note goes,
"Couldn't load branches" in the warning colour. Opening the switcher
loads the listing through the existing loading and Retry path, and a
successful listing settles the count, which replaces the note.

AI-assisted-by: claude-opus-5-5
Signed-off-by: Álvaro Tejero Cantero <alvorithm@teje.ro>

* 📚 Name the callers of the branch listing limit again

The merge of iop-vc-preview took its climit.edn, whose comment on
:get-file-branches/global still described a panel open. Restore the
comment this branch wrote: the listing runs when the switcher, the
all-branches dialog or the dashboard popover opens, and a file open
only counts branches.

AI-assisted-by: claude-opus-5-5
Signed-off-by: Álvaro Tejero Cantero <alvorithm@teje.ro>

* 🐛 Mock the branch count in the library copy tests

The header now shows its branch row from get-file-branch-count, not
from the listing, so the library copy tests mock the count as well.

AI-assisted-by: claude-opus-5-5
Signed-off-by: Álvaro Tejero Cantero <alvorithm@teje.ro>

---------

Signed-off-by: Álvaro Tejero Cantero <alvorithm@teje.ro>
2026-10-22 20:50:58 +02:00
Álvaro Tejero-Cantero
d4f999e6dd
✨ Tell a library branch that its consumers read main (#12570)
Files that use a shared library read its main, never a branch, so a
branch of a library is not isolated in the sense the create dialog
promised. On a shared library the create dialog now says that files
using the library can adopt changes from main only, the chip of a
library branch says the same, and the note beside main reads
"Default branch (read by library consumers)". Other files keep their
copy.

get-file-branch-info returns source-is-shared so a branch knows its
main is a library.

AI-assisted-by: claude-opus-5-5

Signed-off-by: Álvaro Tejero Cantero <alvorithm@teje.ro>
2026-10-22 20:04:23 +02:00