-
Notifications
You must be signed in to change notification settings - Fork 526
dbeaver/pro#7251 feat: add skip navigation feature for improved acces… #4245
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
Merged
devnaumov
merged 6 commits into
devel
from
7251-cb-add-skip-to-content-panel-for-keyboard-navigaton
Apr 6, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
fcc4b58
dbeaver/pro#7251 feat: add skip navigation feature for improved acces…
SychevAndrey e661a60
dbeaver/pro#7251 refactor: replace direct import with lazy loading fo…
SychevAndrey ef3350a
Merge branch 'devel' into 7251-cb-add-skip-to-content-panel-for-keybo…
SychevAndrey 615309a
dbeaver/pro#7251 refactor: use css modules for skip nav styles
SychevAndrey 4eaba83
Merge branch 'devel' into 7251-cb-add-skip-to-content-panel-for-keybo…
SychevAndrey 4913789
dbeaver/pro#7251 refactor: remove SkipNavBootstrap
SychevAndrey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
webapp/packages/core-app/src/AppScreen/SkipNavLinks.module.css
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| @layer components { | ||
| .skipNav { | ||
| position: absolute; | ||
| top: 8px; | ||
| left: 8px; | ||
| z-index: 10000; | ||
| display: flex; | ||
| } | ||
|
|
||
| .skipNavLink { | ||
| position: absolute; | ||
| width: 1px; | ||
| height: 1px; | ||
| overflow: hidden; | ||
| cursor: pointer; | ||
| white-space: nowrap; | ||
| clip: rect(0, 0, 0, 0); | ||
| clip-path: inset(50%); | ||
| padding-inline: var(--dbv-kit-btn-padding-inline); | ||
| background: var(--dbv-kit-dialog-content-background); | ||
| color: var(--dbv-kit-dialog-content-foreground); | ||
| font: inherit; | ||
| font-weight: var(--dbv-kit-btn-font-weight); | ||
| font-size: var(--dbv-kit-btn-font-size); | ||
| border: var(--dbv-kit-btn-border-width) var(--dbv-kit-btn-border-style) var(--dbv-kit-btn-border-color); | ||
| border-radius: var(--dbv-kit-btn-border-radius); | ||
| box-shadow: var(--dbv-kit-dialog-content-shadow); | ||
|
|
||
| &:focus { | ||
| position: static; | ||
| width: auto; | ||
| height: var(--dbv-kit-btn-height); | ||
| overflow: visible; | ||
| clip: auto; | ||
| clip-path: none; | ||
| outline: var(--dbv-kit-control-outline-width) solid var(--dbv-kit-control-outline-color); | ||
| outline-offset: var(--dbv-kit-control-outline-offset); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| /* | ||
| * CloudBeaver - Cloud Database Manager | ||
| * Copyright (C) 2020-2026 DBeaver Corp and others | ||
| * | ||
| * Licensed under the Apache License, Version 2.0. | ||
| * you may not use this file except in compliance with the License. | ||
| */ | ||
| import { observer } from 'mobx-react-lite'; | ||
| import { Placeholder, useTranslate } from '@cloudbeaver/core-blocks'; | ||
| import { useService } from '@cloudbeaver/core-di'; | ||
| import { UnstyledButton } from '@dbeaver/ui-kit'; | ||
|
|
||
| import { PANEL_ID_LEFT_SIDEBAR, PANEL_ID_MAIN_CONTENT } from './AppScreenService.js'; | ||
| import { SkipNavService } from './SkipNavService.js'; | ||
| import styles from './SkipNavLinks.module.css'; | ||
|
|
||
| function focusPanel(panelId: string) { | ||
| const element = document.querySelector<HTMLElement>(`[data-panel-id="${panelId}"]`); | ||
| element?.focus(); | ||
| } | ||
|
|
||
| export const SkipNavLinks = observer(function SkipNavLinks(): React.ReactElement { | ||
| const translate = useTranslate(); | ||
| const skipNavService = useService(SkipNavService); | ||
|
|
||
| return ( | ||
| <nav aria-label={translate('app_skip_nav_label')} className={styles['skipNav']}> | ||
| <UnstyledButton type="button" className={styles['skipNavLink']} onClick={() => focusPanel(PANEL_ID_LEFT_SIDEBAR)}> | ||
| {translate('app_skip_nav_navigator')} | ||
| </UnstyledButton> | ||
| <UnstyledButton type="button" className={styles['skipNavLink']} onClick={() => focusPanel(PANEL_ID_MAIN_CONTENT)}> | ||
| {translate('app_skip_nav_main_content')} | ||
| </UnstyledButton> | ||
| <Placeholder container={skipNavService.extraLinks} /> | ||
|
Wroud marked this conversation as resolved.
|
||
| </nav> | ||
| ); | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| /* | ||
| * CloudBeaver - Cloud Database Manager | ||
| * Copyright (C) 2020-2026 DBeaver Corp and others | ||
| * | ||
| * Licensed under the Apache License, Version 2.0. | ||
| * you may not use this file except in compliance with the License. | ||
| */ | ||
| import { importLazyComponent, PlaceholderContainer } from '@cloudbeaver/core-blocks'; | ||
| import { injectable } from '@cloudbeaver/core-di'; | ||
|
|
||
| import { AppScreenService } from './AppScreenService.js'; | ||
|
|
||
| const SkipNavLinks = importLazyComponent(() => import('./SkipNavLinks.js').then(m => m.SkipNavLinks)); | ||
|
|
||
| @injectable(() => [AppScreenService]) | ||
| export class SkipNavService { | ||
| readonly extraLinks: PlaceholderContainer; | ||
|
|
||
| constructor(private readonly appScreenService: AppScreenService) { | ||
| this.extraLinks = new PlaceholderContainer(); | ||
| } | ||
|
|
||
| registerLinks(): void { | ||
| this.appScreenService.placeholder.add(SkipNavLinks, 0); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| /* | ||
| * CloudBeaver - Cloud Database Manager | ||
| * Copyright (C) 2020-2026 DBeaver Corp and others | ||
| * | ||
| * Licensed under the Apache License, Version 2.0. | ||
| * you may not use this file except in compliance with the License. | ||
| */ | ||
| import { observer } from 'mobx-react-lite'; | ||
| import { importLazyComponent, useTranslate } from '@cloudbeaver/core-blocks'; | ||
| import { useService } from '@cloudbeaver/core-di'; | ||
| import { CommonDialogService } from '@cloudbeaver/core-dialogs'; | ||
| import { UnstyledButton } from '@dbeaver/ui-kit'; | ||
|
|
||
| import { skipNavStyles } from '@cloudbeaver/core-app'; | ||
|
|
||
| const ShortcutsDialog = importLazyComponent(() => import('./Shortcuts/ShortcutsDialog.js').then(m => m.ShortcutsDialog)); | ||
|
|
||
| export const SkipNavShortcutsLink = observer(function SkipNavShortcutsLink(): React.ReactElement { | ||
| const translate = useTranslate(); | ||
| const commonDialogService = useService(CommonDialogService); | ||
|
|
||
| function handleClick() { | ||
| commonDialogService.open(ShortcutsDialog, undefined); | ||
| } | ||
|
|
||
| return ( | ||
| <UnstyledButton type="button" className={skipNavStyles['skipNavLink']} onClick={handleClick}> | ||
| {translate('shortcuts_title')} | ||
| </UnstyledButton> | ||
| ); | ||
| }); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
you should use
observablewithuseTranslate