-
Notifications
You must be signed in to change notification settings - Fork 5.6k
fix: add confirmation dialog for extraction history deletion #2497
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 3 commits
6d3051a
78ec9ac
1672a69
b740e69
6d6e2a4
7a42c81
6360dec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1364,6 +1364,7 @@ export function MemorySection({ | |
| }, [indexDraft, fireFlash]); | ||
|
|
||
| const onDeleteExtraction = useCallback(async (id: string) => { | ||
| if (!window.confirm(t('settings.memoryExtractionDeleteConfirm'))) return; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This new confirmation branch needs the web tests to opt into the confirmed path. The live
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The new confirm guard is correct for users, but the existing
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This new confirmation guard changes the existing single-row delete path, but the web component test for |
||
| // Optimistic removal: drop the row immediately so the click feels | ||
| // instant. The SSE 'deleted' event will arrive moments later and is | ||
| // a no-op against an already-removed id; if the request fails we | ||
|
|
@@ -1373,7 +1374,7 @@ export function MemorySection({ | |
| if (!ok) { | ||
| void reloadExtractions(); | ||
| } | ||
| }, [reloadExtractions]); | ||
| }, [reloadExtractions, t]); | ||
|
|
||
| const onClearExtractions = useCallback(async () => { | ||
| if (!window.confirm(t('settings.memoryExtractionsClearConfirm'))) return; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2148,6 +2148,8 @@ export const en: Dict = { | |
| 'settings.memoryExtractionWritten': 'written', | ||
| 'settings.memoryExtractionDuration': 'in', | ||
| 'settings.memoryExtractionDelete': 'Delete', | ||
| 'settings.memoryExtractionDeleteConfirm': | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The new Useful? React with 👍 / 👎.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This new key is only added to |
||
| 'Delete this extraction record? This cannot be undone.', | ||
| 'settings.memoryExtractionsClear': 'Clear', | ||
| 'settings.memoryExtractionsClearTitle': 'Clear all extraction history', | ||
| 'settings.memoryExtractionsClearConfirm': | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -564,6 +564,7 @@ export interface Dict { | |
| 'settings.memoryExtractionWritten': string; | ||
| 'settings.memoryExtractionDuration': string; | ||
| 'settings.memoryExtractionDelete': string; | ||
| 'settings.memoryExtractionDeleteConfirm': string; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line makes
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding |
||
| 'settings.memoryExtractionsClear': string; | ||
| 'settings.memoryExtractionsClearTitle': string; | ||
| 'settings.memoryExtractionsClearConfirm': string; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This call now uses
🔁 Powered by Looper · runner=reviewer · agent=codex · An autonomous AI dev team for your GitHub repos.settings.memoryExtractionDeleteConfirm, but that key is still not declared inapps/web/src/i18n/types.tsand is only present inen.tsandzh-CN.ts. The i18n provider typestaskeyof Dictand each locale asDict, so this changed line is outside the typed key set and the other locale dictionaries remain missing the required entry once the key is added. That can keep@open-design/webfrom typechecking/building even though the confirmation behavior itself is correct. Please addsettings.memoryExtractionDeleteConfirmtoDictnext tosettings.memoryExtractionDelete, then add the corresponding value to every locale file underapps/web/src/i18n/locales/using localized text or the existing English fallback pattern used nearby.