Remove three widget limit#2143
Open
jose03pedro wants to merge 6 commits into
Open
Conversation
…-button-without-requiring-login Add password-protected shutdown/restart
…n-and-restart-schedule-to-the-dashboard Added the ability to add a server shutdown and restart schedule to th…
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.
Issue #1990
Issue and requirements
Umbrel users can customize the homescreen by enabling widgets from installed apps and system features. Before this implementation, the widget selector only allowed three widgets to be enabled at the same time.
The issue requested removing this fixed three-widget limit because the homescreen already supports sliding between pages. The implemented change allows users to enable more than three widgets overall, while the existing layout still distributes them across multiple pages instead of placing every widget on the same page.
The issue can be found here.
The main goal of the solution was to allow users to enable more than three available widgets overall while relying on Umbrel's existing homescreen pagination to display them across multiple pages.
Source code files
The fix introduced both frontend and backend changes to remove the duplicated hardcoded widget limit.
Frontend changes
The widget selector logic was updated so it no longer blocks users after three selected widgets.
This interface now allows users to:
The relevant frontend source files submitted in the repository are:
packages/ui/src/hooks/use-widgets.tspackages/ui/src/routes/edit-widgets/widget-selector.tsxpackages/ui/src/modules/widgets/shared/constants.tspackages/ui/public/locales/*.jsonBackend changes
Backend widget validation was updated so the server no longer rejects requests once three widgets are already enabled overall.
Backend support now:
MAX_ALLOWED_WIDGETS = 3restrictionThe relevant backend source file submitted in the repository is:
packages/umbreld/source/modules/widgets/routes.tsThe indirectly involved layout files are:
packages/ui/src/modules/desktop/app-grid/app-grid.tsxpackages/ui/src/modules/desktop/app-grid/app-pagination-utils.tsxpackages/ui/src/modules/desktop/desktop-content.tsxDesign of the fix
The implementation is intentionally small because the homescreen layout already has the behavior needed to support more enabled widgets across multiple pages.
The previous limit existed in two places: the frontend blocked the user from enabling a fourth widget, and the backend rejected the same request if it reached the server. Removing only one side would not fully solve the issue, so both layers were updated.
The implemented solution allows users to:
Internally, no new rendering system was required. The existing app grid and pagination utilities already know how to place widgets and apps across homescreen pages, so the safest fix was to remove the obsolete validation instead of redesigning the desktop.
Special care was taken to ensure:
Fix source code
The source-code fix was submitted as changes under the
packages/directory. The patch is represented by the GitHub commit / pull request diff, and the most relevant code fragments are documented with the GitHub diff screenshots already included in this page:packages/ui/src/hooks/use-widgets.tspackages/ui/src/routes/edit-widgets/widget-selector.tsxpackages/ui/src/modules/widgets/shared/constants.tspackages/umbreld/source/modules/widgets/routes.tsThe screenshots above show the relevant fragments of the patch: the frontend limit check was removed, the widget selector no longer handles a "too many widgets" state, the shared
MAX_WIDGETSconstant was removed, and the backend no longer rejects valid widget-enable requests only because three widgets are already enabled.The submitted code also updates the existing locale strings under
packages/ui/public/locales/so the user-facing copy no longer claims that only three widgets can be selected. These translation-only changes are part of the submittedpackages/changes but are not shown as separate source-code screenshots here.Submit the fix
The fix is submitted through the GitHub repository by committing only the modified source files under the
packages/directory. The pull request should be linked to issue #1990, and this section should be updated with the final PR link once it is opened.