FlowFuse / FlowFuse/node-red-dashboard
Implement Unique IDs for UI Elements, shows just the Labels to the User
- Dominant language
- HTML
- Stars
- 355
- Forks
- 82
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 24
Description
### Description

**Summary:**
To improve code maintainability and avoid inconsistencies, it is proposed that all UI elements (such as Pages, Groups, and thus Menu items) in Node-RED Dashboard 2.0 should have unique IDs or codes. These IDs should be used for routing, authorization, and business logic instead of visible text labels.
**Description:**
Currently, Node-RED Dashboard 2.0 uses visible text labels for UI elements such as Page Names in routing, authorization, and business logic. This approach can lead to several issues:
- Inconsistencies and poor code maintenance: Renaming a UI element requires a complete refactor of the authorization logic, which can be cumbersome and error-prone.
- Positional approach limitations: Using positional references for UI elements can lead to similar maintenance challenges.
**Proposed Solution:**
- Each UI element (Page, Group etc.) should have a unique ID or code.
- The ID should be randomly generated upon creation but can be overwritten by the user to provide a meaningful logical key.
**Separation of Labels and IDs:**
- The visible name of the UI element should be treated as a label and should not be used in routing, authorization, or business logic.
- Deep references to UI elements (e.g., programmatic UI-Control to show/hide components based on authenticated user) should leverage IDs, not names.
**Benefits:**
- **Improved Maintainability:** Changes to visible labels will not require refactoring of the underlying logic, reducing the risk of errors and simplifying maintenance.
- **Consistency:** Using unique IDs ensures that references to UI elements remain consistent, even if the visible labels are changed.
- **Flexibility:** Users can assign meaningful logical keys to IDs, making the system more intuitive and easier to manage. Naming convention (E.G. complex keys with prefixes and suffixes) could help in complex scenario without affecting the visible label.
### Have you provided an initial effort estimate for this issue?
I have provided an initial effort estimate
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by mapping how Pages, Groups, Menu items, routing, authorization, and UI-Control references currently use visible labels. Define the separation between stable user-overridable IDs and labels, then verify that routing, authorization, and business logic use IDs while labels remain presentation text.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100