-
Notifications
You must be signed in to change notification settings - Fork 309
Codex/unlink cloud storage #1151
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
base: release/v1.3
Are you sure you want to change the base?
Codex/unlink cloud storage #1151
Conversation
…hen-set-to-0 Fix popup script menu when expand limit is zero
- Refactored sidebar menu into `SiderMenu` component - Updated `Sider` to use a Drawer on mobile (<768px) - Added hamburger button for mobile navigation - Adjusted content padding and layout for mobile view
- Refactored sidebar menu into `SiderMenu` component - Updated `Sider` to use a Drawer on mobile (<768px) - Added hamburger button for mobile navigation - Adjusted content padding and layout for mobile view - Fixed linting errors
…5106827526 Mobile Responsive UI for Options Page
…3980127985106827526 Revert "Mobile Responsive UI for Options Page"
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.
Pull request overview
This PR adds functionality to unbind cloud storage accounts by introducing an "Unbind" button for cloud storage providers (Baidu Netdisk, OneDrive, Google Drive, and Dropbox).
Changes:
- Added
ClearNetDiskTokenfunction to remove cloud storage authentication tokens - Implemented unbind UI with confirmation dialog in the file system parameters component
- Added internationalization support for unbind-related messages across 8 languages
- Fixed menu expansion logic to properly handle unlimited expansion when
menuExpandNumis 0
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/filesystem/auth.ts | Exports NetDiskType and adds ClearNetDiskToken function to clear stored tokens |
| src/pages/components/FileSystemParams/index.tsx | Adds unbind button with confirmation dialog for cloud storage providers |
| src/pages/components/ScriptMenuList/index.tsx | Fixes menu expansion logic to handle zero limit case |
| src/locales/*/translation.json | Adds translation keys for unbind functionality across all supported languages |
| }, | ||
| ]; | ||
| const netDiskTypeMap: Partial<Record<FileSystemType, NetDiskType>> = { | ||
| "baidu-netdsik": "baidu", |
Copilot
AI
Jan 21, 2026
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.
Corrected spelling of 'netdsik' to 'netdisk'.
| }) => { | ||
| const fsParams = FileSystemFactory.params(); | ||
| const { t } = useTranslation(); | ||
| const actionButtons = [...actionButton]; |
Copilot
AI
Jan 21, 2026
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.
Creating a shallow copy of actionButton array and then mutating it with push is unnecessary. Consider using array concatenation or spread operator at the render site to avoid mutation and make the code more functional.
| const key = `netdisk:token:${netDiskType}`; | ||
| try { | ||
| await localStorageDAO.delete(key); | ||
| } catch (_) { |
Copilot
AI
Jan 21, 2026
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.
The unused error parameter should be named _error instead of _ to indicate it's an intentionally unused error value, following common TypeScript conventions.
| const hasExpandLimit = menuExpandNum > 0; | ||
|
|
||
| const visibleMenus = useMemo(() => { | ||
| // 当menuExpandNum为0时,跟随 isActive 状态显示全部菜单 | ||
| const m = scriptMenus?.group || []; | ||
| if (menuExpandNum === 0 && isActive) { | ||
| return m; | ||
| } | ||
| if (!hasExpandLimit) return m; | ||
| return m.length > menuExpandNum && !isExpand ? m.slice(0, menuExpandNum) : m; | ||
| }, [scriptMenus?.group, isExpand, menuExpandNum, isActive]); | ||
| }, [scriptMenus?.group, hasExpandLimit, isExpand, menuExpandNum]); | ||
|
|
||
| const shouldShowMore = useMemo( | ||
| () => menuExpandNum > 0 && scriptMenus?.group?.length > menuExpandNum, | ||
| [scriptMenus?.group, menuExpandNum] | ||
| () => hasExpandLimit && scriptMenus?.group?.length > menuExpandNum, | ||
| [hasExpandLimit, scriptMenus?.group, menuExpandNum] |
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.
0 indicates a hidden menu; if you want to show all menu items, you can set a much larger value.
| const netDiskTypeMap: Partial<Record<FileSystemType, NetDiskType>> = { | ||
| "baidu-netdsik": "baidu", | ||
| onedrive: "onedrive", | ||
| googledrive: "googledrive", | ||
| dropbox: "dropbox", | ||
| }; | ||
| const netDiskType = netDiskTypeMap[fileSystemType]; | ||
| const netDiskName = fileSystemList.find((item) => item.key === fileSystemType)?.name; |
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.
Let me adjust.
概述 Descriptions
Solve the issue of not having a cloud unlink button.