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

🚸 tab selection and state should be reflected in URL #145

Open
jdhoffa opened this issue Dec 10, 2024 · 1 comment
Open

🚸 tab selection and state should be reflected in URL #145

jdhoffa opened this issue Dec 10, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@jdhoffa
Copy link
Member

jdhoffa commented Dec 10, 2024

The currently selected tab and its state (e.g., selections within the tab) are not reflected in the URL. This makes it impossible to return to a specific view within the dashboard. While this is a "nice-to-have" feature, it will become more critical once sharing functionality is added to the web app.

@jdhoffa jdhoffa added the enhancement New feature or request label Dec 10, 2024
@cjyetman
Copy link
Member

The "easy" way (at least on a simplistic website with no svelte-like fanciness) to do this would be to create separate pages for each tab and have each tab link to the appropriate page. I doubt that's desirable here.

Maybe something like this could be achieved with cookies, but I doubt that's adequate here because I suspect this issue is implicitly connected to a desire to be able to share the URL with someone else or another browser.

Alternatively, we'd need to encode the information needed to bring the user back to a specific view in the URL. That can be done through URL query string/parameters, e.g. https://rmi-pacta.github.io/pacta-dashboard-svelte?page=company-level, or possibly through a customized route or page slug if svelte can handle that, e.g. https://rmi-pacta.github.io/pacta-dashboard-svelte/company-level. One could probably hack something together with anchor tags too, e.g. https://rmi-pacta.github.io/pacta-dashboard-svelte/#company-level, though I don't think that's standard usage.

If the intent is to capture not only what tab the user is on but also what selections have been made on the various selectors on the page, I'd imagine URL query strings would be the most realistic, e.g. https://rmi-pacta.github.io/pacta-dashboard-svelte?page=company&sector=Automotive&scenario=NZE_2050, because it's easy to mix and match different key-value pairs and the order is (or at least can be) irrelevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants