Skip to content

[Asset Preview] Persist folder preview image size per user (#3745)#1953

Open
xIrusux wants to merge 7 commits into
2026.xfrom
feature/3745-persist-asset-preview-image-size-2026x
Open

[Asset Preview] Persist folder preview image size per user (#3745)#1953
xIrusux wants to merge 7 commits into
2026.xfrom
feature/3745-persist-asset-preview-image-size-2026x

Conversation

@xIrusux

@xIrusux xIrusux commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

What

Backend for pimcore/studio-ui-bundle#3745 — persist the asset folder Preview tab image-display size (small/large) per user + folder, so it survives logout/login instead of only living in the browser session.

Changes

  • New Doctrine entity Entity/Asset/FolderPreviewSetting (composite PK user + assetFolderId, imageSize), created in Installer + migration Version20260715120000 (raw CREATE TABLE to avoid the MariaDB bit-type schema-diff error).
  • Asset/Repository/FolderPreviewSettingRepository (get by user+folder, upsert).
  • Asset/Service/FolderPreviewSettingService — returns default small when unset, upserts on save; dispatches a pre-response event.
  • Asset/Schema/FolderPreviewSetting DTO + Asset/Hydrator/... + Asset/Event/PreResponse/FolderPreviewSettingEvent.
  • Two one-action controllers under Asset/Controller/FolderPreviewSetting/: GET/PUT /assets/{folderId}/preview-setting, guarded with #[IsGranted(ASSETS)], fully OpenAPI-documented (+6 translation keys).

Tests

  • Codeception unit tests for repository, hydrator and service.

Companion PR

  • Frontend: pimcore/studio-ui-bundle (branch feature/3745-persist-asset-preview-image-size-2026x).

Notes

  • Follows the layered Controller→Service→Repository→Hydrator/DTO/Event architecture.

🤖 Generated with Claude Code

xIrusux and others added 6 commits July 16, 2026 09:00
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… (#3745)

The schema-diff API introspects the full DB and fails with "Unknown database
type bit" on MariaDB; use addSql CREATE TABLE like the other Studio migrations.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 5 medium · 58 minor

Results:
63 new issues

Category Results
UnusedCode 2 medium
BestPractice 3 medium
1 minor
CodeStyle 57 minor

View in Codacy

🟢 Metrics 27 complexity

Metric Results
Complexity 27

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@xIrusux
xIrusux requested a review from martineiber July 16, 2026 07:13
@xIrusux xIrusux self-assigned this Jul 16, 2026
@xIrusux xIrusux added this to the 2026.3.0 milestone Jul 16, 2026
@xIrusux xIrusux linked an issue Jul 16, 2026 that may be closed by this pull request
…(#3745)

Expected::once() returned null, violating the non-nullable
FolderPreviewSettingRepositoryInterface::save() return type.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@martineiber

Copy link
Copy Markdown
Contributor

TBH, I’m not sure whether creating a separate database entity just for this setting is the best approach.

Could we instead extend the user entity with something like uiSettings? This would give us more flexibility and allow us to store additional UI-related settings in the future.

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.

[Asset Preview] - save image size settings

2 participants