Refactoring: DRY page type/icon handling#4119
Merged
florian-h05 merged 5 commits intoopenhab:mainfrom Apr 20, 2026
Merged
Conversation
#5311 Bundle Size — 13.84MiB (-0.01%).68d6b4c(current) vs 48f187c main#5308(baseline) Warning Bundle contains 2 duplicate packages – View duplicate packages Bundle metrics
Bundle size by type
Bundle analysis report Branch jimtng:dry-page-type Project dashboard Generated by RelativeCI Documentation Report issue |
9af221a to
794832f
Compare
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
florian-h05
reviewed
Apr 20, 2026
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR centralizes page-type detection (type/label/icon) into a shared helper to remove duplicated mappings across the UI, serving as groundwork for upcoming page/widget readonly behavior (#4115).
Changes:
- Added a new
@/pages/page-typehelper withgetPageType()andgetPageIcon(). - Refactored page listing/navigation to use the shared helper instead of local
pageTypesarrays. - Updated page view and developer tooling components to use the shared page-type resolution for routing.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| bundles/org.openhab.ui/web/src/pages/settings/pages/pages-list.vue | Replaces inline pageTypes + local helpers with shared getPageType/getPageIcon. |
| bundles/org.openhab.ui/web/src/pages/page/page-view.vue | Removes local page-type switch and uses shared helper for routing decisions (e.g., tabs). |
| bundles/org.openhab.ui/web/src/pages/page-type.ts | Introduces shared page-type and icon mapping utilities. |
| bundles/org.openhab.ui/web/src/components/developer/search-results.vue | Removes duplicated pageTypes mapping and uses shared getPageType() for settings-page links. |
| bundles/org.openhab.ui/web/src/components/developer/developer-sidebar.vue | Removes duplicated pageTypes mapping and uses shared getPageType() for pinned-page edit links. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
florian-h05
approved these changes
Apr 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This will also serve as a base for a feature in #4115