feat: APP-866 stay on same page when switching dashboards#2789
feat: APP-866 stay on same page when switching dashboards#2789alexander-astrand merged 8 commits intodevfrom
Conversation
✅ Deploy Preview for terrasos ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Summary of ChangesHello @alexander-astrand, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the dashboard user experience by introducing smarter navigation when switching between personal and organization views. Instead of always redirecting to a default page, the system now attempts to keep the user on the same section, or a logical fallback, ensuring a more seamless transition and reducing the need for users to re-navigate to their desired content. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request implements the logic to maintain the current page when switching between personal and organization dashboards. A new function, getSwitchDashboardPath, is introduced to compute the appropriate navigation path, which includes sensible fallbacks for pages not available on the target dashboard. While the changes successfully implement the feature, I have identified a couple of areas for improvement. My review includes a suggestion to enhance the readability of the path-switching logic and a comment on a potential performance concern related to eager data fetching for both dashboard types.
|
@erikalogie @S4mmyb See testing instructions |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 69ab6e24bb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
there's a bug when I'm logging in with a web2 account that is a member of an org (eg a viewer since it has no wallet addr)
if I check my org sell orders, then switch to my user dashboard, I'm redirected to /dashboard/sell-orders while there's actually no sell order section for my web2 account (as expected)
I also found another (existing) bug: as a web2 org member, you can't access the org dashboard portfolio while you should be able to see it without being able to perform any tx of course. But I guess we can create a separate task for that
| ? organizationHasCreditBatches | ||
| : personalHasCreditBatches; | ||
|
|
||
| const getSwitchDashboardPath = (targetIsOrg: boolean) => { |
There was a problem hiding this comment.
we could wrap it in useCallback and we could even migrate some portion of the logic to Dashboard.utils.tsx to improve code visibility, Dashboard.tsx is already quite large!
There was a problem hiding this comment.
adding some comments would be nice too
There was a problem hiding this comment.
Did you open a bug for the second one?
|
Ok this looks good to me aside from the things that Marie already pointed out |
|
https://www.loom.com/share/ccc6a8f37775442db031625d88a61dbc Maybe we should discuss this during the engineering call |
|
Overall looks good and works - we just discussed on the engineering call that if you are within a project (i.e. managing a project) and switch accounts from that view, the redirect should go to projects rather than portfolio if the individual/org doesn't have access to that project. |
@alexander-astrand ignore this, Marie and Sam thought it was fine as-is |
b54dc20 to
479099e
Compare
blushi
left a comment
There was a problem hiding this comment.
Logged in with a web2 account, if I go to my dashboard/settings then switch to org dashboard then I see "You must connect to Keplr..." screen but I guess once you update your branch with latest dev it should be fixed by #2794 so pre-approving, pending small cleanup
| personalHasCreditBatches: boolean; | ||
| organizationBatchesLoading: boolean; | ||
| personalBatchesLoading: boolean; | ||
| hasOrders: boolean; |
… between dashboards
d77f48d to
f6178b2
Compare
Description
https://regennetwork.atlassian.net/browse/APP-866
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
How to test
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...