Skip to content

Duplicate button for slides only - #190

Merged
grunion-ai merged 3 commits into
mainfrom
claude/duplicate-slide
Sep 28, 2026
Merged

grunion-ai merged 3 commits into
mainfrom
claude/duplicate-slide

Conversation

@grunion-ai

@grunion-ai grunion-ai commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

What changed

  • $('dup').onclick loses the branch that duplicated the selected rows (offset 16px, copies selected). On the canvas the button now always duplicates the current slide, after itself, and clears the row selection; in the contact sheet it duplicates the selected slides, unchanged.
  • The button's data-tip and aria-label read "Duplicate slide" (were "Duplicate selection or slide").
  • docs/editor.md: the HUD line describes the button as slides only and points rows at ⌘C / ⌘V; the contact sheet paragraph no longer lists ⌘D.
  • CHANGELOG.md entry. Deck and library html rebuilt.

Why

Issue #80: the same click duplicated a slide or a set of rows depending on what happened to be selected, with no way to tell which without looking at the canvas first. Rows now copy with ⌘C / ⌘V (#79, PR #187), which also moves them across slides and translates a line connector's both ends through the same moveBy() path the old row branch used.

⌘D

No keyboard shortcut shares this handler. test/gate.test.mjs already asserts there is no mod&&k==='d' branch ("⌘D is gone: the duplicate button is the door"), the shortcuts popover says ⌘D is not a shortcut, and the HUD line in docs/editor.md says the same. Only the contact sheet paragraph still listed ⌘D, which contradicted the rest; this PR removes it there. The lease guard still swallows ⌘D under an agent checkout, which is harmless and unchanged.

Test

  • New: test/hud.test.mjs, "hud: the duplicate button is named for the slide" (source) and "hud: duplicate copies the slide whatever rows are selected; in the sheet it copies the selected slides" (Chromium). Before the fix both failed: the label was "Duplicate selection or slide", and with two rows selected the click added rows instead of a slide. Both pass now. The old test that asserted the row branch is removed.
  • Updated: test/gate.test.mjs counts three moveBy( callers (drag, nudge, row paste).

Verification

Full local suite on the pre-merge branch: 680 of 680 pass. After merging main (which added the Undo and Delete HUD buttons, PR #181): the full suite passes 693 of 693. The first CI run failed one Firefox test, "two windows (firefox)" in test/autosave.test.mjs (the store had not converged on both windows' edits); it touches no duplicate code and passes locally on Firefox, so the branch was re-pushed after merging main.

Fixes #80

🤖 Generated with Claude Code

grunion-ai and others added 3 commits September 28, 2026 15:58
With rows selected on the canvas the button duplicated those rows,
offset 16px; otherwise it duplicated the slide. The same click meant
two things depending on the selection. It now duplicates the current
slide on the canvas whatever rows are selected (the selection clears)
and the selected slides in the contact sheet. Its tooltip and
aria-label read "Duplicate slide". Rows are copied with ⌘C and ⌘V.

⌘D has no handler (retired for this button, which the gate asserts);
the contact sheet paragraph in docs/editor.md no longer lists it.

Gate: test/hud.test.mjs, test/gate.test.mjs. Deck and library html
rebuilt.

Fixes #80

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	deck.html
#	docs/editor.md
#	library.html
#	template.html
@grunion-ai
grunion-ai merged commit e6acc16 into main Sep 28, 2026
1 check passed
@grunion-ai
grunion-ai deleted the claude/duplicate-slide branch September 28, 2026 23:18
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.

Duplicate button should duplicate slides only, never the row selection

1 participant