Skip to content

Fix side box positions in page form - #4684

Open
MizukiTemma wants to merge 4 commits into
developfrom
story/fix_settings_box_placement
Open

MizukiTemma wants to merge 4 commits into
developfrom
story/fix_settings_box_placement

Conversation

@MizukiTemma

@MizukiTemma MizukiTemma commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Short description

This PR fixes the position of side boxes in the page form

Proposed changes

  • Check whether left column and right column are side by side or vertically placed, and move the box "Implications to translations" to match the design

Side effects

  • should be none

Faithfulness to issue description and design

There are no intended deviations from the issue and design.

How to test

  • Open a new page or an existing page
  • Change screen size
  • Check the position is as specified in the issue

Resolved issues

Fixes: #4651


Pull Request Review Guidelines

@MizukiTemma
MizukiTemma force-pushed the story/fix_settings_box_placement branch from 7d80068 to 51036c5 Compare November 3, 2026 16:57
@deliverino

deliverino Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

LLM PR Review (verdigado-code)

Analyzed diff, but not the whole repository. Important context might be missing.

Scope

Only the three files needed for the fix are touched (page form template, the sidebar-distribution script, release note). No unrelated changes; matches the description of repositioning the side boxes (and the "Implications to translations" box) based on whether the columns are side-by-side or stacked.

Correctness

integreat_cms/static/src/js/forms/distribute-sidebar-boxes.ts

  • The resize listener added in the else branch (~lines 75–79) has no debounce/throttle, and distributeBoxes → isSideBySide (~lines 43–44) calls getBoundingClientRect() twice per event. Each call forces a synchronous reflow; on a form hosting a TinyMCE editor this will cause layout thrash/jank while the window is resized.
  • distributeBoxes (~lines 46–58) unconditionally calls rightColumn.prepend(...) / leftColumn.prepend(...). prepend removes and re-inserts the node even when it is already the first child of the target column, so on every resize the box is re-parented (DOM mutation + reflow) with no visual change. Only move it when pageTranslationBox.parentElement differs from the target column.
  • Type mismatch: document.getElementById("page-minor-edit")?.parentElement (~line 60) is HTMLElement | null | undefined (it is undefined for a new page, where the element does not exist), but the third parameter of distributeBoxes is typed HTMLElement | null. Under strict tsc this is a type error (undefined is not assignable to HTMLElement | null). Runtime is fine because the value is truth-checked, but the parameter type should be widened (or a default given) to match. The "Fix parameter type of distributeBoxes" commit widened leftColumn/rightColumn but not this one.

integreat_cms/cms/templates/pages/page_form.html

  • The restructure now always renders a #right-sidebar-column for a new page (the {% if not page %} branch, ~lines 203–212). When HIX is disabled that column is empty. This empty column is what makes the JS take the even-distribution path for new pages (previously #right-sidebar-column did not exist for new pages, so no distribution ran). The empty column is harmless, but confirm it does not affect the layout (it carries flex/width classes) and that the new-page distribution (splitting settings/hix by measured height) is the intended behaviour.
  • Note the 4xl grid/flex condition (~lines 102, 203) was widened from {% if page %} to {% if page or <HIX enabled> %}; consistent with the new-page path, no issue spotted, but it couples the 4xl layout to the HIX state.

Regions / permissions / models / API / i18n

Not applicable — no new views, region-scoped queries, permission checks, model fields, API responses, or new translatable strings are introduced; the template only references pre-existing context variables (request.region.hix_enabled, TEXTLAB_API_LANGUAGES, TEXTLAB_API_ENABLED).

Release notes

integreat_cms/release_notes/current/unreleased/4651.yml is present with en and de, and the change is user-visible (page form layout).
Nitpick: the de entry uses "Fixiere … Sidebar-Boxen" (anglicisms); "Behebe/Korrigiere die Anordnung der Seitenleisten-Boxen" would be more idiomatic.

Testing

No tests accompany the new distributeBoxes / isSideBySide logic or the changed load-time branching. They are DOM/layout dependent, but the side-by-side detection and the distribution decision are unit-testable (mocked getBoundingClientRect); worth covering if the repo has a JS test harness.

Commit messages

All four are descriptive except commit 0daf3671: "Palce side boxes …" — "Palce" is a typo for "Place".

@MizukiTemma
MizukiTemma marked this pull request as draft November 4, 2026 10:32
@MizukiTemma
MizukiTemma force-pushed the story/fix_settings_box_placement branch from a4a719a to 3ab32c2 Compare November 4, 2026 15:23
@MizukiTemma
MizukiTemma marked this pull request as ready for review November 4, 2026 16:09
@MizukiTemma
MizukiTemma force-pushed the story/fix_settings_box_placement branch from db9fd19 to b31bf4d Compare November 4, 2026 16:19
@dasgoutam
dasgoutam self-requested a review November 10, 2026 09:58

@dasgoutam dasgoutam left a comment

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.

Looks good to me:) Order of boxes appear as per the issue description

@jarlhengstmengel
jarlhengstmengel self-requested a review November 10, 2026 12:41

@jarlhengstmengel jarlhengstmengel left a comment

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.

Thanks for the PR 🚀 I have one point for when creating a new page.

// Check if there are multiple columns in the document
if (leftColumn && rightColumn) {

if (!pageTranslationBox && leftColumn && rightColumn) {

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.

Checking for the page translationsbox creates the sitatuation that when creating a new page, the box isn't there and this block is entered. That results in that the settings box and the understandability box are sorted one over the other on a 4k/big screen like all boxes before. I know thats how it was in the Issue description but I feel like it would be better to have the two boxes in parallel like for the other cases. Maybe a question for @m0ndra?

Image

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@m0ndra here :)

@m0ndra m0ndra Nov 25, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

If it is an easy and straightforward thing to do; I would love to have the following design:

4K/Really wide big monitor

  • 2 TextEditor : 1 Settings of page : 1 Text understandability (order is 2:1:1 all next to each other)

If not clean or weird or too much effort, just keep it like that.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thank you @m0ndra for input :) The issue description is updated with this request ✏️

@jarlhengstmengel
Could you re-review?

@MizukiTemma
MizukiTemma force-pushed the story/fix_settings_box_placement branch from 982d2cb to 0daf367 Compare November 26, 2026 10:46

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix settings box placement when editing a page

4 participants