Repository navigation
Feature: land a fresh install on Settings instead of an empty dashboard - #8
Merged
Merged
Conversation
A new install has no items, and the setup prompt fires on first load, so both Skip and Set returned the user to a dashboard with nothing on it and nothing to act on. Both paths now go to Settings when there is nothing to show, which is where the first app or widget is added. The dashboard itself stays genuinely empty: no placeholder items, and opening it directly afterwards is unchanged. The decision is a pure function so it can be tested without a DOM.
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.
Summary
landingAfterSetup(items)toui/js/dashboard-logic.js: returns/adminwhenitemsis an empty array,nullotherwise, including for anything that is not an array.showSetupPrompt()inui/js/dashboard.js: the Skip handler afterdismiss-setup, and the success branch ofdoSet()in place of the unconditionallocation.reload().POST /api/auth/set-passwordsets the session cookie before responding, so the Set path lands on Settings already authenticated rather than bouncing to the login page./remains reachable and stays empty until the user adds something.[Unreleased]→ Changed entry.Testing
All green. Added 3 tests covering the empty install, an install with items, and non-array inputs; mutation-checked by loosening the emptiness test.
Checklist