Skip to content

Refactoring: DRY page type/icon handling#4119

Merged
florian-h05 merged 5 commits intoopenhab:mainfrom
jimtng:dry-page-type
Apr 20, 2026
Merged

Refactoring: DRY page type/icon handling#4119
florian-h05 merged 5 commits intoopenhab:mainfrom
jimtng:dry-page-type

Conversation

@jimtng
Copy link
Copy Markdown
Contributor

@jimtng jimtng commented Apr 20, 2026

This will also serve as a base for a feature in #4115

@relativeci
Copy link
Copy Markdown

relativeci bot commented Apr 20, 2026

#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  Change 2 changes Regression 1 regression
                 Current
#5311
     Baseline
#5308
Regression  Initial JS 1.41MiB(~+0.01%) 1.41MiB
No change  Initial CSS 0B 0B
No change  Cache Invalidation 16.18% 16.18%
No change  Chunks 697 697
No change  Assets 816 816
Change  Modules 2818(+0.04%) 2817
No change  Duplicate Modules 0 0
No change  Duplicate Code 0% 0%
No change  Packages 126 126
No change  Duplicate Packages 1 1
Bundle size by type  Change 1 change Improvement 1 improvement
                 Current
#5311
     Baseline
#5308
Improvement  JS 11.53MiB (-0.02%) 11.53MiB
No change  CSS 901.98KiB 901.98KiB
No change  IMG 638.41KiB 638.41KiB
No change  Fonts 526.1KiB 526.1KiB
No change  Media 295.6KiB 295.6KiB
No change  Other 847B 847B

Bundle analysis reportBranch jimtng:dry-page-typeProject dashboard


Generated by RelativeCIDocumentationReport issue

@jimtng jimtng force-pushed the dry-page-type branch 4 times, most recently from 9af221a to 794832f Compare April 20, 2026 02:28
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
@jimtng jimtng marked this pull request as ready for review April 20, 2026 02:41
@florian-h05 florian-h05 added enhancement New feature or request main ui Main UI labels Apr 20, 2026
Comment thread bundles/org.openhab.ui/web/src/pages/page-type.ts
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
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 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-type helper with getPageType() and getPageIcon().
  • Refactored page listing/navigation to use the shared helper instead of local pageTypes arrays.
  • 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.

Comment thread bundles/org.openhab.ui/web/src/pages/page-type.ts
jimtng added 3 commits April 20, 2026 22:23
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 florian-h05 added this to the 5.2 milestone Apr 20, 2026
@florian-h05 florian-h05 changed the title DRY page-type handling Refactoring: DRY page-type handling Apr 20, 2026
@florian-h05 florian-h05 changed the title Refactoring: DRY page-type handling Refactoring: DRY page type/icon handling Apr 20, 2026
@florian-h05 florian-h05 merged commit 6a86839 into openhab:main Apr 20, 2026
5 checks passed
@jimtng jimtng deleted the dry-page-type branch April 20, 2026 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request main ui Main UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants