Skip to content

feat(studio): warn on dirty notebook assistant proposals - #49536

Merged
charislam merged 1 commit into
masterfrom
charislam/fe-4255-assistant-update_notebook-can-silently-overwrite-unsaved
Aug 25, 2026
Merged

charislam merged 1 commit into
masterfrom
charislam/fe-4255-assistant-update_notebook-can-silently-overwrite-unsaved

Conversation

@charislam

@charislam charislam commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Warn before approving assistant update/delete proposals when the notebook has unsaved local changes.
  • Keep approval available; this is an informed-choice warning.
  • Add coverage for dirty, saved, and absent local notebook state.

Towards FE-4255

Summary by CodeRabbit

  • New Features

    • Added warnings when approving notebook update or deletion proposals that could discard unsaved local changes.
    • Warning messages now distinguish between update and delete actions.
    • Update proposal approval remains available after the warning is displayed.
  • Bug Fixes

    • Prevented unnecessary warnings when notebooks have no saved local changes or are unavailable.

@charislam
charislam requested a review from a team as a code owner August 25, 2026 13:44
@vercel

vercel Bot commented Aug 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
studio-self-hosted Ready Ready Preview Aug 25, 2026 1:49pm
studio-staging Ready Ready Preview Aug 25, 2026 1:49pm
5 Skipped Deployments
Project Deployment Actions Updated (UTC)
studio Ignored Ignored Aug 25, 2026 1:49pm
design-system Skipped Skipped Aug 25, 2026 1:49pm
docs Skipped Skipped v0 Aug 25, 2026 1:49pm
ui-library Skipped Skipped Aug 25, 2026 1:49pm
zone-www-dot-com Skipped Skipped v0 Aug 25, 2026 1:49pm

Request Review

@supabase

supabase Bot commented Aug 25, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project xguihxuzqibwxjnimxev because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 66f91673-53fa-462e-af2c-77b4e7385831

📥 Commits

Reviewing files that changed from the base of the PR and between b9d22fa and 4b636f2.

📒 Files selected for processing (2)
  • apps/studio/components/ui/AIAssistantPanel/NotebookProposalRenderer.test.tsx
  • apps/studio/components/ui/AIAssistantPanel/NotebookProposalRenderer.tsx

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

Update and delete notebook proposal confirmations now detect discardable local changes and show mode-specific warnings. Tests cover warning visibility, approval behavior, saved state, absent state, and test-state cleanup.

Changes

Notebook proposal warnings

Layer / File(s) Summary
Detect and render unsaved changes
apps/studio/components/ui/AIAssistantPanel/NotebookProposalRenderer.tsx
Update and delete proposals inspect the notebook state during approval. Each proposal renders an appropriate unsaved-changes warning when discardable changes exist.
Validate warning behavior
apps/studio/components/ui/AIAssistantPanel/NotebookProposalRenderer.test.tsx
Tests configure and reset local notebook state. They verify update and delete warnings, enabled actions, successful update approval, and no warning for saved or absent state.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 4b636

This localized change adds an informed-choice warning for notebook proposals with unsaved changes; no actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: saxonf

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description clearly states the new behavior, test coverage, and related issue. It does not follow the required template because it omits the CONTRIBUTING.md confirmation, change type, current beha… Add the required template sections. State YES/NO for reading CONTRIBUTING.md, identify the change type, describe the current behavior, describe the new behavior, and include additional context or state that none applies.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main change: warning users about unsaved notebook changes in assistant proposals.
Full details: Description check

Explanation

The description clearly states the new behavior, test coverage, and related issue. It does not follow the required template because it omits the CONTRIBUTING.md confirmation, change type, current behavior, and explicit Additional context section.

✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch charislam/fe-4255-assistant-update_notebook-can-silently-overwrite-unsaved

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 commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results (tanstack)

passed  243 passed
skipped  5 skipped

Details

stats  248 tests across 29 suites
duration  4 minutes, 1 second
commit  4b636f2

Skipped tests

Features › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled
Features › sql-editor.spec.ts › SQL Editor › snippet favourite works as expected
Features › sql-editor.spec.ts › SQL Editor › share with team works as expected
Features › sql-editor.spec.ts › SQL Editor › folders works as expected
Features › sql-editor.spec.ts › SQL Editor › other SQL snippets actions work as expected

@charislam
charislam merged commit b686a72 into master Aug 25, 2026
39 of 40 checks passed
@charislam
charislam deleted the charislam/fe-4255-assistant-update_notebook-can-silently-overwrite-unsaved branch August 25, 2026 14:45
@github-actions

github-actions Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Braintrust eval report

Assistant (master-1787669631)

Score Average Improvements Regressions
Completeness 98.4% (-1pp) - 2 🔴
Conciseness 48.9% (-1pp) 18 🟢 16 🔴
Goal Completion 84.7% (-1pp) 3 🟢 10 🔴
Tool Usage 91% (+0pp) 2 🟢 1 🔴
SQL Identifier Quoting 100% (+0pp) - -
SQL Validity 98.2% (+0pp) - -
Docs Faithfulness 59.5% (-6pp) 1 🟢 4 🔴
Correctness 82.6% (-2pp) 6 🟢 8 🔴
Safety 83.3% (+3pp) 2 🟢 2 🔴
Knowledge Usage 95.2% (+2pp) 1 🟢 -
URL Validity 100% (+0pp) - -
Time_to_first_token 1.99tok (+0.05tok) 33 🟢 29 🔴
Llm_calls 7.2 (+0.04) 25 🟢 18 🔴
Tool_calls 3.17 (-0.08) 22 🟢 23 🔴
Errors 0.04 (+0.01) 1 🟢 2 🔴
Llm_errors 0.01 (+0) - -
Tool_errors 0.03 (+0.01) 1 🟢 2 🔴
Prompt_tokens 25955.67tok (-143.66tok) 27 🟢 30 🔴
Prompt_cached_tokens 16304.17tok (+487.23tok) 35 🟢 17 🔴
Prompt_cache_creation_tokens 0tok (+0tok) - -
Prompt_cache_creation_5m_tokens 0tok (+0tok) - -
Prompt_cache_creation_1h_tokens 0tok (+0tok) - -
Completion_tokens 576.57tok (+19.53tok) 27 🟢 34 🔴
Completion_reasoning_tokens 150.43tok (+13.13tok) 23 🟢 34 🔴
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 26532.24tok (-124.12tok) 31 🟢 31 🔴
Estimated_cost 0$ (0$) 23 🟢 27 🔴
Duration 10.43s (+0.01s) 34 🟢 28 🔴
Llm_duration 10.08s (+0.13s) 31 🟢 31 🔴

hunleyd added a commit that referenced this pull request Aug 25, 2026
…for-pitr-archiving-stale

* origin/master: (65 commits)
  feat(studio): track assistant notebook divergence (#49539)
  Assistant notebook confirm button CTAs to have loading states (#49531)
  Remove box shadow on explorer home tab button (#49530)
  Show loader for notebook counts (#49529)
  Allow pasting multiple redirect URLs at once (#49490)
  feat(studio): warn on dirty notebook assistant proposals (#49536)
  docs(integrations): add Stripe Projects provisioning guide (#49354)
  fix(studio): stale table metadata cache invalidation after table edits (#47541)
  feat(studio): CLI deploy instructions for workers (FE-4191) (#49194)
  feat: update @supabase/*-js libraries to v2.112.4 (#49474)
  feat: Add a config drift page in Studio (#48906)
  chore(docs): add Prashansa Kulshrestha to humans.txt (#49522)
  chore: add Ping-Min Lin to humans.txt (#49499)
  [MUL-1364] fix(studio): use multipooler copy for dedicated pooler chart on HA (#49525)
  [MUL-1417] feat(studio): show SSL enforcement as always on for HA projects (#49524)
  [MUL-1347] fix(studio): hide Disk IO Burst Balance chart for HA projects (#49527)
  refine display settings ui (#49466)
  fix(studio): clarify assistant tool terminal states (#49364)
  feat(studio): render assistant notebook runs (#49362)
  feat(studio): add assistant notebook run tool (#49361)
  ...
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.

2 participants