Skip to content

fix: prevent accidental persona editor dismissal#9238

Open
Last-emo-boy wants to merge 1 commit into
AstrBotDevs:masterfrom
Last-emo-boy:fix/8481-persona-dialog
Open

fix: prevent accidental persona editor dismissal#9238
Last-emo-boy wants to merge 1 commit into
AstrBotDevs:masterfrom
Last-emo-boy:fix/8481-persona-dialog

Conversation

@Last-emo-boy

@Last-emo-boy Last-emo-boy commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Fixes #8481

Modifications / 改动点

  • Make the persona editor dialog persistent so outside clicks do not discard unsaved edits.

  • Use Vuetify persistent behavior; scrim and Escape dismissal are disabled while explicit cancel, save, and delete close paths remain unchanged.

  • This is NOT a breaking change. / 这不是一个破坏性变更。

Screenshots or Test Results / 运行截图或测试结果

  • corepack pnpm@10.28.2 --dir dashboard run build: passed (includes vue-tsc --noEmit and vite build)
  • git diff --check: passed

Checklist / 检查清单

  • The behavior was discussed in the linked issue.
  • My changes have been well-tested, and verification results are provided above.
  • No new dependencies are introduced.
  • My changes do not introduce malicious code.

Summary by Sourcery

Bug Fixes:

  • Prevent persona editor dialog from closing on outside clicks or Escape, preserving unsaved changes until an explicit action is taken.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request adds the persistent prop to the v-dialog component in PersonaForm.vue to prevent the dialog from closing accidentally. There are no review comments, and I have no additional feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@Last-emo-boy
Last-emo-boy force-pushed the fix/8481-persona-dialog branch from 940f93c to 8cb93d3 Compare July 14, 2026 02:43
@Last-emo-boy
Last-emo-boy marked this pull request as ready for review July 14, 2026 02:49
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. area:webui The bug / feature is about webui(dashboard) of astrbot. feature:persona The bug / feature is about astrbot AI persona system (system prompt) labels Jul 14, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • Making the dialog persistent disables both scrim and Escape key dismissal; consider whether you want to keep Escape as an explicit close path (e.g., by handling keydown) so keyboard users still have a quick way to exit without losing unsaved-change protection.
  • With the dialog now persistent, double-check that all flows that previously relied on clicking outside to cancel (e.g., quick-view scenarios) still have an obvious cancel/close affordance in the UI, especially on smaller screens.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Making the dialog `persistent` disables both scrim and Escape key dismissal; consider whether you want to keep Escape as an explicit close path (e.g., by handling keydown) so keyboard users still have a quick way to exit without losing unsaved-change protection.
- With the dialog now persistent, double-check that all flows that previously relied on clicking outside to cancel (e.g., quick-view scenarios) still have an obvious cancel/close affordance in the UI, especially on smaller screens.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@Last-emo-boy

Copy link
Copy Markdown
Contributor Author

Reviewed: disabling both scrim and Escape dismissal is intentional for unsaved-form protection. The existing explicit Cancel, Save, and Delete paths remain unchanged, and this behavior is now stated in the PR body. Adding a separate Escape handler would restore an accidental data-loss path and broaden the change.

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

Labels

area:webui The bug / feature is about webui(dashboard) of astrbot. feature:persona The bug / feature is about astrbot AI persona system (system prompt) size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] 编辑AI人格时点击外部区域时不自动关闭

1 participant