fix: only hide primary tabs for users with toolbar access#623
Merged
Conversation
Primary tabs were being hidden for all users when admin_toolbar_tools was configured to show local tasks, even for users without toolbar permissions who couldn't see the tasks in the admin toolbar. Fixes #609 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
jjroelofs
added a commit
that referenced
this pull request
Oct 1, 2025
Primary tabs were being hidden for all users when admin_toolbar_tools was configured to show local tasks, even for users without toolbar permissions who couldn't see the tasks in the admin toolbar. Fixes #609 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Jurriaan Roelofs <jur@dxpr.com> Co-authored-by: Claude <noreply@anthropic.com>
jjroelofs
added a commit
that referenced
this pull request
Dec 18, 2025
* feat: update Google Webfonts database (#610) Co-authored-by: jjroelofs <jjroelofs@users.noreply.github.com> * fix: only hide primary tabs for users with toolbar access (#623) Primary tabs were being hidden for all users when admin_toolbar_tools was configured to show local tasks, even for users without toolbar permissions who couldn't see the tasks in the admin toolbar. Fixes #609 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Jurriaan Roelofs <jur@dxpr.com> Co-authored-by: Claude <noreply@anthropic.com> * fix: prevent tabs from being hidden below header on pages without title Previously, tabs were positioned with translate(-50%, -100%) which caused them to be hidden below the header on pages without a page title. Changed to translate(-50%, 0) to fix this issue. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Revert "fix: prevent tabs from being hidden below header on pages without title" This reverts commit 1bd28e2. * fix: when toolbar local tasks enabled hide primary tabs but NOT secondary tabs * fix: tiny pager/tabs text, fall back to bootstrap default file size * fix: modernize mobile fixed header using Drupal displacement API Use Drupal's displacement API CSS variables to properly position the mobile fixed header and prevent content overlap. Changes: - Add `top: var(--drupal-displace-offset-top, 0px)` to position header below admin toolbar - Change body padding to `calc(var(--dxt-setting-header-mobile-height) + var(--drupal-displace-offset-top, 0px))` to account for both header and toolbar - Remove obsolete `#toolbar-bar.header-mobile-fixed` CSS rule - Add z-index to mobile fixed header for proper stacking This replaces the legacy JavaScript-based approach that was removed in commit d9e8fde with a modern CSS-only solution that integrates with Drupal core's displacement system. Fixes #677 * fix: modernize desktop header using Drupal displacement API Extend the displacement API modernization to desktop header positioning and remove legacy toolbar-specific CSS overrides. Changes: - Use `var(--drupal-displace-offset-top)` for desktop fixed header `top` - Use `calc(header-height + offset)` for desktop body padding - Use `calc(offset + 30px)` for overlay header design spacing - Remove 35 lines of toolbar-specific CSS overrides (39px, 80px, etc.) - Remove legacy Drupal 7 admin_menu CSS (body.admin-menu) - Keep Gin toolbar horizontal offset handling The displacement API automatically handles all toolbar states: - Standard toolbar (39px) - Toolbar with tray open (80px) - No toolbar (0px) This reduces CSS complexity and ensures consistent behavior with any admin toolbar configuration. * fix: only apply mobile padding when header-mobile-fixed is enabled Use CSS :has() selector to detect when mobile fixed header is actually enabled (navbar has header-mobile-fixed class). Without this check, padding was incorrectly applied even when mobile header was static, creating a gap at the top of the page. - Reset padding-top to 0 for mobile mode by default - Only add padding when :has(#navbar.header-mobile-fixed) matches * fix: remove hardcoded toolbar offsets, use displacement API - Remove hardcoded 39px/80px toolbar offsets from header-theme-settings-css.inc - Use Drupal's displacement API (--drupal-displace-offset-top) for header positioning - Simplify desktop fixed header body padding to just header height - Remove conflicting Gin toolbar body padding rule from SCSS - Add !important to mobile padding reset to override Gin's rules This modernizes the toolbar handling to work with any admin toolbar configuration without hardcoded pixel values. * fix: reset body padding for Gin vertical toolbar Gin vertical toolbar sets --gin-toolbar-y-offset to 0px on desktop because the toolbar is positioned on the side. Our dynamic theme settings CSS was adding header height as body padding, creating a visible gap at the top. Add explicit reset rule for Gin vertical toolbar that sets body padding-top to 0 with !important to override the dynamic CSS. * chore: clean up code comments for production Simplify verbose comments to be more concise while preserving essential context. * fix: apply Gin sidebar offset to sticky header (affix) The sticky header (affix class) was setting left:0 which caused the header to overlap the Gin sidebar when scrolling. Now both the fixed and affix states respect the Gin toolbar offset. * fix: improve mobile fixed header body padding logic - Reset desktop padding only when mobile fixed header is NOT enabled - Add body padding only when #navbar.header-mobile-fixed is present - Handle Gin vertical toolbar padding separately - Use !important to override conflicting styles * fix: reset margin on fixed headers to prevent 1-2px offset * fix: overlap Gin toolbar 1px border to eliminate visual gap * fix: handle all Gin toolbar modes (vertical, horizontal, classic) - Add 1px border overlap fix for gin--horizontal-toolbar and gin--classic-toolbar - Navigation module uses --drupal-displace-offset-top so existing code handles it * fix: add gin--core-navigation and gin--navigation-top-bar classes * fix: add gin--navigation class to header positioning rules Add support for gin--navigation body class in the Gin border overlap fix. This ensures the 1px header offset is applied when using Gin with the Navigation module. * fix: use 6px offset for gin--navigation toolbar gap The Drupal displacement API reports 60px for gin--navigation but the actual toolbar is only 54px. Use -6px offset instead of -1px to correctly align the fixed header with this toolbar configuration. Keep -1px for other Gin toolbar modes (vertical, horizontal, classic, core-navigation) where the 1px border causes the visual gap. * fix: rename data-offset-top to prevent collision with Drupal displacement API The Bootstrap affix plugin used data-offset-top attribute to configure sticky header scroll offset. However, Drupal's displace.js also reads any element with data-offset-top attribute to calculate displacement offsets. This caused --drupal-displace-offset-top to be incorrectly set to 60px (from theme settings) instead of the actual toolbar height. Renamed to data-affix-offset-top to avoid the naming collision. DXPR Theme's sticky header implementation uses drupalSettings values rather than reading this data attribute, so no JS changes are needed. * fix: position theme settings sidebar below admin toolbar Use --drupal-displace-offset-top CSS variable to position the theme settings sidebar below the admin toolbar. This ensures the search bar and sidebar content align properly with the Gin toolbar height. * fix: make Save configuration button sticky at bottom of settings sidebar The save button is now always visible at the bottom of the theme settings sidebar regardless of scroll position. * fix: set --drupal-displace-offset-right for settings sidebar The theme settings sidebar is 35vw wide and fixed on the right side. Setting the displacement API variable allows other page elements to respond to the sidebar's presence. * fix: style save button with black background and white text * Revert "merge: resolve conflicts from 6.x branch" This reverts commit b251047, reversing changes made to c712782. * fix: resolve stylelint issues in SCSS files - Use flex-flow shorthand instead of flex-direction + flex-wrap - Remove units from zero values in CSS variable fallbacks - Add empty line before comment per SCSS style guide * fix: reword comment to avoid eslint spellcheck error --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: jjroelofs <jjroelofs@users.noreply.github.com> Co-authored-by: Jurriaan Roelofs <jur@dxpr.com> Co-authored-by: Claude <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fixes a bug where primary tabs (local tasks) were hidden for all users when
admin_toolbar_toolswas configured to show local tasks, even for users who don't have permission to access the admin toolbar.Changes
dxpr_theme_preprocess_menu_local_tasks()access toolbarpermissionTest plan
Closes #609
🤖 Generated with Claude Code