Skip to content

feat(frontend): 文档导航组件默认在新页面打开#34

Merged
OrenZhang merged 3 commits intolinux-do:masterfrom
wenyuanw:master
Jul 3, 2025
Merged

feat(frontend): 文档导航组件默认在新页面打开#34
OrenZhang merged 3 commits intolinux-do:masterfrom
wenyuanw:master

Conversation

@wenyuanw
Copy link
Copy Markdown
Contributor

@wenyuanw wenyuanw commented Jul 3, 2025

例行检查

  • 我已阅读并理解 贡献者公约
  • 我已阅读并同意 贡献者许可协议 (CLA),确认我的贡献将根据项目的 MIT 许可证进行许可,
  • 我知晓如果此 PR 并不做出实质性更改,或可被认为是为了PR被合并而提交PR的,则可能不会被合并,

变更内容

  • NavDocuments 组件的导航线新增属性 openInNewTab 用于控制是否在新标签页打开
  • 默认设置 openInNewTab 为 true,在新标签页打开导航

变更原因

原本的“前往社区”按钮默认会在当前 Tab 打开社区页面(外部页面),容易打断当前的上下文,交互上没有那么友好。

- NavDocuments 组件的导航线新增属性 openInNewTab 用于控制是否在新标签页打开
- 默认设置 openInNewTab 为 true,在新标签页打开导航
OrenZhang
OrenZhang previously approved these changes Jul 3, 2025
@OrenZhang OrenZhang requested review from chenyme and Copilot July 3, 2025 05:08
Copy link
Copy Markdown

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 introduces a new openInNewTab flag for the NavDocuments component and defaults it to true, so documentation navigation links open in a new browser tab by default.

  • Defined NavDocumentItem and NavDocumentsProps interfaces, adding an optional openInNewTab property.
  • Updated NavDocuments to compute shouldOpenInNewTab and set target/rel on the Link.
  • Defaulted openInNewTab to true for existing items.
Comments suppressed due to low confidence (1)

frontend/components/common/layout/NavDocuments.tsx:24

  • The new default logic for openInNewTab would benefit from unit tests verifying both the default true case and when it's explicitly set to false.
          const shouldOpenInNewTab = item.openInNewTab ?? true;

TethysPlex added a commit to TethysPlex/cdk that referenced this pull request Jul 3, 2025
TethysPlex added a commit to TethysPlex/cdk that referenced this pull request Jul 3, 2025
* feat: implement GET /api/v1/projects/:id endpoint (linux-do#33)

* Revert "feat: implement GET /api/v1/projects/:id endpoint (linux-do#33)" (linux-do#34)

This reverts commit 196c66c.

* feat: implement GET /api/v1/projects/:id endpoint

* docs(swagger): update api doc

* fix(router): remove redundant comment on project route

* fix: address review comments from PR linux-do#35

* docs(swagger): update api doc

* fix: address review comments from PR

* docs:(swagger): update api doc

我寻思没人看commit body, 那水几句话()
就不能整个pre-commit钩子来自动生成这**swagger docs吗喵~

* fix: fix error in building

* feat: update project response with creator details

* refactor: ust Tab other than 4 whitespace

---------

Co-authored-by: Tethys Neuroplexus <[email protected]>
默认设置 openInNewTab 为 false,以避免因编程习惯导致的预期外的异常
@OrenZhang
Copy link
Copy Markdown
Contributor

LGTM @chenyme

@OrenZhang OrenZhang merged commit 846070e into linux-do:master Jul 3, 2025
8 checks passed
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.

4 participants