Skip to content

Fix: Prevent vertical shifting of #content on the Watch page when displaying the stream status overlay. on Watch page#4721

Open
IgorA100 wants to merge 8 commits intoZoneMinder:masterfrom
IgorA100:patch-990359
Open

Fix: Prevent vertical shifting of #content on the Watch page when displaying the stream status overlay. on Watch page#4721
IgorA100 wants to merge 8 commits intoZoneMinder:masterfrom
IgorA100:patch-990359

Conversation

@IgorA100
Copy link
Copy Markdown
Contributor

@IgorA100 IgorA100 commented Mar 23, 2026

If Scale=auto is enabled and the page is scrolled down slightly, then when the stream is stopped and then restarted, the page (#content) shifts slightly vertically.
I couldn't figure out why this happens, despite extensively studying the page layout.
Adding a DIV will avoid this issue.
It's probably a hack, but it works.

…ng the stream status overlay. (watch.php)

If Scale=auto is enabled and the page is scrolled down slightly, then when the stream is stopped and then restarted, the page (#content) shifts slightly vertically. I couldn't figure out why this happens, despite extensively studying the page layout.
Adding a DIV will avoid this issue. It's probably a hack, but it works.
@IgorA100 IgorA100 changed the title Prevent vertical shifting of #content on the Watch page when displaying the stream status overlay. on Watch page Fix: Prevent vertical shifting of #content on the Watch page when displaying the stream status overlay. on Watch page Mar 23, 2026
@IgorA100 IgorA100 marked this pull request as ready for review March 23, 2026 14:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to stop a small vertical layout “jump” on the classic skin Watch page when the stream status overlay appears/disappears (notably with Scale=auto and slight scroll).

Changes:

  • Insert a small spacer <div> before the monitor wrapper to prevent the observed shifting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

?>
</ul>
</nav>
<div style="padding-right:1px; margin-right: -1px;"></div> <--! REQUIRED https://github.com/ZoneMinder/zoneminder/pull/4721 -->
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

This introduces an anonymous empty spacer <div> with inline styles and magic numbers (1px / -1px), which is hard to understand and maintain. Consider giving it an id/class (and aria-hidden="true") and moving the styling into the skin CSS with a short explanation of what layout shift it prevents.

Suggested change
<div style="padding-right:1px; margin-right: -1px;"></div> <--! REQUIRED https://github.com/ZoneMinder/zoneminder/pull/4721 -->
<style>
/* Spacer prevents a 1px horizontal layout shift between the nav sidebar
* and the monitor wrapper when scrollbars appear/disappear in some browsers.
* See https://github.com/ZoneMinder/zoneminder/pull/4721
*/
.monitor-layout-spacer {
padding-right: 1px;
margin-right: -1px;
}
</style>
<div class="monitor-layout-spacer" aria-hidden="true"></div>

Copilot uses AI. Check for mistakes.
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.

@connortechnology
I'm not sure Copilot's comment is necessary; it would add a lot of unnecessary code.
Isaac, the final word is yours.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@IgorA100 IgorA100 marked this pull request as draft March 27, 2026 12:59
@IgorA100 IgorA100 marked this pull request as ready for review March 27, 2026 12:59
@connortechnology
Copy link
Copy Markdown
Member

I'd really prefer to know why and not need this hack.

@IgorA100
Copy link
Copy Markdown
Contributor Author

I'd really prefer to know why

I'd also like to know; it's some kind of mystery; it shouldn't be like this. But I spent a couple of days researching the problem and haven't been able to solve it any other way yet. Right now, I have very little free time to study this particular issue.
Later, I could continue analyzing the problem and perhaps find a layout issue somewhere.

@IgorA100 IgorA100 marked this pull request as draft March 27, 2026 20:54
@IgorA100
Copy link
Copy Markdown
Contributor Author

@connortechnology
Attach infoBlock to imageFeed instead of parent LiveStream
This avoids the offset issue.

@IgorA100 IgorA100 marked this pull request as ready for review March 27, 2026 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants