cockpit
cockpit copied to clipboard
frontend: improve user and profile management
Current behaviour
- There is no interface for existing users to be deleted or renamed
- It's currently only possible by manually editing the JSON in the BlueOS Bag of Holdings
- The user switching interface doesn't make it obvious what the differences are between users
- New users get created as a duplicate of the current user, without the user being informed
- "Add New" in the user selection window looks like a user, which is a little confusing/unintuitive
- It's in the same place, and only slightly visually different from the available users
- It's in the same place, and only slightly visually different from the available users
- "Save" in the user selection window doesn't make sense, and "Cancel" seems redundant
- "Cancel" in the new user creator cancels the whole selection process, not just the new user creation
- Sharing profiles between users requires a manual export and import, which feels a bit clunky
- Profiles have no sense of history/basis
- This makes it hard to know when there are new view/widget options available
- Relevant to #234
- This makes it hard to know when there are new view/widget options available
- Default profiles can only be accessed by restoring all the user's profiles to the defaults
- Initial profiles for the default user are labelled as defaults, but are editable, and don't actually change the real defaults
- The profile switcher treats the icon differently between the selected and available profiles
Expected or desired behaviour
- Add an admin / settings cog / pencil button in the top right of the user switcher
- Allow renaming and deleting users from there
- Confirm/cancel to return to the user switcher and choose your user
- The user switcher should show the Profiles included in each user
- Include indicators of which vehicle types they apply to
- Preferably list out the View names within each profile as well
- Along with choosing a name, new user creation should allow explicitly selecting an existing user as a basis
- Include a special "Empty" option that has no profiles, which then opens the Profile creator (see 7.)
- Maybe include a special "General" option, with clones of all the current default Profiles
- I think explicit choices are better, but this could be convenient for some users to quickly get a sense of what Cockpit can do
- If we do this, the generated Profiles should not include "default" in their names
- "Add New" should be replaced with a "+", and should potentially have no background or a circular one
- We could also make user creation exclusive to the admin section, but that might be unintuitive for new users
- In user selection, remove the "Save"/"Cancel" buttons, and make it necessary to select a user
- It would be helpful to add an icon/styling to indicate which user is currently selected, if there is one
- Clicking out of the window or pressing Escape should be equivalent to choosing the current user
- If there isn't one it should do nothing, or provide an error indication/message that a user must be selected or created
- "Cancel" in the new user creator should return to the user selector
- New Profile creation should allow selecting an existing profile as a basis
- Include Cockpit's default profiles as basis options
- Include a special "Empty" option, with a single "View" View, with no widgets in it
- Include profiles available from other users on the system
- Ideally avoid duplicates, but that's not critical
- Ideally render out a thumbnail of each View, but at least list their names, and possibly allow expanding them to see a list of the widgets they include
- If the Profile name gets pre-filled from its basis, it should not include the word "default"
- Include Cockpit's default profiles as basis options
- Store metadata with each profile as to its basis and latest update time (unix epoch seconds)
- e.g.
{"branched_from": "defaults:ROV profile", "branched_on": 1727951073, "last_updated": 1727951207} - This would make it trivial to provide a notification when a basis profile has been updated
- Storing release date metadata with each widget would allow also providing notifications when there are new widgets released since the last update of this user's most recently updated profile
- This would also allow showing "new" icons on the widgets in edit mode, based on the active profile's last update time
- e.g.
- This gets resolved by 7.
- There should be no initial profiles for a completely new vehicle
- Per 3., the Profile creator should open when a user is created without profiles
- It should also open if a vehicle is connected and the user has no available Cockpit profile that supports that vehicle type
- Per 3., the Profile creator should open when a user is created without profiles
- The icon should be consistently included in the dropdown, including for the selected option
- It seems redundant to have "profile" in the name of every profile - perhaps we could have a "Current Profile" heading to the left of the profile selector, and let profiles be named normally
Prerequisites
- [X] I have checked to make sure that a similar request has not already been filed or fixed.