Skip to content

Harden review session lifecycle, fix annotation-mode UX drift/misfires, and add Plan→Draft→Refine + reveal extensibility hooks#7

Draft
Copilot wants to merge 5 commits into
mainfrom
copilot/fix-start-review-server-accumulation
Draft

Harden review session lifecycle, fix annotation-mode UX drift/misfires, and add Plan→Draft→Refine + reveal extensibility hooks#7
Copilot wants to merge 5 commits into
mainfrom
copilot/fix-start-review-server-accumulation

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 30, 2026

Hands-on usage surfaced four gaps: repeated start_review leaked servers, annotation interactions were error-prone (pin drift + accidental captures + no light-dismiss), the reveal pipeline was too rigid to extend, and workflow guidance skipped narrative planning before drafting.

  • Review server lifecycle

    • start_review now closes any existing running server for the same deckDir before starting a new one.
    • Prevents orphan Fastify instances from accumulating across iteration rounds.
  • Overlay annotation UX correctness

    • Pins are now rendered in a per-slide layer inside the active <section> and positioned in section-relative coordinates (instead of viewport/scroll absolute positioning), so they stay aligned under reveal scaling/transforms.
    • Annotation capture now ignores reveal navigation UI (.controls, .progress, etc.) and applies mis-tap filtering (movement threshold + primary-click/modifier guard).
    • Popovers now support light-dismiss via outside pointer interaction.
  • Rendering pipeline extensibility (minimal surface area)

    • Added optional buildDeck hooks:
      • customCssPath (append user CSS),
      • templatePath (custom HTML template with {{DECKMARK_*}} placeholders),
      • markedPlugins (load local modules exporting default/register(marked)).
    • Exposed via MCP build_deck inputs: customCss, template, markedPlugins.
  • Workflow guidance: add planning phase

    • Updated deck skill/docs to explicit Plan → Draft → Refine flow.
    • Planning now calls out audience/goal alignment, core arguments, arc, and one-key-point-per-slide outline before content.md drafting.
  • Coverage updates

    • Integration test now verifies repeated start_review replaces prior session for same deck.
    • Engine unit tests cover custom template/CSS rendering and marked plugin loading.
// mcp/tools/build.ts (new optional inputs)
await buildDeck({
  contentPath,
  outDir,
  customCssPath: opts.customCss ? resolve(cwd, opts.customCss) : undefined,
  templatePath: opts.template ? resolve(cwd, opts.template) : undefined,
  markedPlugins: opts.markedPlugins?.map(p => resolve(cwd, p))
});

Copilot AI changed the title [WIP] Fix accumulation of servers in start_review function Harden review session lifecycle, fix annotation-mode UX drift/misfires, and add Plan→Draft→Refine + reveal extensibility hooks May 30, 2026
Copilot AI requested a review from sowenzhang May 30, 2026 03:46
@sowenzhang sowenzhang requested a review from Copilot May 30, 2026 03:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens the deck review lifecycle, improves annotation UX, and adds extensibility hooks for reveal deck rendering while updating workflow guidance toward Plan → Draft → Refine.

Changes:

  • Replaces existing review sessions for the same deck before starting a new review.
  • Improves overlay annotation behavior with section-local pins, ignored reveal UI targets, mis-tap filtering, and popover light-dismiss.
  • Adds custom CSS/template/marked plugin build hooks plus tests and documentation updates.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
mcp/tools/review.ts Adds replacement behavior for existing review servers for the same deck.
mcp/tools/build.ts Exposes custom CSS, template, and marked plugin inputs to build_deck.
runtime/engines/reveal.ts Adds rendering extensibility hooks and per-build marked renderer support.
runtime/overlay/pin.ts Moves annotation pins into per-slide layers with section-relative placement.
runtime/overlay/annotation-mode.ts Adds mis-tap filtering and ignores reveal navigation/chrome targets.
runtime/overlay/popover.ts Adds outside-pointer light-dismiss behavior.
test/unit/engines-reveal.test.ts Adds coverage for custom CSS/template rendering and marked plugin loading.
test/integration/mcp-flow.test.ts Verifies repeated start_review replaces the prior session.
skills/deckmark/SKILL.md Updates workflow guidance to Plan → Draft → Refine.
README.md Documents planning flow and new build tool inputs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread runtime/overlay/pin.ts Outdated
Comment on lines +39 to +40
pin.style.left = `${rect.left - sectionRect.left - 12}px`;
pin.style.top = `${rect.top - sectionRect.top - 12}px`;
Comment thread mcp/tools/build.ts Outdated
Comment on lines +86 to +88
customCssPath: opts.customCss ? resolve(cwd, opts.customCss) : undefined,
templatePath: opts.template ? resolve(cwd, opts.template) : undefined,
markedPlugins: opts.markedPlugins?.map(p => resolve(cwd, p))
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented in 1185ea2. build_deck now resolves customCss, template, and markedPlugins paths and rejects any that escape the requested dir.

Comment thread mcp/tools/review.ts
Comment on lines +37 to +40
const existing = [...running.values()].filter(r => r.deckDir === deckDir);
for (const r of existing) {
try { await r.app.close(); } catch { /* ignore */ }
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in commit 4da9071. Before closing the old Fastify instance, closeSession is now called on the replaced session so its file is updated with closed: true. Any in-progress wait_for_close poll reading that session will detect it and return promptly instead of waiting until timeout.

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.

Feedback: Architecture and UX improvements from hands-on testing

3 participants