-
Notifications
You must be signed in to change notification settings - Fork 5
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
Refactor and Standardize Route paths #1362
Conversation
WalkthroughThe changes primarily involve updating various URL paths in the project to new full-screen paths. This includes changes in navigation and window opening functions across multiple components and constants. The updates ensure that actions such as account creation, importing, and restoring are directed to their respective full-screen views. Changes
Sequence Diagram(s) (Beta)sequenceDiagram
participant User
participant UI
participant Router
participant FullScreenHandler
User->>UI: Click "Create Account"
UI->>Router: Navigate to `/create-account-full-screen`
Router->>FullScreenHandler: Handle full-screen view
FullScreenHandler->>User: Display Create Account Full-Screen
User->>UI: Click "Import JSON"
UI->>Router: Navigate to `/import/restore-json-full-screen`
Router->>FullScreenHandler: Handle full-screen view
FullScreenHandler->>User: Display Import JSON Full-Screen
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range and nitpick comments (2)
packages/extension-ui/src/Popup/index.tsx (2)
Line range hint
186-186
: Consider replacing the delete operator to improve performance.- delete (newPrices as Prices).currencyCode; + (newPrices as Prices).currencyCode = undefined;
Line range hint
200-200
: Ensure all dependencies are specified in the useEffect hook.- }, []); + }, [_onAction]);
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (13)
- packages/extension-base/src/defaults.ts (1 hunks)
- packages/extension-polkagate/src/fullscreen/homeFullScreen/partials/HomeMenu.tsx (1 hunks)
- packages/extension-polkagate/src/fullscreen/homeFullScreen/partials/ImportAccSubMenuFullScreen.tsx (2 hunks)
- packages/extension-polkagate/src/fullscreen/onboarding/index.tsx (3 hunks)
- packages/extension-polkagate/src/partials/AddNewAccountButton.tsx (1 hunks)
- packages/extension-polkagate/src/partials/ImportAccSubMenu.tsx (2 hunks)
- packages/extension-polkagate/src/partials/Menu.tsx (1 hunks)
- packages/extension-polkagate/src/partials/NewAccountSubMenu.tsx (1 hunks)
- packages/extension-polkagate/src/popup/passwordManagement/Reset.tsx (1 hunks)
- packages/extension-polkagate/src/popup/passwordManagement/ResetFS.tsx (1 hunks)
- packages/extension-polkagate/src/popup/welcome/index.tsx (2 hunks)
- packages/extension-polkagate/src/util/constants.tsx (1 hunks)
- packages/extension-ui/src/Popup/index.tsx (2 hunks)
Additional context used
Biome
packages/extension-ui/src/Popup/index.tsx
[error] 186-186: Avoid the delete operator which can impact performance. (lint/performance/noDelete)
Unsafe fix: Use an undefined assignment instead.
[error] 200-200: This hook does not specify all of its dependencies: _onAction (lint/correctness/useExhaustiveDependencies)
This dependency is not specified in the hook dependency list.
Either include it or remove the dependency array
Additional comments not posted (29)
packages/extension-base/src/defaults.ts (1)
4-4
: Verify the update toALLOWED_PATH
.Verification successful
The removed paths
/account/import-ledger
and/account/restore-json
are not used elsewhere in the codebase, indicating that their removal fromALLOWED_PATH
was likely intentional.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify if the removal of other paths from `ALLOWED_PATH` was intentional. # Test: Search for usage of removed paths. Expect: No occurrences if removal was intentional. rg --type python $'/account/import-ledger|/account/restore-json'Length of output: 96
Script:
#!/bin/bash # Description: Verify if the removal of other paths from `ALLOWED_PATH` was intentional. # Test: Search for usage of removed paths. Expect: No occurrences if removal was intentional. rg '/account/import-ledger|/account/restore-json'Length of output: 51
packages/extension-polkagate/src/partials/NewAccountSubMenu.tsx (1)
30-30
: Path update inwindowOpen
call is correct and aligns with the new routing strategy.packages/extension-polkagate/src/partials/AddNewAccountButton.tsx (1)
25-26
: Path updates inwindowOpen
andonAction
calls are correct and align with the new routing strategy.packages/extension-polkagate/src/popup/passwordManagement/Reset.tsx (1)
22-22
: Path updates inwindowOpen
calls are correct and align with the new routing strategy.Also applies to: 26-26
packages/extension-polkagate/src/popup/passwordManagement/ResetFS.tsx (2)
27-27
: LGTM! The URL path update aligns with the PR objectives.
31-31
: LGTM! The URL path update aligns with the PR objectives.packages/extension-polkagate/src/popup/welcome/index.tsx (5)
26-26
: LGTM! The URL path update aligns with the PR objectives.
32-32
: LGTM! The URL path update aligns with the PR objectives.
38-38
: LGTM! The URL path update aligns with the PR objectives.
50-50
: LGTM! The URL path update aligns with the PR objectives.
56-56
: LGTM! The URL path update aligns with the PR objectives.packages/extension-polkagate/src/fullscreen/homeFullScreen/partials/ImportAccSubMenuFullScreen.tsx (4)
30-30
: LGTM! The URL path update aligns with the PR objectives.
34-34
: LGTM! The URL path update aligns with the PR objectives.
38-38
: LGTM! The URL path update aligns with the PR objectives.
54-54
: LGTM! The URL path update aligns with the PR objectives.packages/extension-polkagate/src/partials/ImportAccSubMenu.tsx (4)
29-29
: LGTM! The URL path update aligns with the PR objectives.
33-33
: LGTM! The URL path update aligns with the PR objectives.
37-37
: LGTM! The URL path update aligns with the PR objectives.
49-49
: LGTM! The URL path update aligns with the PR objectives.packages/extension-polkagate/src/fullscreen/homeFullScreen/partials/HomeMenu.tsx (1)
76-76
: LGTM! Ensure all function calls toopenOrFocusTab
with the old path are updated to use the new path.Verification successful
The verification confirms that all instances of the old path have been updated to the new path.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `openOrFocusTab` match the new path. # Test: Search for the function usage with the old path. Expect: No occurrences. rg --type python $'openOrFocusTab\("/account/create"\)'Length of output: 87
Script:
#!/bin/bash # Description: Verify all function calls to `openOrFocusTab` match the new path. # Test: Search for the function usage with the old path. Expect: No occurrences. rg --type tsx $'openOrFocusTab\("/account/create"\)'Length of output: 81
Script:
#!/bin/bash # Description: Verify all function calls to `openOrFocusTab` match the new path. # Test: Search for the function usage with the old path. Expect: No occurrences. rg --type typescript $'openOrFocusTab\("/account/create"\)'Length of output: 95
Script:
#!/bin/bash # Description: Verify all function calls to `openOrFocusTab` match the new path. # Test: Search for the function usage with the old path. Expect: No occurrences. rg --glob '*.tsx' $'openOrFocusTab\("/account/create"\)'Length of output: 57
packages/extension-polkagate/src/fullscreen/onboarding/index.tsx (1)
43-43
: LGTM! Ensure all function calls towindowOpen
with the old paths are updated to use the new paths.Also applies to: 49-49, 66-66, 78-78, 84-84
Verification successful
The previous script executed successfully and found no occurrences of the old paths in the codebase. This indicates that all instances of
windowOpen
have been updated to use the new paths.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `windowOpen` match the new paths. # Test: Search for the function usage with the old paths. Expect: No occurrences. rg --type python $'windowOpen\("/account/restore-json"\)|windowOpen\("/account/import-ledger"\)|windowOpen\("/account/create"\)|windowOpen\("/account/import-seed"\)|windowOpen\("/account/import-raw-seed"\)'Length of output: 238
Script:
#!/bin/bash # Description: Verify all function calls to `windowOpen` match the new paths. # Test: Search for the function usage with the old paths. Expect: No occurrences. rg --type js --type ts $'windowOpen\("/account/restore-json"\)|windowOpen\("/account/import-ledger"\)|windowOpen\("/account/create"\)|windowOpen\("/account/import-seed"\)|windowOpen\("/account/import-raw-seed"\)'Length of output: 213
packages/extension-polkagate/src/partials/Menu.tsx (1)
68-68
: LGTM! Ensure all function calls toonAction
with the old path are updated to use the new path.Verification successful
The verification confirms that there are no remaining instances of the old path
"/account/export-all"
in the codebase. The update to the new path has been correctly applied.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `onAction` match the new path. # Test: Search for the function usage with the old path. Expect: No occurrences. rg --type python $'onAction\("/account/export-all"\)'Length of output: 85
Script:
#!/bin/bash # Description: Verify all function calls to `onAction` match the new path. # Test: Search for the function usage with the old path. Expect: No occurrences. rg --type typescript $'onAction\("/account/export-all"\)'Length of output: 93
Script:
#!/bin/bash # Description: Verify all function calls to `onAction` match the new path. # Test: Search for the function usage with the old path. Expect: No occurrences. rg $'onAction\("/account/export-all"\)'Length of output: 40
packages/extension-polkagate/src/util/constants.tsx (1)
212-212
: LGTM! Ensure all uses ofALLOWED_URL_ON_RESET_PASSWORD
are updated to reflect the new paths.packages/extension-ui/src/Popup/index.tsx (6)
287-287
: Updated route path for account creation aligns with PR objectives.
291-291
: Updated route path for exporting all accounts aligns with PR objectives.
305-305
: Updated route path for importing ledger accounts aligns with PR objectives.
308-308
: Updated route path for importing raw seed accounts aligns with PR objectives.
309-309
: Updated route path for restoring JSON accounts aligns with PR objectives.
310-310
: Updated route path for importing seed accounts aligns with PR objectives.
if we are going to have /import/ledger-full-screen then we can similarly have changes like /import/attach-qr ==> /import/qr an so on right? |
good suggestion, I will handle it. |
Works Done
Paths changed:
/account/import-ledger
-->>/import/ledger-full-screen
/account/create
-->>/create-account-full-screen
/account/restore-json
-->>/import/restore-json-full-screen
/account/import-seed
-->>/import/seed-full-screen
/account/import-raw-seed
-->>/import/raw-seed-full-screen
/account/export-all
-->>/export/all
ALLOWED_URL_ON_RESET_PASSWORD
updated.packages/extension-ui/src/Popup/index.tsx
routes updated.Close #1361.
Summary by CodeRabbit
New Features
Updates
Bug Fixes