Summary
When using the Inspector to add a comment on a rendered element that comes from a shared component (e.g. a <Heading> or <PageShell> component defined once in the slide file and reused across multiple pages), the @slide-comment marker is written into the shared component's definition, not the call site.
This means the marker cannot be resolved to a specific page — the agent (or human) reading the marker has no way to determine which page the comment was meant for.
Environment
Minimal reproduction
const PageShell = ({ children, heading }: { children: React.ReactNode; heading?: string }) => (
<section>
{heading ? <h2>{heading}</h2> : null}
<div>{children}</div>
</section>
);
const PageA: Page = () => <PageShell heading="Intro">content A</PageShell>;
const PageB: Page = () => <PageShell heading="Details">content B</PageShell>;
- Open
PageA in the editor.
- Use Inspector → click on the
<h2> heading → add a comment: "change this title".
- Observe: the
@slide-comment marker lands inside PageShell definition, not inside PageA.
Actual behavior
The comment lands at the shared component definition. Neither an agent nor a human reading the source can determine which page the comment was targeting. The only workaround is to ask the user which page they were viewing — which breaks the headless apply-comments workflow.
Expected behavior
The comment should be placed in or near the call site (the specific page component) so the target page is unambiguous. If that's not feasible with React's source mapping, the inspector could at minimum warn the user that the element belongs to a shared component and the comment will land at the definition site.
Related
Summary
When using the Inspector to add a comment on a rendered element that comes from a shared component (e.g. a
<Heading>or<PageShell>component defined once in the slide file and reused across multiple pages), the@slide-commentmarker is written into the shared component's definition, not the call site.This means the marker cannot be resolved to a specific page — the agent (or human) reading the marker has no way to determine which page the comment was meant for.
Environment
@open-slide/core@1.10.0Minimal reproduction
PageAin the editor.<h2>heading → add a comment: "change this title".@slide-commentmarker lands insidePageShelldefinition, not insidePageA.Actual behavior
The comment lands at the shared component definition. Neither an agent nor a human reading the source can determine which page the comment was targeting. The only workaround is to ask the user which page they were viewing — which breaks the headless apply-comments workflow.
Expected behavior
The comment should be placed in or near the call site (the specific page component) so the target page is unambiguous. If that's not feasible with React's source mapping, the inspector could at minimum warn the user that the element belongs to a shared component and the comment will land at the definition site.
Related