Skip to content

Fix project action preview settings persistence#3842

Open
keeperxy wants to merge 1 commit into
pingdotgg:mainfrom
keeperxy:fix/persist-project-action-preview-url
Open

Fix project action preview settings persistence#3842
keeperxy wants to merge 1 commit into
pingdotgg:mainfrom
keeperxy:fix/persist-project-action-preview-url

Conversation

@keeperxy

@keeperxy keeperxy commented Jul 9, 2026

Copy link
Copy Markdown

What Changed

  • Preserve previewUrl and autoOpenPreview when creating or updating project actions.
  • Use a shared mapper for both save paths and omit preview settings when the preview URL is cleared.
  • Add regression coverage for saving and removing project action preview settings.

Why

Project actions allow users to configure an optional preview URL. However, when an action was created or edited with a preview URL, saving the action silently discarded both the URL and the associated auto-open preference. Reopening the action therefore showed an empty preview URL field.

The form already included previewUrl and autoOpenPreview in its payload, but ChatView rebuilt the ProjectScript without those fields before calling the project update command. As a result, the preview settings never reached persistence.

Using the same mapper for create and update keeps both save paths consistent. It also ensures that intentionally clearing the preview URL removes the associated preview settings instead of retaining stale values.

Validation

  • pnpm exec vp test apps/web/src/projectScripts.test.ts
  • pnpm exec vp check
  • pnpm exec vp run typecheck

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • No UI changes; screenshots are not applicable
  • No animation or interaction changes; a video is not applicable

Note

Low Risk
Localized persistence fix with unit tests; no auth, security, or broad architectural changes.

Overview
Fixes a bug where project action create/update dropped previewUrl and autoOpenPreview before updateProject, so preview settings never saved even though the form sent them.

Introduces shared buildProjectScript in projectScripts.ts for both save paths. It maps core fields plus preview options when a URL is set, and omits preview fields when previewUrl is null so clearing the URL does not leave stale values. ChatView saveProjectScript / updateProjectScript now call this helper instead of inline ProjectScript objects. Regression tests cover saving preview settings and omitting them when the URL is cleared.

Reviewed by Cursor Bugbot for commit e88ef51. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Fix project action preview settings persistence when saving or updating scripts

  • Adds a buildProjectScript utility in projectScripts.ts that conditionally includes previewUrl and autoOpenPreview only when previewUrl is non-null, omitting those fields otherwise.
  • Updates saveProjectScript and updateProjectScript in ChatView.tsx to use buildProjectScript instead of inline object construction, ensuring preview settings are correctly persisted or cleared.
  • Behavioral Change: Previously, updating a script with a null previewUrl could leave stale preview fields on the stored object; now those fields are explicitly removed.

Macroscope summarized e88ef51.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: c03d6612-1226-40f4-adc0-a26109e2fac7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Jul 9, 2026
@macroscopeapp

macroscopeapp Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved

Straightforward bug fix that adds missing preview settings persistence via a new helper function. The change is small, self-contained, and includes unit tests validating the behavior.

You can customize Macroscope's approvability policy. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant