Skip to content

Add stock base dialog prototype - #5

Closed
mdroidian wants to merge 2 commits into
mainfrom
agent/add-stock-base-dialog-prototype
Closed

Add stock base dialog prototype#5
mdroidian wants to merge 2 commits into
mainfrom
agent/add-stock-base-dialog-prototype

Conversation

@mdroidian

@mdroidian mdroidian commented Aug 17, 2026

Copy link
Copy Markdown
Member

Summary

  • scaffold the stock-base-dialog Roam developer-extension prototype
  • open a confirmation dialog immediately when the extension loads
  • clean up the dialog overlay when the extension unloads
  • use the named runExtension utility export so the production bundle calls the lifecycle wrapper correctly
  • document the prototype and add its workspace dependencies to the lockfile

Why

This provides a minimal stock prototype for confirming that the public prototype scaffold builds, installs, and loads UI successfully in Roam.

Runtime fix

The original default import of roamjs-components/util/runExtension was wrapped as a CommonJS module object in the ESM production bundle. Roam then attempted to call that object, causing TypeError: (0, at.default) is not a function during extension load. Importing the named export from roamjs-components/util emits a direct function call in the bundle.

Impact

Loading the extension displays a simple success dialog with a Close button. It does not read from or write to the user's graph.

Validation

  • inspected the production bundle to confirm it calls runExtension as a function
  • pnpm test — 28 repository tests passed; prototype Vitest command passed with no test files
  • pnpm build
  • production bundle generated with the shared esbuild CLI
  • pnpm prepare:artifacts — prepared one valid artifact set

@github-actions

github-actions Bot commented Aug 17, 2026

Copy link
Copy Markdown

Roam prototype previews

The preview deployment is ready. Paste a URL below into Load Developer Extensions from URL in Roam:

View publishing details

@mdroidian
mdroidian marked this pull request as ready for review August 17, 2026 02:25

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1cd0d0687f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

export default runExtension(async () => {
let closeDialog: (() => void) | undefined;

closeDialog = await renderAlert({

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Register cleanup before awaiting the dialog

SimpleAlert.render resolves only after the alert is dismissed, so while the dialog is visible this initializer remains pending and has not returned its unload callback. If the extension is disabled or reloaded before the user clicks Close, the overlay therefore remains mounted; the resolved value also is not a dialog disposer to save in closeDialog. Mount the alert without blocking lifecycle initialization and register an actual cleanup operation immediately.

AGENTS.md reference: AGENTS.md:L18-L18

Useful? React with 👍 / 👎.

@mdroidian mdroidian closed this Aug 17, 2026
@mdroidian

Copy link
Copy Markdown
Member Author

Initial test run. fixes in #6

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