Files
Jonathan Adelineandpeter_baserow a8bf3b73ae feat: redesign app sidebar (#6798)
* feat: redesign sidebar workspace navigation

* feat: redesign the sidebar footer and account menu

Match the account menu to the sidebar prototype and reuse the admin
navigation in a submenu. Keep Add new above the footer while the
application list scrolls.

* fix: show the sortable indicator only when dragging

* feat: refine workspace sidebar application navigation

* feat: reorganize workspace sidebar shortcuts

* fix: isolate workspace sidebar menus and actions

* fix: cancel sortable drops on hidden lists

* fix(enterprise): allow retrying Direct support

* feat: simplify the workspace overview header

* fix: prevent horizontal overflow around the sidebar

Constrain animated tree groups to the width of the sidebar so long labels truncate. On narrow screens, let the sidebar expand over the content instead of reducing the usable page width.

* fix: fit workspace cards and creation menus on mobile

* test: keep the current table selected after reload

* fix: undo and redo edits across expanded sidebar applications

* fix: keep sidebar groups out of the tab order

* fix: highlight the active database in the tables tour

* feat: label workspace integrations in the settings menu

* fix: keep the workspace sidebar and guided tour usable on phones

* fix: undo sidebar row imports in the destination database

* fix: keep the guided tour highlight on the current step

* fix: show an empty state in the workspace picker

* fix: confirm workspace deletion before moving it to trash

* feat: open registered workspace settings tabs from the sidebar

* fix: keep the sidebar logo the same size across workspaces

---------

Co-authored-by: peter_baserow <peter@baserow.io>
2026-11-23 20:42:20 +04:00

51 lines
1.4 KiB
JavaScript

const controls =
'a[href], button, input, select, textarea, summary, iframe, [contenteditable]:not([contenteditable="false"]), [tabindex]'
const observers = new WeakMap()
function removeTabStop(element) {
if (
element.matches(controls) &&
!element.hasAttribute('data-sidebar-tab-stop') &&
element.getAttribute('tabindex') !== '-1'
) {
element.setAttribute('tabindex', '-1')
}
}
function removeTabStopsIn(element) {
removeTabStop(element)
element.querySelectorAll(controls).forEach(removeTabStop)
}
export default {
mounted(element) {
removeTabStopsIn(element)
// Application children and plugin entries can be mounted independently.
const observer = new MutationObserver((mutations) => {
for (const mutation of mutations) {
if (mutation.type === 'attributes') {
removeTabStop(mutation.target)
} else {
for (const node of mutation.addedNodes) {
if (node.nodeType === Node.ELEMENT_NODE) {
removeTabStopsIn(node)
}
}
}
}
})
observer.observe(element, {
attributes: true,
attributeFilter: ['href', 'tabindex', 'contenteditable'],
childList: true,
subtree: true,
})
observers.set(element, observer)
},
beforeUnmount(element) {
observers.get(element)?.disconnect()
observers.delete(element)
},
}