Skip to content

feat: image background options of pages and apps — size, position, scrolling, repeat EXO-90087 - #569

Merged
Jihed525 merged 2 commits into
developfrom
backport/EXO-90087
Sep 9, 2026
Merged

Jihed525 merged 2 commits into
developfrom
backport/EXO-90087

Conversation

@Jihed525

@Jihed525 Jihed525 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Backport of EXO-90087[N2] [Layout] Suggest new options to center and fix image background of pages and apps — from feature/ai-contribution onto develop. layout part of a four-repo ticket, and the one that depends on the others.

Scope

Two -x-stamped cherry-picks of the FB squash-merges, applied to a fresh origin/develop with no conflict:

FB PR Commit Change
#567 d2aa07f5 rework the image background options of pages and apps — Size (Fill / Fit), Position (Center default + corners), Scrolling (Stays fixed / Scrolls with page), Repeat
#568 3f724575 translate the site background attachment for the scroll container

9 files: LayoutModel and EntityMapper in layout-service (the new backgroundAttachment / appBackgroundAttachment fields and their two mapping lines — DTO mapping, not a JPA entity); the page and application editor drawers, BackgroundInput.vue, LayoutUtils.js, ApplicationUtils.js and LayoutEditor_en.properties in layout-webapp.

The four halves and their merge order

Repo PR Depends on
portal #1321
platform-ui #1005 portal (runtime)
social #6091 portal (runtime)
layout (this PR) portal (compile time)EntityMapper calls ModelStyle#setBackgroundAttachment, which portal#1321 adds

Merge this one last, after portal#1321. On today's develop this PR does not compile — setBackgroundAttachment does not exist there yet — so expect the PR build to stay red until portal#1321 has landed and the 7.3.x-SNAPSHOT has been republished.

Verification

Built on a fresh origin/develop worktree against the portal#1321 artefact installed locally (mvn clean install on the portal backport first, then mvn -o clean install here so the snapshot could not be replaced by the remote one mid-build): BUILD SUCCESS, 365 tests, 0 failures, 0 errors, 0 skipped, all four modules green. A guard checked that the installed portal.component.api jar actually carried the new app-background-attachment key before the build started — the first attempt had found the remote snapshot in its place.

Classification: N2

Shared UI component + DTO model fields. No ACL, schema, entity, bridge, upload or MCP surface (the EntityMapper here is the Storage-layer mapper, not a persistence entity). Matches the ticket's own [N2].
Its approver must be an Architect/Senior Developer who knows it is N2, not an approval on AI review alone. Author ≠ approver.

Validated on the FB acceptance by the PO (Samuel Renault) and tested by me, 2026-09-09.

Knowledge: none — mechanical backport; the knowledge for this ticket is owed by the FB delivery, not by this PR.

🤖 Generated with Claude Code

srenault-meeds and others added 2 commits September 9, 2026 11:00
Implements [task
90087](https://community.exoplatform.com/portal/dw/tasks/taskDetail/90087)
— *[Layout] Suggest new options to center and fix image background of
pages and apps*.

Requires `Meeds-io/portal#1319` (persistence) and `Meeds-io/platform-ui`
(rendering). Companion: `Meeds-io/social` for the branding admin. Same
`EXO-90087`.

### Problem
Size and repeat shared a **single** radio group, so the four values were
mutually exclusive: choosing *Repeat* silently cleared
`background-size`, and "fit the whole image **and** tile it" was
unreachable. There was also no way to center a background or to keep it
fixed while scrolling.

### The options, as the board specifies them
| Group | Options (first = default) |
|---|---|
| Size | Fill, cropped *(was Cover)* · Fit, whole image *(was Contain)*
|
| Position | **Center** *(new)* · Top right · Top left · Bottom right ·
Bottom left |
| Scrolling *(new)* | **Stays fixed** · Scrolls with page |
| Repeat | No repeat · Repeat |

Four independent captioned groups, two per row (`col-6`, with Center
full width), so size and repeat now compose freely.

### Changes
- **`BackgroundInput.vue`** — the four groups; the
`backgroundImageStyle` intermediate state is gone, each group binds its
own container property. Removing the image clears all four, so a stale
`fixed`/`repeat` is not re-applied to the next image.
- **`LayoutModel` / `EntityMapper`** — carry `backgroundAttachment` and
`appBackgroundAttachment`
- **`LayoutUtils.js`** — defaults and `parseContainerStyle`
- **`ApplicationUtils.js`** — emit the value on all four paths (site /
page / app / background layer)
- **`LayoutEditor_en.properties`** — group captions, the two renamed
size labels, Center and the two Scrolling labels

### Drive-by fix
`backgroundPosition` was never declared in the `backgroundProperties` of
either application drawer, nor in the page drawer's
`appBackgroundProperties`. Under Vue 2 the key was therefore
non-reactive, the deep watcher never fired, and **app background
position was silently never saved**. Now declared alongside
`backgroundAttachment`.

### Points for the reviewer
- **Labels use the board's sentence case** ("Fill, cropped", "Fit, whole
image"). The mockup attached to the task title-cases them ("Fill,
Cropped"). Trivial to flip if the PO prefers the mockup.
- **`imageSizeCover`/`imageSizeContain` keep their keys** with new
English values, so Crowdin re-translates rather than orphaning keys in
40 locale files. Other locales show the old wording until it syncs.
- **No data upgrade.** Existing pages keep their current rendering;
Center / Stays fixed apply once a background is re-saved.

### Tests
- `layout-service`: 365/365 pass. `npm run eslint-check`: 0 errors.
- Deployed to a local 7.3.x-ai-contribution bundle; the production build
reproduces the shipped `layout.war` byte-for-byte for every bundle not
touched here.

Knowledge: none — no architectural change; the new option follows the
existing background style plumbing. A `/domain-doc` refresh of `layout`
may still be worth folding into the eXip's knowledge sub-task.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
(cherry picked from commit d2aa07f)
…EXO-90087 (#568)

Follow-up to `#567` (merged), for [task
90087](https://community.exoplatform.com/portal/dw/tasks/taskDetail/90087).
Requires `Meeds-io/platform-ui#1004`.

Same translation as `Meeds-io/portal#1320`, applied to the **site**
background written by the site layout editor.

The site background paints on the scrolling container
(`Meeds-io/platform-ui#1004`), where `background-attachment: scroll`
means *"fixed with regard to that box"* and so looks identical to
`fixed`. `local` is what makes it follow the scrolled content:

```js
function siteBackgroundAttachment(attachment) {
  return attachment === 'scroll' ? 'local' : attachment;
}
```

Applied only on the `options.siteStyle` path of `getStyle`.

### Deliberately not applied elsewhere
**Page, section and app backgrounds keep `scroll` untranslated.** They
paint on elements *inside* that scroller (`.layout-page-parent`, the
section/app elements), which physically move as the container scrolls —
so `scroll`, meaning "fixed with regard to the element's own box",
already makes the background travel with the content. `fixed` there
correctly anchors to the viewport.

That asymmetry is the whole point of the helper: the surface determines
the CSS keyword, while the stored value keeps the user's intent (`fixed`
/ `scroll`) uniformly across every background.

### Tests
`npm run eslint-check`: 0 errors. Production bundles rebuilt and
deployed to a local 7.3.x-ai-contribution bundle (eval-free AMD,
verified).

Knowledge: none — one value translation, no architectural change.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
(cherry picked from commit 3f72457)
@Jihed525
Jihed525 requested review from ahamdi and azayati September 9, 2026 10:29
@Jihed525

Jihed525 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

The red PR Build is the expected one, not a defect in this PR. CI compiles layout-service against the published portal.component.api 7.3.x snapshot, which does not yet contain portal#1321. The failure is exactly the four call sites of the new portal API and nothing else (run 34340470051):

LayoutModel.java:[298,43]  cannot find symbol  getBackgroundAttachment()        — ApplicationBackgroundStyle
LayoutModel.java:[381,51]  cannot find symbol  getBackgroundAttachment()        — ApplicationBackgroundStyle
EntityMapper.java:[198,15] cannot find symbol  setBackgroundAttachment(String)  — ModelStyle
EntityMapper.java:[262,15] cannot find symbol  setBackgroundAttachment(String)  — ApplicationBackgroundStyle

Locally the same tree builds green against the portal#1321 artefact — BUILD SUCCESS, 365 tests, 0 failures (built offline so the remote snapshot could not be substituted mid-build; details in the PR body). The build here will turn green on its own once portal#1321 is merged and its snapshot republished; I will re-trigger it at that point. Merge order: portal → platform-ui / social → this one.

@Jihed525
Jihed525 enabled auto-merge (squash) September 9, 2026 18:07
@Jihed525
Jihed525 merged commit 7a19f93 into develop Sep 9, 2026
10 of 15 checks passed
@Jihed525
Jihed525 deleted the backport/EXO-90087 branch September 9, 2026 18:40
@sonarqubecloud

sonarqubecloud Bot commented Sep 9, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 60%)

See analysis details on SonarQube Cloud

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