Skip to content

feat: add prominent CLI action to console header - #682

Open
think-back wants to merge 2 commits into
mainfrom
feat/console-cli-header-cta
Open

feat: add prominent CLI action to console header#682
think-back wants to merge 2 commits into
mainfrom
feat/console-cli-header-cta

Conversation

@think-back

Copy link
Copy Markdown
Collaborator

📝 变更描述 / Description

在登录后的 Console 顶栏加入独立的 CLI 入口,放在普通导航之后、通知按钮之前。入口使用终端图标、紫色渐变和阴影增强识别度;桌面显示 Flatkey CLI,窄屏显示 CLI

入口仅存在于认证后的 AppHeader,不会进入共享 TopNav 或公开站点导航;目标为官网 /cli 落地页,并以安全的新标签页方式打开。现有“主页 / 排行榜 / Playground”移除逻辑保持不变。

🚀 变更类型 / Type of change

  • 🐛 Bug 修复 (Bug fix)
  • ✨ 新功能 (New feature)
  • ⚡ 性能优化 / 重构 (Refactor)
  • 📝 文档更新 (Documentation)

🔗 关联任务 / Related Issue

✅ 提交前检查项 / Checklist

  • 人工确认: 请仓库维护者在合并前确认本描述。
  • 非重复提交: 已搜索现有 PR,未发现重复的 Console CLI 顶栏入口。
  • Bug fix 说明: 本 PR 未标记为 Bug fix。
  • 变更理解: 已核对认证布局、公开布局、链接来源与响应式行为。
  • 范围聚焦: 仅包含 CLI 顶栏入口、对应测试与设计说明。
  • 本地验证: 已通过目标测试、ESLint、Prettier、TypeScript 和生产构建。
  • 安全合规: 链接使用 noopener noreferrer,未引入敏感凭据或新依赖。

📸 运行证明 / Proof of Work

  • bun test src/components/layout/components/console-cli-cta.test.tsx src/hooks/use-top-nav-links.test.ts:4 pass,0 fail
  • 目标文件 ESLint:通过
  • 目标文件 Prettier:通过
  • bun run typecheck:通过
  • bun run build:通过
  • 独立审查:无 Critical / Important 问题

Constraint: Keep the CTA authenticated-shell-only, mobile-visible, and linked to the official /cli landing page.
Rejected: Reusing TopNav | It is shared with public navigation and hidden below lg in AppHeader.
Confidence: high
Scope-risk: narrow
Directive: Do not repoint ordinary navigation to /cli/authorize because it requires a device code.
Tested: Spec placeholder scan and git diff --check.
Not-tested: UI implementation is intentionally deferred to the implementation commit.
Expose the official CLI landing page as a responsive header action while preserving the console-only navigation boundary.

Constraint: Keep Home and Rankings absent and leave shared public navigation unchanged.

Rejected: Add the CTA to shared TopNav | That would hide it on mobile and leak it into public navigation.

Confidence: high

Scope-risk: narrow

Directive: Keep the CTA pointed at the public CLI landing page, never the device authorization route.

Tested: bun test targeted navigation and CTA tests; ESLint; Prettier; TypeScript; production build; git diff checks.
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