Skip to content

feat(profile): Profile 链接支持图标/横幅两种样式并可在设置面板切换 - #652

Open
Neko-Tsuki wants to merge 2 commits into
CuteLeaf:masterfrom
Neko-Tsuki:feat/profile-link-display-mode
Open

Neko-Tsuki wants to merge 2 commits into
CuteLeaf:masterfrom
Neko-Tsuki:feat/profile-link-display-mode

Conversation

@Neko-Tsuki

@Neko-Tsuki Neko-Tsuki commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Profile 组件的社交链接原先只有「全图标」或「按 links[].showName 逐条决定」 两种硬编码形态,现抽象为可切换的显示模式:

  • icon:紧凑方形按钮,只显示图标;单条链接仍可用 showName 打开名称(原行为)
  • banner:横向宽按钮、常显名称,换行按内容宽度决定、同行按钮再拉伸铺满

Type of change

  • Bug fix (a non-breaking change that fixes an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other (please describe):

Checklist

  • I have read the CONTRIBUTING document.
  • I have checked to ensure that this Pull Request is not for personal changes.
  • I have performed a self-review of my own code.
  • My changes generate no new warnings.

Related Issue

Changes

Profile 组件的社交链接目前只有「全图标」或「按 links[].showName 逐条决定」两种硬编码形态。
本 PR 将其抽象为一个可切换的显示模式:

  • icon:紧凑方形按钮,只显示图标;单条链接仍可用 showName 打开名称(与现状完全一致)
  • banner:横向宽按钮、常显名称;换行按内容宽度决定,同一行的按钮再拉伸铺满

两种模式共用同一份 DOM,形态由 <html data-profile-link-mode> 上的 CSS(新增
src/styles/profile.css)切换,因此设置面板里的切换即时生效,无需重渲染组件或刷新页面。

同时新增显示设置面板「外观 → Profile 链接样式」一栏,一组按钮切换两种模式,带「恢复默认」,
选择记忆到 localStorage;模式在 Layout.astro 的内联脚本里于首帧前应用,避免跳变。

主要改动:

  • 新增 src/styles/profile.css(基础规则 = 原「图标模式」行为,banner 模式在其上覆盖)
  • profileConfig 新增可选字段 linkDisplayMode(默认 "icon",不填等同 "icon")
  • displaySettingsConfig 新增 profileLinkModeSwitchable
  • setting-utils 新增 getDefault/getStored/setProfileLinkMode,写入 <html data-profile-link-mode>
  • DisplaySettingsIntegrated.svelte 新增设置项,按钮组用 auto-fit 网格自适应排列
  • i18n 新增 profileLinkMode / profileLinkModeIcon / profileLinkModeBanner(6 种语言)

顺带把 Profile.astro 里 links.length > 1 && ...map(...) 加单条特判的重复渲染逻辑统一为一次
links.map(),行为等价。

How To Test

  1. pnpm install && pnpm dev
  2. 确认显示设置面板已开启:src/config/displaySettingsConfig.ts 的 enable: true,
    或设环境变量 PUBLIC_DISPLAY_SETTINGS=true
  3. 打开首页,点右上角「显示设置」→「外观」Tab,拉到最底部「Profile 链接样式」
  4. 点「横幅」:侧边栏 Profile 卡片底部链接立即变成横向宽按钮并常显名称(无需刷新)
  5. 点「仅图标」:立即变回紧凑方形图标按钮
  6. 点该栏右侧的「恢复默认」:回到 profileConfig.linkDisplayMode 的值
  7. 刷新页面:选择被记住(localStorage profileLinkDisplayMode)
  8. 把侧边栏调窄(或浏览器窗口拉窄):横幅模式下按钮会从一行多个自动变成一行一个
  9. 不填 linkDisplayMode 或设为 "icon",并给某条链接设 showName: true:
    该条仍显示图标 + 名称,其余仅图标 —— 与改动前一致

Screenshots (if applicable)

横幅模式(19rem / 14rem 侧边栏) 仅图标模式
横幅模式 仅图标模式
设置面板 按钮自适应排列 横幅模式(暗色)
设置面板 按钮自适应 暗色

Additional Notes

  • 完全向后兼容:linkDisplayMode 不填等同 "icon",配合原有 showName,渲染结果与改动前一致。
  • showName 语义收窄但未破坏:仅在 icon 模式下生效,banner 模式恒显示名称
  • 设置项受 displaySettingsConfig.enable 与 profileLinkModeSwitchable 双重控制,总开关关闭时
    面板完全不渲染,不增加首屏体积(新增 CSS 约 1 KB)
  • 本次功能提交因为涉及到多语言条目的增加遂采用ClaudeCode进行辅助,翻译内容可能有误

Sourcery 摘要

新增可运行时切换的 Profile 链接样式,提供向后兼容的默认设置,并持久化保存显示偏好。

新功能:

  • 为 Profile 链接添加可配置的图标和横幅显示模式。
  • 添加显示设置控件,用于切换 Profile 链接样式,支持恢复默认设置并保存用户偏好。
  • 为六种语言新增 Profile 链接样式设置的本地化标签。

增强功能:

  • 在图标模式下保留现有的每个链接 showName 行为,同时确保横幅模式始终显示链接名称。
  • 在首次渲染前应用已保存的 Profile 链接样式,避免视觉布局偏移。
  • 统一 Profile 链接的渲染,并支持响应式横幅布局行为。
Original summary in English

Sourcery 总结

新增可运行时切换且向后兼容的 Profile 链接样式,并持久化显示偏好。

新功能:

  • 为 Profile 链接显示新增可配置的紧凑图标和响应式横幅模式。
  • 新增显示设置控件,可切换模式、恢复默认设置,并在本地持久化偏好。
  • 为 Profile 链接样式设置新增六种语言的本地化标签。

增强功能:

  • 在图标模式下保留现有的按链接设置名称的行为,同时在横幅模式下始终显示名称。
  • 在首次渲染前应用已保存的链接显示模式,以避免视觉布局偏移。
  • 统一 Profile 链接的渲染,并支持响应式横幅换行。
Original summary in English

Summary by Sourcery

Add runtime-switchable, backward-compatible Profile link styles with persisted display preferences.

New Features:

  • Add configurable Profile link display modes for compact icons and responsive banners.
  • Add display-settings controls to switch modes, restore defaults, and persist the preference locally.
  • Add localized labels for the Profile link style setting across six languages.

Enhancements:

  • Preserve existing per-link name behavior in icon mode while always showing names in banner mode.
  • Apply the saved link display mode before the first render to prevent visual layout shifts.
  • Unify Profile link rendering and support responsive banner wrapping.

Profile 组件的社交链接原先只有「全图标」或「按 links[].showName 逐条决定」
两种硬编码形态,现抽象为可切换的显示模式:

- icon:紧凑方形按钮,只显示图标;单条链接仍可用 showName 打开名称(原行为)
- banner:横向宽按钮、常显名称,换行按内容宽度决定、同行按钮再拉伸铺满

两种模式共用同一份 DOM,形态由 <html data-profile-link-mode> 上的 CSS
(新增 src/styles/profile.css)切换,因此设置面板里的切换即时生效。

新增 profileConfig.linkDisplayMode 作为默认值,displaySettingsConfig 新增
profileLinkModeSwitchable 开关,设置面板「外观 → Profile 链接样式」可在运行时
切换并记忆到 localStorage,首帧前由 Layout.astro 的内联脚本应用以避免跳变。
面板内按钮组用 auto-fit 网格自适应列数,选项变多或标签变长都不会溢出。

顺带将 Profile.astro 中 links.length > 1 分支加单条特判的重复渲染逻辑
统一为一次 links.map(),行为等价。

Co-Authored-By: Claude Code <noreply@anthropic.com>
@netlify

netlify Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for demo-firefly ready!

Name Link
🔨 Latest commit f202183
🔍 Latest deploy log https://app.netlify.com/projects/demo-firefly/deploys/6ab643e5c4a24f0008130dfd
😎 Deploy Preview https://deploy-preview-652--demo-firefly.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@sourcery-ai

sourcery-ai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

审查者指南

本 PR 将 Profile 社交链接从固定图标/逐条名称逻辑扩展为可配置的图标和横幅两种模式,使用共享 DOM 和 CSS 支持即时响应式切换,并在显示设置中提供本地持久化、默认值恢复及多语言支持,同时保持旧配置兼容。

运行时 Profile 链接样式切换时序图

sequenceDiagram
    participant User
    participant DisplaySettingsIntegrated
    participant SettingUtils
    participant LocalStorage
    participant Document
    participant ProfileCSS

    User->>DisplaySettingsIntegrated: switchProfileLinkMode(mode)
    DisplaySettingsIntegrated->>SettingUtils: setProfileLinkMode(mode)
    SettingUtils->>LocalStorage: setItem(profileLinkDisplayMode, mode)
    SettingUtils->>Document: applyProfileLinkModeToDocument(mode)
    Document->>ProfileCSS: update data-profile-link-mode
    ProfileCSS-->>User: Profile links change immediately
Loading

初始 Profile 链接模式应用时序图

sequenceDiagram
    participant Browser
    participant Layout
    participant LocalStorage
    participant Document
    participant ProfileCSS

    Browser->>Layout: load page
    Layout->>LocalStorage: getItem(profileLinkDisplayMode)
    LocalStorage-->>Layout: stored mode or null
    Layout->>Document: set data-profile-link-mode
    Document->>ProfileCSS: apply icon or banner rules
    ProfileCSS-->>Browser: render Profile links without layout jump
Loading

文件级变更

变更 详情 文件
抽象 Profile 社交链接的图标与横幅显示模式,并通过共享 DOM 与 CSS 实现即时切换。
  • 统一链接渲染结构,保留 mailto 处理及逐条 showName 语义
  • 新增图标默认样式与横幅响应式布局样式
  • 通过 html[data-profile-link-mode] 控制当前模式
src/components/widget/Profile.astro
src/styles/profile.css
src/styles/main.css
src/types/profileConfig.ts
src/config/profileConfig.ts
在显示设置面板中增加 Profile 链接样式切换、恢复默认值和持久化逻辑。
  • 新增可配置的 profileLinkModeSwitchable 开关及设置项
  • 支持图标/横幅切换、默认值重置和 localStorage 记忆
  • 使用自适应网格排列设置按钮
src/components/controls/DisplaySettingsIntegrated.svelte
src/config/displaySettingsConfig.ts
src/types/displaySettingsConfig.ts
src/utils/display-settings-utils.ts
src/utils/setting-utils.ts
src/styles/display-settings.css
在页面首帧前应用用户保存的链接模式,并补充多语言设置文案。
  • Layout 内联脚本读取并校验 localStorage,提前设置 html 数据属性以避免首帧跳变
  • 新增模式名称及选项文案,覆盖六种语言
src/layouts/Layout.astro
src/i18n/i18nKey.ts
src/i18n/languages/en.ts
src/i18n/languages/ja.ts
src/i18n/languages/ko.ts
src/i18n/languages/ru.ts
src/i18n/languages/zh_CN.ts
src/i18n/languages/zh_TW.ts

提示与命令

与 Sourcery 交互

  • 触发新的审查: 在拉取请求中评论 @sourcery-ai review。
  • 继续讨论: 直接回复 Sourcery 的审查评论。
  • 从审查评论生成 GitHub issue: 回复审查评论,请 Sourcery 根据该评论创建 issue。你也可以回复审查评论并使用 @sourcery-ai issue,从该评论创建 issue。
  • 生成拉取请求标题: 在拉取请求标题的任意位置写入 @sourcery-ai,即可随时生成标题。你也可以在拉取请求中评论 @sourcery-ai title,随时重新生成标题。
  • 生成拉取请求摘要: 在拉取请求正文中你希望插入摘要的位置写入 @sourcery-ai summary,即可随时生成 PR 摘要。你也可以在拉取请求中评论 @sourcery-ai summary,随时重新生成摘要。
  • 生成审查者指南: 在拉取请求中评论 @sourcery-ai guide,即可随时重新生成审查者指南。
  • 解决所有 Sourcery 评论: 在拉取请求中评论 @sourcery-ai resolve,即可解决所有 Sourcery 评论。如果你已经处理完所有评论且不想再看到它们,此功能会非常有用。
  • 忽略所有 Sourcery 审查: 在拉取请求中评论 @sourcery-ai dismiss,即可忽略所有现有的 Sourcery 审查。如果你想从新的审查开始,这项功能尤其有用——别忘了评论 @sourcery-ai review 以触发新的审查!

自定义使用体验

访问你的控制面板以便:

  • 启用或禁用审查功能,例如 Sourcery 生成的拉取请求摘要、审查者指南等。
  • 更改审查语言。
  • 添加、删除或编辑自定义审查说明。
  • 调整其他审查设置。

获取帮助

Original review guide in English

Reviewer's Guide

本 PR 将 Profile 社交链接从固定图标/逐条名称逻辑扩展为可配置的 icon 与 banner 两种模式,使用共享 DOM 和 CSS 支持即时响应式切换,并在显示设置中提供本地持久化、默认值恢复及多语言支持,同时保持旧配置兼容。

Sequence diagram for runtime Profile link style switching

sequenceDiagram
    participant User
    participant DisplaySettingsIntegrated
    participant SettingUtils
    participant LocalStorage
    participant Document
    participant ProfileCSS

    User->>DisplaySettingsIntegrated: switchProfileLinkMode(mode)
    DisplaySettingsIntegrated->>SettingUtils: setProfileLinkMode(mode)
    SettingUtils->>LocalStorage: setItem(profileLinkDisplayMode, mode)
    SettingUtils->>Document: applyProfileLinkModeToDocument(mode)
    Document->>ProfileCSS: update data-profile-link-mode
    ProfileCSS-->>User: Profile links change immediately
Loading

Sequence diagram for initial Profile link mode application

sequenceDiagram
    participant Browser
    participant Layout
    participant LocalStorage
    participant Document
    participant ProfileCSS

    Browser->>Layout: load page
    Layout->>LocalStorage: getItem(profileLinkDisplayMode)
    LocalStorage-->>Layout: stored mode or null
    Layout->>Document: set data-profile-link-mode
    Document->>ProfileCSS: apply icon or banner rules
    ProfileCSS-->>Browser: render Profile links without layout jump
Loading

File-Level Changes

Change Details Files
抽象 Profile 社交链接的图标与横幅显示模式,并通过共享 DOM 与 CSS 实现即时切换。
  • 统一链接渲染结构,保留 mailto 处理及逐条 showName 语义
  • 新增 icon 默认样式与 banner 响应式布局样式
  • 通过 html[data-profile-link-mode] 控制当前模式
src/components/widget/Profile.astro
src/styles/profile.css
src/styles/main.css
src/types/profileConfig.ts
src/config/profileConfig.ts
在显示设置面板中增加 Profile 链接样式切换、恢复默认和持久化逻辑。
  • 新增可配置的 profileLinkModeSwitchable 开关及设置项
  • 支持 icon/banner 切换、默认值重置和 localStorage 记忆
  • 使用自适应网格排列设置按钮
src/components/controls/DisplaySettingsIntegrated.svelte
src/config/displaySettingsConfig.ts
src/types/displaySettingsConfig.ts
src/utils/display-settings-utils.ts
src/utils/setting-utils.ts
src/styles/display-settings.css
在页面首帧前应用用户保存的链接模式,并补充多语言设置文案。
  • Layout 内联脚本读取并校验 localStorage,提前设置 html 数据属性以避免首帧跳变
  • 新增模式名称及选项文案,覆盖六种语言
src/layouts/Layout.astro
src/i18n/i18nKey.ts
src/i18n/languages/en.ts
src/i18n/languages/ja.ts
src/i18n/languages/ko.ts
src/i18n/languages/ru.ts
src/i18n/languages/zh_CN.ts
src/i18n/languages/zh_TW.ts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

嘿——我发现了 2 个问题

面向 AI Agent 的提示
请处理本次代码审查中的评论:

## 单独评论

### 评论 1
<location path="src/components/widget/Profile.astro" line_range="60-78" />
<code_context>
+                // 图标 / 横幅两种模式共用同一份 DOM,由 html[data-profile-link-mode] 上的
+                // CSS(src/styles/profile.css)切换形态,这样才能在显示设置面板里即时切换。
+                // data-show-name 只对「仅图标」模式有意义:该模式下逐条决定是否显示名称。
+                const showName = item.showName ? "true" : "false";
                 if (item.url.startsWith("mailto:")) {
-                        const encodedEmail = encodeMailto(item.url);
-                        return <a rel="me" aria-label={item.name} href="#" data-encoded-email={encodedEmail} onclick={MAILTO_ONCLICK_SCRIPT},
-                                    class="btn-regular rounded-lg h-10 gap-2 px-3 font-bold active:scale-95">
-                            <Icon name={item.icon} class="text-[1.5rem]"></Icon>
-                            {item.name}
-                        </a>
</code_context>
<issue_to_address>
**issue (broader_impact):** 在仅图标模式下,恰好只有一个链接且 `showName: false` 的个人资料现在会隐藏链接名称,而被移除的单链接分支始终会渲染名称。这破坏了对有效单链接配置所声称的向后兼容行为。

**触发条件:** 当 `profileConfig.links` 恰好包含一个 `showName` 未设置或为 false 的项目时。

**建议修复:** 保留旧的单链接渲染行为,或者在新的 CSS/标记中明确并实现预期的单链接例外规则。
</issue_to_address>

### 评论 2
<location path="src/layouts/Layout.astro" line_range="559-562" />
<code_context>
+      defaultProfileLinkMode: profileConfig.linkDisplayMode ?? "icon",
+    }}>
+      (function() {
+        var stored = localStorage.getItem("profileLinkDisplayMode");
+        var mode = stored === "icon" || stored === "banner" ? stored : defaultProfileLinkMode;
+        document.documentElement.setAttribute("data-profile-link-mode", mode);
+      })();
+    </script>
+
</code_context>
<issue_to_address>
**issue (bug_risk):** 存储访问失败会导致个人资料链接模式无法应用到文档。内联脚本读取 `localStorage` 时没有处理 `SecurityError`;当存储不可用或 `setItem` 失败时,`setProfileLinkMode` 会在调用 `applyProfileLinkModeToDocument` 之前返回,因此设置面板可能显示了新模式,但个人资料仍保持旧模式。

**触发条件:** 当浏览器存储被禁用、无法访问或已满时。

**建议修复:** 使用 `try/catch` 包裹存储的读取和写入操作,并独立于持久化是否成功,将模式应用到 `document.documentElement`。
</issue_to_address>

Sourcery 评估

等待批准。 需先处理 2 个发现的问题。

阻塞性发现:src/components/widget/Profile.astro:78、src/layouts/Layout.astro:562


Sourcery 对开源项目免费——如果您喜欢我们的评审,请考虑分享 ✨
Original comment in English

Hey - I've found 2 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="src/components/widget/Profile.astro" line_range="60-78" />
<code_context>
+                // 图标 / 横幅两种模式共用同一份 DOM,由 html[data-profile-link-mode] 上的
+                // CSS(src/styles/profile.css)切换形态,这样才能在显示设置面板里即时切换。
+                // data-show-name 只对「仅图标」模式有意义:该模式下逐条决定是否显示名称。
+                const showName = item.showName ? "true" : "false";
                 if (item.url.startsWith("mailto:")) {
-                        const encodedEmail = encodeMailto(item.url);
-                        return <a rel="me" aria-label={item.name} href="#" data-encoded-email={encodedEmail} onclick={MAILTO_ONCLICK_SCRIPT},
-                                    class="btn-regular rounded-lg h-10 gap-2 px-3 font-bold active:scale-95">
-                            <Icon name={item.icon} class="text-[1.5rem]"></Icon>
-                            {item.name}
-                        </a>
</code_context>
<issue_to_address>
**issue (broader_impact):** In icon mode, a profile with exactly one link and `showName: false` now hides the link name, whereas the removed single-link branch always rendered the name. This breaks the claimed backward-compatible behavior for valid single-link configurations.

**Triggers:** When `profileConfig.links` contains exactly one item with `showName` unset or false.

**Suggested fix:** Preserve the old single-link rendering behavior, or explicitly define and implement the intended single-link exception in the new CSS/markup.
</issue_to_address>

### Comment 2
<location path="src/layouts/Layout.astro" line_range="559-562" />
<code_context>
+      defaultProfileLinkMode: profileConfig.linkDisplayMode ?? "icon",
+    }}>
+      (function() {
+        var stored = localStorage.getItem("profileLinkDisplayMode");
+        var mode = stored === "icon" || stored === "banner" ? stored : defaultProfileLinkMode;
+        document.documentElement.setAttribute("data-profile-link-mode", mode);
+      })();
+    </script>
+
</code_context>
<issue_to_address>
**issue (bug_risk):** A storage access failure prevents the profile-link mode from being applied to the document. The inline script reads `localStorage` without handling `SecurityError`, and `setProfileLinkMode` returns before calling `applyProfileLinkModeToDocument` when storage is unavailable or `setItem` fails, so the settings panel can report the new mode while the profile remains in the old mode.

**Triggers:** When browser storage is disabled, inaccessible, or full.

**Suggested fix:** Wrap storage reads and writes in `try/catch`, and apply the mode to `document.documentElement` independently of whether persistence succeeds.
</issue_to_address>

Sourcery assessment

Approval pending. 2 findings to address first.

Blocking findings: src/components/widget/Profile.astro:78, src/layouts/Layout.astro:562


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread src/components/widget/Profile.astro Outdated
Comment thread src/layouts/Layout.astro Outdated
回应 review 提出的两个问题:

1. 单链接向后兼容
   原版在 links.length == 1 时走单独的分支,恒渲染名称并忽略 showName。
   上一版统一成 links.map() 后,showName 为 false/未设的单链接在「仅图标」
   模式下退化成了方形纯图标按钮,与所声称的向后兼容不符。现在只有一条链接时
   同样置 data-show-name="true",恢复原有渲染结果。

2. 存储不可用时的健壮性
   setProfileLinkMode 原先在 localStorage.setItem 之前就 return,写入抛异常
   (被禁用 / 配额超额)时 applyProfileLinkModeToDocument 不会执行,会出现
   面板已切换、Profile 仍是旧模式的不一致。改为先应用到文档再持久化,并用
   try/catch 包裹写入。getStoredProfileLinkMode 与 Layout.astro 的内联脚本
   同样加 try/catch —— 部分浏览器访问 localStorage 这个 getter 本身就会抛
   SecurityError,连 `typeof localStorage` 的前置判断都不保险。

Co-Authored-By: Claude Code <noreply@anthropic.com>

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sourcery assessment

Approved.

This branch has not been deployed

No deployments
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.

1 participant