rancher-desktop icon indicating copy to clipboard operation
rancher-desktop copied to clipboard

[DNM] ui: add mechanism to store and re-open last active tab in Preferences

Open torchiaf opened this issue 2 years ago • 7 comments

Blocked by #3196 (Need Rebase)

Fixes #2634 Signed-off-by: Francesco Torchia [email protected]

torchiaf avatar Sep 26 '22 08:09 torchiaf

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:

Screen Shot 2022-09-26 at 12 04 52 PM

This very obviously would be a separate story as well (also separate from the URL thing).

jandubois avatar Sep 26 '22 19:09 jandubois

PR #3099 is merged. I already rebased the branch, so it is now possible to merge this PR itself after the review.

torchiaf avatar Oct 13 '22 18:10 torchiaf

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.

ericpromislow avatar Oct 14 '22 17:10 ericpromislow

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.

jandubois avatar Oct 14 '22 17:10 jandubois

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.

ericpromislow avatar Oct 14 '22 18:10 ericpromislow

The work item for the main window is now covered at #3166

All that's needed here is to handle sub-tabs.

ericpromislow avatar Oct 14 '22 18:10 ericpromislow

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.

torchiaf avatar Oct 18 '22 14:10 torchiaf