feat(frontend): 文档导航组件默认在新页面打开#34
Merged
OrenZhang merged 3 commits intolinux-do:masterfrom Jul 3, 2025
Merged
Conversation
- NavDocuments 组件的导航线新增属性 openInNewTab 用于控制是否在新标签页打开 - 默认设置 openInNewTab 为 true,在新标签页打开导航
OrenZhang
previously approved these changes
Jul 3, 2025
There was a problem hiding this comment.
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
NavDocumentItemandNavDocumentsPropsinterfaces, adding an optionalopenInNewTabproperty. - Updated
NavDocumentsto computeshouldOpenInNewTaband settarget/relon theLink. - Defaulted
openInNewTabtotruefor existing items.
Comments suppressed due to low confidence (1)
frontend/components/common/layout/NavDocuments.tsx:24
- The new default logic for
openInNewTabwould benefit from unit tests verifying both the defaulttruecase and when it's explicitly set tofalse.
const shouldOpenInNewTab = item.openInNewTab ?? true;
OrenZhang
reviewed
Jul 3, 2025
TethysPlex
added a commit
to TethysPlex/cdk
that referenced
this pull request
Jul 3, 2025
…" (linux-do#34) This reverts commit 196c66c.
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,以避免因编程习惯导致的预期外的异常
Contributor
|
LGTM @chenyme |
chenyme
approved these changes
Jul 3, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
例行检查
变更内容
变更原因
原本的“前往社区”按钮默认会在当前 Tab 打开社区页面(外部页面),容易打断当前的上下文,交互上没有那么友好。