Skip to content

Dynamically calculate the space the warning bar will take, instead of hard-coding 100px - #26041

Open
klaustopher wants to merge 1 commit into
devfrom
warning-bar-size
Open

klaustopher wants to merge 1 commit into
devfrom
warning-bar-size

Conversation

@klaustopher

Copy link
Copy Markdown
Contributor

Done in the process of #25984, we wanted to show the banner in the warning banner section at the bottom. I saw that we reserve 100px and on some screens this looks very odd. i.e.

1

This PR addresses this issue by determining the size of the bar and subtracting it from the main content.

AI involvement

Directed – I specified the requirements and AI implemented most of it; I validated via testing rather than a full line-by-line review.

@github-actions

Copy link
Copy Markdown

Warning

This pull request does not link an OpenProject work package.

Please add a link to the work package in the description, or reference it in the
title in square brackets, e.g. [SLUG-123] My title here.

@github-actions github-actions Bot added the ai: Directed 🪄 A human specified the requirements and AI implemented most of it; They validated via testing. label Oct 15, 2026
<%= render partial: "warning_bar/unsupported_browser" if unsupported_browser? %>
<%= render partial: "warning_bar/missing_wp_edit_role_workflows" if render_workflow_missing_warning? %>
<div class="warning-bar--wrapper" data-controller="warning-bar">
<% if show_warning_bar? %>

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.

I am not a big fan of running a resizeObserver constantly even if the bar is not shown at all. Why did you move the div which registers the controller outside the check?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Because show_warning_bar? will not be the only condition. In the PR it will render the sudo banner inside this as well. So the wrapper is always present, just without any content.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

A resize observer is not really "running" anything. It is invoked when a resize happens, not constantly running a loop and polling for changes.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai: Directed 🪄 A human specified the requirements and AI implemented most of it; They validated via testing. needs review Passion time

Development

Successfully merging this pull request may close these issues.

2 participants