dbeaver/pro#9948 fix: show unsaved changes dialog on tab change - #4544
Conversation
fixes bug with tabs fire executors twice
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 11 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
| @injectable(() => [OptionsPanelService, UserInfoResource, UserProfileTabsService]) | ||
| export class UserProfileOptionsPanelService extends BaseOptionsPanelService<string | undefined> { | ||
| readonly onOpen: ISyncExecutor; | ||
| readonly onBeforeTabChange: IExecutor<string>; |
There was a problem hiding this comment.
This logic should not be here (tabs logic). Please move it to userProfileTabsService. Call userProfileTabsService.open(SETTINGS_TAB), where you need it. Also userProfileTabsService open method should call UserProfileOptionsPanelService.open
| import type { IUserProfileFormAuthenticationState } from './IUserProfileFormAuthenticationState.js'; | ||
|
|
||
| @injectable() | ||
| export class UserProfileFormAuthenticationService { |
There was a problem hiding this comment.
maybe we can use FormState & FormPart api we already have? it gives much more opportunities considering form flow
There was a problem hiding this comment.
cause basically your api here repeats api of the form part
| await this.confirmDiscardChanges(contexts); | ||
| } | ||
|
|
||
| private async confirmDiscardChanges(contexts: IExecutionContextProvider<any>): Promise<void> { |
There was a problem hiding this comment.
also partially repeats form api logic
…hen-switching-tabs-in-the-public-ui
…hen-switching-tabs-in-the-public-ui
A tab click triggered
openExecutortwice: once fromuseTab.handleOpencallingstate.open(). And again from Ariakit's ownonClickcallingstore.setSelectedId()→select(). SinceTabsStatealready wires the Ariakit store toopenExecutorin both controlled and uncontrolled modes, the explicitstate.open()call is redundant.Screen.Recording.2026-08-11.at.09.16.54.mov
Screen.Recording.2026-08-11.at.09.24.34.mov
Screen.Recording.2026-08-11.at.09.18.09.mov