Skip to content

fix(core): select tagged text inside Agenda-style wrappers - #430

Open
PARZIVAL7498 wants to merge 1 commit into
1weiho:mainfrom
PARZIVAL7498:fix/inspector-agenda-pick-target
Open

fix(core): select tagged text inside Agenda-style wrappers#430
PARZIVAL7498 wants to merge 1 commit into
1weiho:mainfrom
PARZIVAL7498:fix/inspector-agenda-pick-target

Conversation

@PARZIVAL7498

@PARZIVAL7498 PARZIVAL7498 commented Aug 28, 2026

Copy link
Copy Markdown

Summary

  • pickInspectorTarget() was promoting source-tagged inline text (e.g. <span data-slide-loc>) up into untagged Agenda/list wrappers (<li>).
  • findSlideSource() only walks ancestors via closest('[data-slide-loc]'), so selection silently failed with no frame or panel.
  • Keep the tagged inline when the editable container has no data-slide-loc; still promote marks into a tagged <p> as before.
  • Add unit coverage for the Agenda-style case.

Fixes #412

Test plan

  • Render a slide with an Agenda-style helper that wraps slide span children in <li>
  • Enable Inspect and click agenda row text
  • Confirm blue selection frame + Inspect panel open with source loc and editable text
  • Confirm normal <p>a <strong>b</strong></p> still selects the paragraph
  • pnpm test (pick-target.test.ts) and pnpm check

Summary by CodeRabbit

  • Bug Fixes

    • Improved inspector selection for tagged inline text inside untagged Agenda-style containers.
    • Preserved the most specific tagged inline element when selecting nested text.
    • Safely handles cases where no starting element is available.
  • Tests

    • Added coverage for inline tag selection, nested marks, and empty selections.

pickInspectorTarget promoted tagged spans into untagged
list wrappers, so findSlideSource could not resolve loc.

Closes 1weiho#412
@vercel

vercel Bot commented Aug 28, 2026

Copy link
Copy Markdown

@PARZIVAL7498 is attempting to deploy a commit to the open-slide Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b012cf5b-73e0-411d-9ee5-12b4ee4b508b

📥 Commits

Reviewing files that changed from the base of the PR and between 49a8a12 and 971a2f0.

📒 Files selected for processing (3)
  • .changeset/inspector-agenda-pick.md
  • packages/core/src/app/lib/inspector/pick-target.test.ts
  • packages/core/src/app/lib/inspector/pick-target.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.


Walkthrough

The inspector target picker now preserves tagged inline elements during ancestor traversal. New tests model the required DOM behavior and cover Agenda-style wrappers, nested marks, and null input. A patch Changeset documents the package release.

Changes

Inspector target selection

Layer / File(s) Summary
Preserve tagged inspector targets
packages/core/src/app/lib/inspector/pick-target.ts, .changeset/inspector-agenda-pick.md
pickInspectorTarget tracks tagged inline ancestors and returns them when the editable container is untagged. The Changeset marks @open-slide/core for a patch release.
Validate target selection
packages/core/src/app/lib/inspector/pick-target.test.ts
Fake DOM classes and Vitest setup cover tagged inline elements inside untagged list items, nested marks inside tagged paragraphs, and null input.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 971a2

The change fixes inspector selection for Agenda-style wrapped text while preserving existing paragraph selection behavior; no actionable merge-blocking risk remains after normal checks and review.

Poem

I’m a rabbit inspecting the row,
Keeping tagged spans where they grow.
Through wrappers I hop,
At the right mark I stop,
And clean tests confirm what I know.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'fix(core): select tagged text inside Agenda-style wrappers' directly describes the main change. The fix addresses inspector selection for source-tagged inline text inside untag…
Linked Issues check ✅ Passed The pull request satisfies all requirements from the linked issue #412. The pickInspectorTarget() function now preserves source-tagged inline elements when their editable container lacks `data-slide…
Out of Scope Changes check ✅ Passed All changes are directly scoped to the fix for inspector selection in Agenda-style wrappers. The changeset file documents the patch release. The test file introduces fake DOM classes and tests the spe…
Full details: Title check

Explanation

The pull request title 'fix(core): select tagged text inside Agenda-style wrappers' directly describes the main change. The fix addresses inspector selection for source-tagged inline text inside untagged Agenda/list wrappers by preserving the tagged inline element instead of promoting it to an untagged wrapper. The title is concise, specific, and accurately summarizes the primary objective of the changeset.

Full details: Linked Issues check

Explanation

The pull request satisfies all requirements from the linked issue #412. The pickInspectorTarget() function now preserves source-tagged inline elements when their editable container lacks data-slide-loc, preventing incorrect promotion to untagged &lt;li&gt; elements before source resolution. This enables the inspector to select and display source location for text rendered by the Agenda primitive. The changes include modified logic in pick-target.ts to track tagged inline ancestors, comprehensive unit tests covering the Agenda-style wrapper scenario, and a changeset entry documenting the fix. All coding requirements are met: preserve tagged inline text, show selection frame, open the inspector panel with source location, and prevent promotion of tagged inline elements to untagged containers.

Full details: Out of Scope Changes check

Explanation

All changes are directly scoped to the fix for inspector selection in Agenda-style wrappers. The changeset file documents the patch release. The test file introduces fake DOM classes and tests the specific scenario of tagged inline text inside untagged list items. The pick-target.ts modification implements the core fix by tracking and returning tagged inline ancestors. No modifications to unrelated functionality, dependencies, build configuration, or other components are present. All changes serve the stated objective of fixing the inspector selection behavior.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch

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.

@stantheman0128

Copy link
Copy Markdown

Same #412 hole, after #424 extracted pickInspectorTarget. Support that layer.

The keep still promotes a tagged inline into a tagged wrapper host. Walking past the loc-tagged span, then hitting <div data-slide-loc> with only inline children, returns the host because taggedInline is only preferred when the container has no loc. Agenda wrappers are untagged <li>, so that path works. The tagged-wrapper steal is the case #428 returns on immediately via isTaggedInlineText.

This PR is unit tests only. #428 also has the Agenda e2e for that keep. I can rebase #428 on request.

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.

[Bug]: Inspector cannot select text inside the Agenda primitive

2 participants