Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retain selected tab when domain is switched #97446

Open
Imran92 opened this issue Dec 13, 2024 · 6 comments · May be fixed by #97719
Open

Retain selected tab when domain is switched #97446

Imran92 opened this issue Dec 13, 2024 · 6 comments · May be fixed by #97719
Labels
[Experiment] AI labels added [Feature] Domain Management Tools for managing your site's domain(s). [Feature Group] Emails & Domains Features related to email integrations and domain management. [Feature] Site Navigation

Comments

@Imran92
Copy link
Contributor

Imran92 commented Dec 13, 2024

In our new flyout view, when domain is switched, we open the default tab, that is the domain overview tab. So even if we are currently on the Emails tab, if we switch domains, the Overview will be opened for the new domain. Then we'll need to switch to the Emails tab.

Similar to how wordpress.com/sites work, we want to open the same tab when domains are switched

Copy link

OpenAI suggested the following labels for this issue:

  • [Feature Group] Emails & Domains: The issue is related to switching domains and retaining the selected tab, which falls under domain management and email functionalities.
  • [Feature] Domain Management: This specifically addresses the management of domains, which is directly relevant to the context of switching domains in the issue.
  • [Feature] Site Navigation: The issue discusses user navigation between tabs, particularly retaining the current tab during domain switching, which is related to site navigation features.

@github-actions github-actions bot added [Feature Group] Emails & Domains Features related to email integrations and domain management. [Feature] Domain Management Tools for managing your site's domain(s). [Feature] Site Navigation [Experiment] AI labels added labels Dec 13, 2024
@donnapep donnapep self-assigned this Dec 18, 2024
@donnapep
Copy link
Contributor

donnapep commented Dec 19, 2024

@Imran92 I've been digging into the details of the Domains dashboard and how info gets passed around in order to try to fix this one. Looking at how the Sites dashboard does it, I think this will be easier to implement and require less rework once DataViews are already in place. Any objection to moving this one to Blocked for the time being?

Please let me know if I've missed something or if you already had an idea of how to solve this in a simpler way. Thx!

@donnapep
Copy link
Contributor

For kicks, I checked out the draft DataViews branch and tried to fix this there, but it looks like the list of domains in the sidebar is still using the old structure (i.e. <a> elements with hardcoded href attributes instead of <span> tags).

@Imran92
Copy link
Contributor Author

Imran92 commented Dec 20, 2024

Thanks for diggint deeper into it @donnapep! You're totally right, it makes sense to wait until the DataViews conversion is done to avoid rework. I put together a quick POC here: #97710 with a very simple version of it. It's just a rough draft and also doesn’t handle subpages yet.

Though, I actually think we shouldn't worry about retaining subpages even in the future either since not all domains have all of them, so it won't be a 1:1 map for each domain, and it could make things unnecessarily complicated. Instead, we could just pick the email tab when we can surely detect, and fall back to the overview tab as the default.

Also, I used window.location.pathname in the POC, but we could switch to using the existing withCurrentRoute HOC or useCurrentRoute hook later if we want—it’s probably cleaner. But I don’t think it’s a blocker at all. Totally okay to do it later as an improvement.

Let me know what you think!

@donnapep
Copy link
Contributor

Putting this back in Doing as I see a potential solution now.

@donnapep donnapep linked a pull request Dec 20, 2024 that will close this issue
12 tasks
@donnapep
Copy link
Contributor

donnapep commented Dec 20, 2024

@Imran92 Turns out I'm not totally right. 😆 There is a relatively simple way to do it as per #97719. I'll need to hand this one off to someone else on the team though as I'm going AFK and there are still a few TODOs.

@donnapep donnapep linked a pull request Dec 20, 2024 that will close this issue
12 tasks
@donnapep donnapep removed their assignment Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Experiment] AI labels added [Feature] Domain Management Tools for managing your site's domain(s). [Feature Group] Emails & Domains Features related to email integrations and domain management. [Feature] Site Navigation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants