Skip to content

Conversation

@RenjiYuusei
Copy link
Contributor

概述 Descriptions

Solve the issue of not having a cloud unlink button.

RenjiYuusei and others added 10 commits October 31, 2025 00:06
…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"
@RenjiYuusei RenjiYuusei reopened this Jan 20, 2026
@CodFrm CodFrm changed the base branch from main to release/v1.3 January 21, 2026 03:20
@CodFrm CodFrm changed the base branch from release/v1.3 to main January 21, 2026 03:23
@CodFrm CodFrm changed the base branch from main to release/v1.3 January 21, 2026 03:23
@CodFrm CodFrm requested a review from Copilot January 21, 2026 03:24
Copy link
Contributor

Copilot AI left a 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 ClearNetDiskToken function 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 menuExpandNum is 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",
Copy link

Copilot AI Jan 21, 2026

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'.

Copilot uses AI. Check for mistakes.
}) => {
const fsParams = FileSystemFactory.params();
const { t } = useTranslation();
const actionButtons = [...actionButton];
Copy link

Copilot AI Jan 21, 2026

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.

Copilot uses AI. Check for mistakes.
const key = `netdisk:token:${netDiskType}`;
try {
await localStorageDAO.delete(key);
} catch (_) {
Copy link

Copilot AI Jan 21, 2026

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.

Copilot uses AI. Check for mistakes.
Comment on lines 187 to 197
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]
Copy link
Member

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.

Comment on lines +52 to +59
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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me adjust.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants