rancher-desktop
rancher-desktop copied to clipboard
[DNM] ui: add mechanism to store and re-open last active tab in Preferences
Would we be able to open to a specific page based on a URL as well? In particular, I'm thinking that for diagnostics it would be useful to open to the correct page (and ideally, highlight the correct control, but that's probably not for this PR) so that the user can change the setting as needed.
I agree that we would want this functionality, but I think it deserves its own issue and PR.
As for highlighting the control, that's something I talked about with @rak-phillip before: eventually we want to have a search feature in our settings (because we have lots of things we want to add). A simple mechanism can be seen in e.g. macOS preferences, but I'm partial to how it works in iTerm:

This very obviously would be a separate story as well (also separate from the URL thing).
PR #3099 is merged. I already rebased the branch, so it is now possible to merge this PR itself after the review.
I think sub-tabs need to be remembered as well.
If I open preferences, navigate to the Environment
subtab of Application
, and then close the window,
when I reopen prefs, I'm at Application:Behavior
, not Application:Environment
Otherwise, it does remember the tabs.
The other thing is this raises the question why we're tracking the last-selected-tab for the Preferences window, but not the main window, which always selects General
whenever it's opened.
I think sub-tabs need to be remembered as well.
I agree with this.
The other thing is this raises the question why we're tracking the last-selected-tab for the Preferences window, but not the main window, which always selects
General
whenever it's opened.
When you say "opened" you mean "when the app is launched", right?
We decided that all these settings should be ephemeral and only remembered as long as the application stays open. They all reset back to their defaults whenever you restart the application.
This is similar to not remembering the window sizes and positions, or filter criteria in the Images tab, etc.
When you say "opened" you mean "when the app is launched", right?
No, I meant after you close the Main Window, and then choose the Preferences
menu item from the tray to reopen it, RD doesn't remember the last tab you were visiting in the Main Window.
I have no problem if this state is ephemeral.
The work item for the main window is now covered at #3166
All that's needed here is to handle sub-tabs.
The work item for the main window is now covered at #3166
All that's needed here is to handle sub-tabs.
Hi @ericpromislow, thanks for the review. I created a different PR #3196 for sub-tabs handling which blocks the this one.