-
Notifications
You must be signed in to change notification settings - Fork 0
Add loaded dialog prototype #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Changelog | ||
|
|
||
| ## 0.0.0 - 2026-08-17 | ||
|
|
||
| - Created the Loaded Dialog prototype scaffold. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # Loaded Dialog | ||
|
|
||
| Shows a dialog confirming that the extension has loaded. | ||
|
|
||
| ## Status | ||
|
|
||
| Internal prototype for evaluation by Discourse Graphs. | ||
|
|
||
| ## Features | ||
|
|
||
| - Opens a Blueprint alert when the extension loads. | ||
| - Confirms that the extension loaded successfully with a single **Got it** action. | ||
|
|
||
| ## Install | ||
|
|
||
| Load this developer-extension URL in Roam: | ||
|
|
||
| ```text | ||
| https://discoursegraphs.com/releases/prototypes/loaded-dialog/ | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| { | ||
| "name": "loaded-dialog", | ||
| "version": "0.0.0", | ||
| "private": true, | ||
| "description": "Shows a dialog confirming that the extension has loaded.", | ||
| "type": "module", | ||
| "scripts": { | ||
| "start": "roam-prototype dev", | ||
| "build": "roam-prototype build", | ||
| "test": "vitest run --passWithNoTests" | ||
| }, | ||
| "dependencies": { | ||
| "roamjs-components": "catalog:", | ||
| "use-sync-external-store": "catalog:" | ||
| }, | ||
| "devDependencies": { | ||
| "@discoursegraphs/extension-base": "workspace:*", | ||
| "jsdom": "catalog:", | ||
| "vitest": "catalog:" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| import { render as renderAlert } from "roamjs-components/components/SimpleAlert"; | ||
| import { runExtension } from "roamjs-components/util"; | ||
| import "./styles.css"; | ||
|
|
||
| export default runExtension(async () => { | ||
| await renderAlert({ | ||
| content: "Loaded Dialog has loaded successfully.", | ||
| confirmText: "Got it", | ||
| }); | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| .dg-prototype-loaded-dialog { | ||
| --dg-prototype-name: "loaded-dialog"; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| const base = require("../../packages/extension-base/tailwind.config.cjs"); | ||
|
|
||
| module.exports = { | ||
| ...base, | ||
| content: ["./src/**/*.{js,jsx,ts,tsx}"], | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "extends": "../../packages/extension-base/tsconfig.json", | ||
| "compilerOptions": { | ||
| "baseUrl": ".", | ||
| "paths": { | ||
| "~/*": [ | ||
| "./src/*" | ||
| ] | ||
| } | ||
| }, | ||
| "include": [ | ||
| "src", | ||
| "tests", | ||
| "vitest.config.ts" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import { defineConfig } from "vitest/config"; | ||
|
|
||
| export default defineConfig({ | ||
| test: { | ||
| environment: "jsdom", | ||
| restoreMocks: true, | ||
| }, | ||
| }); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Dialog can stay on screen after the extension is turned off
The confirmation dialog is opened without keeping any handle to close it (
renderAlert(...)atprototypes/loaded-dialog/src/index.ts:6-9) and no cleanup step is returned, so a dialog still on screen when the extension is disabled or reloaded stays there forever.Impact: A user who disables or reloads the extension while the dialog is open is left with a stuck dialog, and reloading repeatedly can stack leftover dialogs.
Overlay mount is never registered with the runExtension lifecycle
roamjs-components/components/SimpleAlert'srenderis built withcreateOverlayRender, which appends its own container to the document and returns an unmount function. The prototype discards that return value and, unlike the scaffold template (packages/extension-base/template/src/index.ts:17-21), does not return anunloadhandler from therunExtensioncallback, so nothing removes the container or unmounts the React tree at unload time.AGENTS.mdrequires "Dispose observers, listeners, commands, timers, and mounted UI when the extension unloads", andpackages/extension-base/skills/react-rendering/SKILL.md:23requires owned React roots/containers to be registered for cleanup. The PR description's claim thatrunExtensionowns the mounted alert does not hold because the overlay is mounted outside the registry.Was this helpful? React with 👍 or 👎 to provide feedback.