Skip to content

fix: embedded page batch operations, jargon re-learn overwrite, and UI polish#214

Closed
YumemiDream wants to merge 5 commits into
NickCharlie:mainfrom
YumemiDream:fix/embedded-page-confirm-modal
Closed

fix: embedded page batch operations, jargon re-learn overwrite, and UI polish#214
YumemiDream wants to merge 5 commits into
NickCharlie:mainfrom
YumemiDream:fix/embedded-page-confirm-modal

Conversation

@YumemiDream

Copy link
Copy Markdown
Contributor

Fixes #211, Fixes #212, Fixes #213

Summary

修复内嵌 Plugin Page 的三个问题:批量操作在 sandbox iframe 中失效、学习系统覆盖手动编辑的黑话、已确认黑话仍显示确认/驳回按钮。

Changes

1. 批量操作修复 (#211)

  • 新增 showConfirm() 函数,基于 <dialog> 元素实现自定义确认弹窗
  • 替换 3 处 window.confirm() 调用(审查队列、黑话学习、表达方式学习)

2. 黑话学习保护 (#212)

  • v2_learning_integration.py:学习前检查 is_complete,跳过已手动编辑的黑话
  • 保留已有记录的 count,不再重置为 1

3. UI 改进 (#213)

  • 已确认黑话隐藏「确认」「驳回」按钮
  • 黑话编辑弹窗 textarea 高度从 4 行增加到 10 行
  • 弹窗宽度从 760px 增加到 900px

Type of Change

  • Bug fix
  • New feature
  • Refactoring
  • Documentation update

Checklist

  • Code follows the project's coding style
  • Self-reviewed the code changes
  • No new warnings or errors introduced
  • Tested in sandboxed iframe environment

YumemiDream and others added 5 commits June 16, 2026 19:16
The embedded Plugin Page runs inside a sandboxed iframe without
'allow-modals', so window.confirm() calls are silently blocked by the
browser. This caused all batch operations (approve/reject/delete) on
the reviews, jargon, and expression-learning pages to appear unresponsive.

Replace all window.confirm() calls with a custom showConfirm() function
that renders a confirmation dialog using the existing <dialog> element,
which works within sandbox restrictions.
…nferred

When the v2 learning system encounters a jargon term that already exists
and is_complete=True (manually edited or fully inferred), skip the save
to prevent overwriting the user's edits.

Also preserve the existing count when updating an existing record,
instead of resetting it to 1.

Fixes: manually edited jargon meanings get overwritten by re-learning.
The jargon list showed confirm and reject buttons for all items
regardless of status. For already confirmed jargon, these buttons
were no-ops and confusing.

Now only unconfirmed items show the approve/reject buttons.

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

Sorry @YumemiDream, your pull request is larger than the review limit of 150000 diff characters

@EterUltimate

Copy link
Copy Markdown
Collaborator

Dev 分支已在 commit 65e4405 以更小 diff 修复本 PR 覆盖的 #211/#212/#213,并补了针对性测试。

这里不再合并该 PR,避免引入整文件换行/大范围样式 diff 以及未覆盖的额外变更。对应 issue 已按 65e4405 的证据关闭。

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

Labels

None yet

Projects

None yet

2 participants