Skip to content

Fix slides Delete key, multi-select drag, and shared Slides routing#201

Merged
hackerwins merged 2 commits into
mainfrom
fix/slides-delete-multidrag-share
May 9, 2026
Merged

Fix slides Delete key, multi-select drag, and shared Slides routing#201
hackerwins merged 2 commits into
mainfrom
fix/slides-delete-multidrag-share

Conversation

@hackerwins

@hackerwins hackerwins commented May 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Three slides bugs reported in one session, fixed together because they share the same code paths:

  1. Delete/Backspace did nothing on a selected shape. packages/slides/src/view/editor/interactions/keyboard.ts had no key rule for Delete or Backspace — the only Delete entry point was the right-click context menu. Added a rule that calls store.removeElements on the current selection. The rule skips when e.target is an INPUT/TEXTAREA/SELECT or isContentEditable, so Backspace inside the inline text-box editor still deletes characters.
  2. Clicking on one of several selected shapes collapsed the multi-selection. selectAt in packages/slides/src/view/editor/interactions/select.ts returned [hit] on a no-shift click regardless of the current selection, so the follow-up startDrag (editor.ts:716) only moved the clicked element. Now selectAt preserves current when current.includes(hit); replacement still happens for clicks on a non-selected element. Matches Google Slides / Keynote / Figma behavior.
  3. A shared Slides document opened as an empty Sheet. share-link.controller.ts:74 already passed the document's stored type ("sheet" | "doc" | "slides") through to the resolver response, but SharedDocumentInner only special-cased "doc" — slides fell into the spreadsheet branch with a sheet-{id} Yorkie docKey. Extended ResolvedShareLink.type to include "slides", added a SharedSlidesLayout that mounts SlidesView under a slides-{id} docKey (matching the standalone route at slides-detail.tsx:220).

Known limitations

  • Read-only enforcement for slides is incomplete. SlidesView's readOnly prop is documented as a Phase 4b no-op (slides-view.tsx:25-30), so a viewer-role share link will see the "View only" badge but the editor remains interactive. The role is forwarded to SlidesView so it lights up automatically when 4b lands; called out with a comment in SharedSlidesLayout. This is a separate issue from the routing bug — pre-PR, viewers saw the wrong document entirely; post-PR, they at least see the right one.
  • Frontend chunk-count budget bumped 80 → 85. Lazy-loading SlidesView in shared-document.tsx (so non-slides share links don't pay for the slides bundle) caused vite to split slides-view and its slide-renderer dependency into their own chunks (+2). Reasoned in harness.config.json.

Test plan

  • pnpm verify:self — all 9 lanes pass (sheets/docs/slides build, verify:fast 226 + 1265 + 267 + 174 + 764, frontend build, chunk gate, backend build, cli build, entropy).
  • Added 8 unit tests covering the new behavior:
    • select.test.ts — click on already-selected element preserves multi-selection; click on non-selected element with multi-selection replaces.
    • keyboard.test.ts — Delete/Backspace remove selection (single + multi, single undo entry); Backspace inside textarea is a no-op; no-selection Delete is a no-op.
    • editor.test.ts — multi-select + click-on-selected + drag moves the whole group with identical per-element delta.
  • Manual smoke in pnpm dev: select shape + Delete, multi-select + drag, share a slides doc and open the link.

🤖 Generated with Claude Code

hackerwins and others added 2 commits May 9, 2026 21:31
Slides ignored Delete/Backspace because no key rule existed for them
(only the context menu's Delete item was wired). And a no-shift click
on an already-selected element collapsed the selection to a single
hit, so a follow-up drag only moved that one element instead of the
whole group.

Add a Delete/Backspace rule that removes selected elements via
store.removeElements, skipping when focus is in INPUT/TEXTAREA/SELECT
or contenteditable so character deletion in the inline text-box
editor still works. Make selectAt preserve the existing selection
when a no-shift click hits one of the already-selected elements; the
follow-up startDrag then operates on the full selection.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Share-link resolve returns the document's stored type ("sheet" |
"doc" | "slides"), but SharedDocumentInner only special-cased "doc"
and fell through to the spreadsheet branch otherwise. A shared Slides
document was therefore attached under a sheet-{id} Yorkie docKey and
rendered with SheetView, so the viewer saw an empty spreadsheet
instead of the deck.

Extend ResolvedShareLink.type to include "slides", route the slides
branch to a new SharedSlidesLayout that mounts SlidesView under a
slides-{id} docKey, and keep the existing sheet/doc branches intact.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented May 9, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@hackerwins has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 49 minutes and 11 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 977f77b6-d7d2-4078-aca2-4315aa0422b3

📥 Commits

Reviewing files that changed from the base of the PR and between a68897d and 6eb96a5.

📒 Files selected for processing (8)
  • harness.config.json
  • packages/frontend/src/api/share-links.ts
  • packages/frontend/src/app/shared/shared-document.tsx
  • packages/slides/src/view/editor/editor.test.ts
  • packages/slides/src/view/editor/interactions/keyboard.test.ts
  • packages/slides/src/view/editor/interactions/keyboard.ts
  • packages/slides/src/view/editor/interactions/select.test.ts
  • packages/slides/src/view/editor/interactions/select.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/slides-delete-multidrag-share

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented May 9, 2026

Copy link
Copy Markdown
Contributor

Verification: verify:self

Result: ✅ PASS in 163.1s

Lane Status Duration
sheets:build ✅ pass 12.4s
docs:build ✅ pass 11.8s
slides:build ✅ pass 8.6s
verify:fast ✅ pass 87.4s
frontend:build ✅ pass 17.4s
verify:frontend:chunks ✅ pass 0.3s
backend:build ✅ pass 4.7s
cli:build ✅ pass 2.0s
verify:entropy ✅ pass 18.3s

Verification: verify:integration

Result: ✅ PASS

@codecov

codecov Bot commented May 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@hackerwins
hackerwins merged commit f14fccc into main May 9, 2026
4 checks passed
@hackerwins
hackerwins deleted the fix/slides-delete-multidrag-share branch May 9, 2026 13:00
@hackerwins hackerwins mentioned this pull request May 11, 2026
6 tasks
hackerwins added a commit that referenced this pull request May 11, 2026
Adds @wafflebase/slides as a third surface alongside Sheets and Docs,
plus 53-shape library (Phase 1+2), adjustment handles for 9 pilot
shapes (P3-A.1), live snap guides, align/distribute toolbar, themed
authoring, and layout-change UI. Also ships Sheets cell comments
(Phase B), docs peer-avatar caret jump, yorkie-js-sdk 0.7.8 upgrade,
and CLI/REST API improvements (docs export imageFetcher, expired
session refresh, REST docs split). Minor bump because slides is a
new top-level package.

Highlights: #184 #185 #186 #187 #188 #189 #190 #191 #192 #197 #198
#201 #202 #203 #204 #205 #206 #207 #209 #210
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.

1 participant