-
-
Notifications
You must be signed in to change notification settings - Fork 175
revert(gui): remove modal reload refactor series #1137
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
Changes from all commits
3baa1e4
2329535
46f09dc
f6eeb74
4d5b6c3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,6 @@ import GenericInputPrompt from "./GenericInputPrompt/GenericInputPrompt"; | |
| import { ProviderPickerModal } from "./ProviderPickerModal"; | ||
| import GenericYesNoPrompt from "./GenericYesNoPrompt/GenericYesNoPrompt"; | ||
| import type { IconType } from "src/types/IconType"; | ||
| import { ModalReloadController } from "./utils/modalReloadMachine"; | ||
|
|
||
| export class AIAssistantProvidersModal extends Modal { | ||
| public waitForClose: Promise<AIProvider[]>; | ||
|
|
@@ -23,7 +22,6 @@ export class AIAssistantProvidersModal extends Modal { | |
| private selectedProvider: AIProvider | null; | ||
|
|
||
| private _selectedProviderClone: AIProvider | null; | ||
| private readonly reloadController: ModalReloadController; | ||
|
|
||
| constructor(providers: AIProvider[], app: App) { | ||
| super(app); | ||
|
|
@@ -34,14 +32,6 @@ export class AIAssistantProvidersModal extends Modal { | |
| this.rejectPromise = reject; | ||
| this.resolvePromise = resolve; | ||
| }); | ||
| this.reloadController = new ModalReloadController({ | ||
| modalEl: this.modalEl, | ||
| contentEl: this.contentEl, | ||
| render: () => { | ||
| this.contentEl.empty(); | ||
| this.display(); | ||
| }, | ||
| }); | ||
|
|
||
| this.open(); | ||
| this.display(); | ||
|
|
@@ -66,7 +56,9 @@ export class AIAssistantProvidersModal extends Modal { | |
| } | ||
|
|
||
| private reload(): void { | ||
| this.reloadController.requestReload("ai-assistant-providers:reload"); | ||
| this.contentEl.empty(); | ||
|
|
||
| this.display(); | ||
| } | ||
|
|
||
| addProvidersSetting(container: HTMLElement) { | ||
|
|
@@ -385,10 +377,8 @@ export class AIAssistantProvidersModal extends Modal { | |
| this.selectedProvider = null; | ||
| this.reload(); | ||
| this.open(); | ||
| return; | ||
| } | ||
|
|
||
| this.reloadController.destroy(); | ||
| this.resolvePromise(this.providers); | ||
| super.onClose(); | ||
|
Comment on lines
377
to
383
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. 🔴 Missing early The revert removed the (Refers to lines 374-383) Was this helpful? React with 👍 or 👎 to provide feedback. |
||
| } | ||
|
|
||
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.
When
onClose()is triggered while editing a provider (this.selectedProvideris set), the method now falls through toresolvePromise/super.onCloseafter callingthis.open(). This closes the modal instead of returning to the provider list and can persist in-progress edits that users expected to discard (e.g., pressing Esc/X or Cancel-with-changes path), which is a behavior regression from the previous flow.Useful? React with 👍 / 👎.