Skip to content

[#271] Lowered sticky header below Drupal administration z-index band. - #272

Merged
AlexSkrypnyk merged 5 commits into
developfrom
feature/271-header-covers-nav
Jul 30, 2026
Merged

[#271] Lowered sticky header below Drupal administration z-index band.#272
AlexSkrypnyk merged 5 commits into
developfrom
feature/271-header-covers-nav

Conversation

@AlexSkrypnyk

@AlexSkrypnyk AlexSkrypnyk commented Jul 30, 2026

Copy link
Copy Markdown
Member

Closes #271

Checklist before requesting a review

  • Subject includes ticket number as [#123] Verb in past tense.
  • Ticket number #271 added to description
  • Added context in Changed section
  • Self-reviewed code and commented in commented complex areas.
  • Added tests for fix/feature.
  • Relevant tests run and passed locally.

Changed

  1. Lowered $ct-header-sticky-zindex from 500 to 400 in web/themes/custom/drevops/components/variables.components.scss, moving the sticky site header below the entire z-index band Drupal reserves for administration chrome (navigation top bar 490 through tooltip 801), so admin overlays and the popups they open are never trapped underneath it.
  2. Added a &:has([data-flyout-expanded]) rule to .ct-header--sticky in web/themes/custom/drevops/components/03-organisms/header/header.scss that lifts the header to $ct-flyout-zindex while the mobile navigation flyout is open, because the flyout panel is a descendant of the header and is capped by the header's own stacking context.
  3. Added a generic Behat step Then the element :selector should stack above the element :other_selector and a protected elementZindex() helper to tests/behat/bootstrap/FeatureContext.php, comparing computed z-index via the existing elementExecuteJs helper and rejecting a non-numeric value instead of silently treating it as zero. Wired in ResponsiveTrait for viewport resizing.
  4. Added two @api @javascript scenarios to tests/behat/features/admin_navigation.feature: the administration top bar stacks above the sticky header, and, with the mobile navigation open at 390x844, the header stacks above the top bar.

Screenshots

Administration "More actions" dropdown fully visible above the sticky header, all items legible

Before / After

BEFORE - sticky header sits inside Drupal's admin z-index band
┌──────────────────────────────────────────────────────────────────
│  801  tooltip
│  701  footer
│  601  popover
│  501  contextual links / off-canvas dialog
│  500  .ct-header--sticky                     <- header (the bug)
│  500  navigation overlay / contextual link trigger
│  499  admin toolbar control bar
│  490  .top-bar (admin top bar) -> "More actions" menu, trapped
└──────────────────────────────────────────────────────────────────

AFTER - sticky header dropped below the whole admin band
┌──────────────────────────────────────────────────────────────────
│  801  tooltip
│  701  footer
│  601  popover
│  501  contextual links / off-canvas dialog
│  500  navigation overlay / contextual link trigger
│  499  admin toolbar control bar
│  490  .top-bar (admin top bar) -> "More actions" menu, visible
│  400  .ct-header--sticky                     <- header (fixed)
└──────────────────────────────────────────────────────────────────
  1000  .ct-header--sticky while [data-flyout-expanded] (mobile nav open)

Summary by CodeRabbit

  • Bug Fixes
    • Improved responsive header layering to ensure administration controls and sticky navigation appear in the correct order.
    • Updated mobile navigation behavior so expanded flyouts display above overlapping content.
    • Prevented the sticky header from obscuring administration interface elements.

@AlexSkrypnyk AlexSkrypnyk added A1 Board worker 1 AUTOMERGE Pull request has been approved and set to automerge labels Jul 30, 2026
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The sticky header’s base z-index is lowered below Drupal administration layers and raised to the flyout tier when mobile navigation expands. Behat gains computed z-index assertions and scenarios covering desktop administration chrome and mobile navigation stacking.

Changes

Header stacking behavior

Layer / File(s) Summary
Header z-index behavior
web/themes/custom/drevops/components/variables.components.scss, web/themes/custom/drevops/components/03-organisms/header/header.scss
The sticky header z-index changes from 500 to 400, with an expanded flyout override using the flyout z-index.
Responsive stacking assertions
tests/behat/bootstrap/FeatureContext.php, tests/behat/features/admin_navigation.feature
Behat reads and validates computed z-index values for desktop administration chrome and expanded mobile navigation scenarios.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Admin as Site administrator
  participant FeatureContext
  participant Browser as Browser DOM
  Admin->>FeatureContext: Run admin navigation scenario
  FeatureContext->>Browser: Visit page and configure viewport
  FeatureContext->>Browser: Trigger mobile navigation when required
  FeatureContext->>Browser: Read computed z-index values
  Browser-->>FeatureContext: Return stacking values
  FeatureContext-->>Admin: Assert stacking order
Loading

Suggested labels: Needs review

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: lowering the sticky header z-index below Drupal's admin layer.
Linked Issues check ✅ Passed The PR addresses #271 by fixing stacking order for the sticky header, admin chrome, and mobile flyout, with automated coverage.
Out of Scope Changes check ✅ Passed The changes stay focused on z-index behavior and related Behat coverage, with no obvious unrelated additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/271-header-covers-nav

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Stylelint (17.14.1)
web/themes/custom/drevops/components/03-organisms/header/header.scss

ConfigurationError: Could not find "@stylistic/stylelint-plugin". Do you need to install the package or use the "configBasedir" option?
at getModulePath (file:///usr/local/lib/node_modules/stylelint/lib/utils/getModulePath.mjs:38:9)
at toAbsolutePath (file:///usr/local/lib/node_modules/stylelint/lib/augmentConfig.mjs:185:11)
at Array.map ()
at absolutizePaths (file:///usr/local/lib/node_modules/stylelint/lib/augmentConfig.mjs:192:44)
at augmentConfigBasic (file:///usr/local/lib/node_modules/stylelint/lib/augmentConfig.mjs:95:9)
at async augmentConfigFull (file:///usr/local/lib/node_modules/stylelint/lib/augmentConfig.mjs:138:24)
at async getConfigForFile (file:///usr/local/lib/node_modules/stylelint/lib/getConfigForFile.mjs:102:26)
at async resolveOptionValue (file:///usr/local/lib/node_modules/stylelint/lib/utils/resolveOptionValue.mjs:27:24)
at async standalone (file:///usr/local/lib/node_modules/stylelint/lib/standalone.mjs:127:22)

web/themes/custom/drevops/components/variables.components.scss

ConfigurationError: Could not find "@stylistic/stylelint-plugin". Do you need to install the package or use the "configBasedir" option?
at getModulePath (file:///usr/local/lib/node_modules/stylelint/lib/utils/getModulePath.mjs:38:9)
at toAbsolutePath (file:///usr/local/lib/node_modules/stylelint/lib/augmentConfig.mjs:185:11)
at Array.map ()
at absolutizePaths (file:///usr/local/lib/node_modules/stylelint/lib/augmentConfig.mjs:192:44)
at augmentConfigBasic (file:///usr/local/lib/node_modules/stylelint/lib/augmentConfig.mjs:95:9)
at async augmentConfigFull (file:///usr/local/lib/node_modules/stylelint/lib/augmentConfig.mjs:138:24)
at async getConfigForFile (file:///usr/local/lib/node_modules/stylelint/lib/getConfigForFile.mjs:102:26)
at async resolveOptionValue (file:///usr/local/lib/node_modules/stylelint/lib/utils/resolveOptionValue.mjs:27:24)
at async standalone (file:///usr/local/lib/node_modules/stylelint/lib/standalone.mjs:127:22)


Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/behat/bootstrap/FeatureContext.php`:
- Around line 171-176: Rename the elementAssertStacksAbove parameter
$other_selector to $otherSelector and update all references within the method,
including the z-index lookup, exception message, and formatting arguments.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 489bc065-ab6d-445c-b8d8-261abc46ea2f

📥 Commits

Reviewing files that changed from the base of the PR and between 790a398 and 566433f.

📒 Files selected for processing (4)
  • tests/behat/bootstrap/FeatureContext.php
  • tests/behat/features/admin_navigation.feature
  • web/themes/custom/drevops/components/03-organisms/header/header.scss
  • web/themes/custom/drevops/components/variables.components.scss

Comment thread tests/behat/bootstrap/FeatureContext.php
@github-actions

Copy link
Copy Markdown

Code coverage (threshold: 80%)

  Classes: 50.00% (7/14)
  Methods: 73.33% (22/30)
  Lines:   93.21% (357/383)
Per-class coverage
Drupal\do_content_api\EventSubscriber\JsonApiWriteGateSubscriber
  Methods:  66.67% ( 2/ 3)   Lines:  88.89% (  8/  9)
Drupal\do_content_api\Hook\EntityCreateAccessHook
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  9/  9)
Drupal\do_content_api\Hook\ModerationPolicyHook
  Methods:  50.00% ( 1/ 2)   Lines:  93.75% ( 15/ 16)
Drupal\do_content_api\Routing\RouteSubscriber
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  6/  6)
Drupal\do_feed\FeedUrlBuilder
  Methods: 100.00% ( 4/ 4)   Lines: 100.00% ( 18/ 18)
Drupal\do_feed\Form\FeedSettingsForm
  Methods: 100.00% ( 4/ 4)   Lines: 100.00% ( 15/ 15)
Drupal\do_feed\Hook\EntityDeleteHook
  Methods:  50.00% ( 1/ 2)   Lines:  92.31% ( 12/ 13)
Drupal\do_feed\Hook\EntityPresaveHook
  Methods: 100.00% ( 4/ 4)   Lines: 100.00% ( 54/ 54)
Drupal\do_feed\Hook\PreprocessParagraphHook
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 14/ 14)
Drupal\do_feed\Hook\PreprocessViewsViewRowRssHook
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  3/  3)
Drupal\do_feed\Hook\ViewsPreViewHook
  Methods:  50.00% ( 1/ 2)   Lines:  96.43% ( 27/ 28)

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.16%. Comparing base (790a398) to head (566433f).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #272   +/-   ##
========================================
  Coverage    89.16%   89.16%           
========================================
  Files           15       15           
  Lines          203      203           
========================================
  Hits           181      181           
  Misses          22       22           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@AlexSkrypnyk AlexSkrypnyk added the Needs review Pull request needs a review from assigned developers label Jul 30, 2026
@AlexSkrypnyk
AlexSkrypnyk merged commit c6c0c34 into develop Jul 30, 2026
10 checks passed
@AlexSkrypnyk
AlexSkrypnyk deleted the feature/271-header-covers-nav branch July 30, 2026 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A1 Board worker 1 AUTOMERGE Pull request has been approved and set to automerge Needs review Pull request needs a review from assigned developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Header covers navigation popup menu

2 participants