Skip to content

dbeaver/pro#9948 fix: show unsaved changes dialog on tab change - #4544

Merged
devnaumov merged 6 commits into
develfrom
9948-unsaved-changes-warning-is-not-shown-when-switching-tabs-in-the-public-ui
Aug 19, 2026
Merged

dbeaver/pro#9948 fix: show unsaved changes dialog on tab change#4544
devnaumov merged 6 commits into
develfrom
9948-unsaved-changes-warning-is-not-shown-when-switching-tabs-in-the-public-ui

Conversation

@SychevAndrey

@SychevAndrey SychevAndrey commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

A tab click triggered openExecutor twice: once from useTab.handleOpen calling state.open(). And again from Ariakit's own onClick calling store.setSelectedId()select(). Since TabsState already wires the Ariakit store to openExecutor in both controlled and uncontrolled modes, the explicit state.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

fixes bug with tabs fire executors twice
@codacy-production

codacy-production Bot commented Aug 11, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 11 complexity

Metric Results
Complexity 11

View in Codacy

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.

sergeyteleshev
sergeyteleshev previously approved these changes Aug 11, 2026
@injectable(() => [OptionsPanelService, UserInfoResource, UserProfileTabsService])
export class UserProfileOptionsPanelService extends BaseOptionsPanelService<string | undefined> {
readonly onOpen: ISyncExecutor;
readonly onBeforeTabChange: IExecutor<string>;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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 {

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.

maybe we can use FormState & FormPart api we already have? it gives much more opportunities considering form flow

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.

cause basically your api here repeats api of the form part

await this.confirmDiscardChanges(contexts);
}

private async confirmDiscardChanges(contexts: IExecutionContextProvider<any>): Promise<void> {

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.

also partially repeats form api logic

@devnaumov
devnaumov merged commit 67df140 into devel Aug 19, 2026
5 of 6 checks passed
@devnaumov
devnaumov deleted the 9948-unsaved-changes-warning-is-not-shown-when-switching-tabs-in-the-public-ui branch August 19, 2026 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants