Skip to content

fix: reset editors when switching prompts - #316

Merged
CNSeniorious000 merged 2 commits into
mainfrom
fix/prompt-navigation
Oct 30, 2026
Merged

CNSeniorious000 merged 2 commits into
mainfrom
fix/prompt-navigation

Conversation

@CNSeniorious000

@CNSeniorious000 CNSeniorious000 commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Start a fresh editing session when the prompt slug changes; preserve unsaved edits for query-only navigation. Serialize prompt runs on shared Pyodide, prepare context before execution, and ignore output or startup from an unmounted page.

Verified production navigation and Monaco cleanup. Chromium tests of the real page with deferred runtime stubs cover navigation before startup and during a running prompt: runs do not overlap and old output stays out of the new page. Build and lint pass.

Closes #313. Based on #310 to preserve its run-button accessibility changes; merge #310 first.

@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@vercel

vercel Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Project Deployment Actions Updated
promplate-docs Ready Ready Preview Oct 29, 2026 11:40pm UTC

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-29T23:38:55.097883Z 1a24743 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@sourcery-ai sourcery-ai 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.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="src/routes/prompts/[...slug]/+layout.svelte" line_range="7" />
<code_context>
+  const { children, params }: LayoutProps = $props();
+</script>
+
+{#key params.slug}
+  {@render children()}
+{/key}
</code_context>
<issue_to_address>
**New prompt shows stale output**

When navigation changes the slug while the previous page's Python run is pending or waiting for `getPy()`, the destroyed page's `onMount` resumes after `getPy()` and calls `reRun()` with its old prompt while the new page starts `py.runPythonAsync` on shared Pyodide; the new `setStdout` handler receives old output, and overlapping execution can fail, so the new prompt shows stale or incorrect output or a run error.

Invalidate runs from the previous page and serialize access to shared Pyodide so an obsolete page cannot start an old-prompt run or route its output to the new page.
</issue_to_address>

Sourcery assessment

Approval pending. 1 finding to address first.

Blocking findings: src/routes/prompts/[...slug]/+layout.svelte:7


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@sourcery-ai sourcery-ai 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.

Sourcery assessment

Approved.

@vercel

vercel Bot commented Oct 29, 2026

Copy link
Copy Markdown

Deployment failed for project promplate-docs with the following error:

Resource is limited - try again in 24 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/promplate?upgradeToPro=build-rate-limit

@CNSeniorious000
CNSeniorious000 changed the base branch from main to fix/control-accessible-names October 29, 2026 09:39
Base automatically changed from fix/control-accessible-names to main October 29, 2026 23:12
@CNSeniorious000
CNSeniorious000 merged commit f9f5e94 into main Oct 30, 2026
13 checks passed
@CNSeniorious000
CNSeniorious000 deleted the fix/prompt-navigation branch October 30, 2026 00:00
@promplate promplate deleted a comment from coderabbitai Bot Oct 30, 2026

This branch was successfully deployed

1 active deployment
Preview — 1a24743e Deployed Oct 29, 2026 by vercel[bot]
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.

Navigating between prompts keeps the previous prompt text

1 participant