Skip to content

[MainUI] Add dynamic info badge for Things#4069

Open
andrewfg wants to merge 12 commits intoopenhab:mainfrom
andrewfg:thing-info-badge
Open

[MainUI] Add dynamic info badge for Things#4069
andrewfg wants to merge 12 commits intoopenhab:mainfrom
andrewfg:thing-info-badge

Conversation

@andrewfg
Copy link
Copy Markdown
Contributor

@andrewfg andrewfg commented Mar 31, 2026

The purpose of this PR is to allow a dynamic information badge to be applied to Things in the overview page in order to mark when the Thing has a special status. For example "low battery" or "firmware update available".

Resolves #4063

When a Thing's statusInfo.status === 'ONLINE' its statusInfo.statusDetail === 'NONE' and its statusInfo.description is not empty then this PR adds a "blue dot" information badge to the overview list as shown in the screenshot below.

image image

Example code for setting and removing the badge

ThingStatusInfo status = thing.getStatusInfo();

// show the badge
thing.setStatusInfo(new ThingStatusInfo(status.getStatus(), status.getStatusDetail(), "I have a special status"));

// hide the badge
thing.setStatusInfo(new ThingStatusInfo(status.getStatus(), status.getStatusDetail(), null));

Signed-off-by: Andrew Fiddian-Green software@whitebear.ch

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
@relativeci
Copy link
Copy Markdown

relativeci bot commented Mar 31, 2026

#5227 Bundle Size — 13.24MiB (~+0.01%).

7c52105(current) vs d04a233 main#5211(baseline)

Warning

Bundle contains 2 duplicate packages – View duplicate packages

Bundle metrics  Change 1 change
                 Current
#5227
     Baseline
#5211
No change  Initial JS 1.41MiB 1.41MiB
No change  Initial CSS 0B 0B
No change  Cache Invalidation 17.71% 17.71%
No change  Chunks 697 697
No change  Assets 810 810
Change  Modules 2808(+0.04%) 2807
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 2 changes Regression 2 regressions
                 Current
#5227
     Baseline
#5211
Regression  JS 11.51MiB (~+0.01%) 11.51MiB
Regression  CSS 898.35KiB (+0.03%) 898.07KiB
No change  Fonts 526.1KiB 526.1KiB
No change  Media 295.6KiB 295.6KiB
No change  IMG 45.73KiB 45.73KiB
No change  Other 847B 847B

Bundle analysis reportBranch andrewfg:thing-info-badgeProject dashboard


Generated by RelativeCIDocumentationReport issue

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
@florian-h05 florian-h05 added enhancement New feature or request main ui Main UI labels Mar 31, 2026
@dilyanpalauzov
Copy link
Copy Markdown
Contributor

Why not just render the description directly, instead of putting the description in a tooltip?

@andrewfg
Copy link
Copy Markdown
Contributor Author

andrewfg commented Apr 1, 2026

Why not just render the description directly

The text may be quite long. So on the Things list page we show a badge. Whereas on the Thing detail page the text is shown in full.

Also the idea is that the text may be dynamically added or removed so the badge is only displayed when there is something special to say. For example it can display a badge when there is a software update available, and no badge when there is not.

In other words the badge only shows when something new has happened. Rather like the blue dot your inbox when there is mail. Or the blue dot on an app on your phone when it has an update. Or when a device has a low battery, etc.


EDIT: I added some sample code for setting and removing the badge in the top post above.

@dilyanpalauzov
Copy link
Copy Markdown
Contributor

The text may be quite long. So on the Things list page we show a badge. Whereas on the Thing detail page the text is shown in full.

I agree this is a valid point of view.

@andrewfg andrewfg changed the title [MainUI] Add info badge for Things [MainUI] Add dynamic info badge for Things Apr 1, 2026
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
@andrewfg

This comment was marked as outdated.

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
andrewfg added 5 commits April 2, 2026 15:10
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
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.

[MainUI] Add dynamic info badge for Things

3 participants