Skip to content

fix(editor): 修复链接样式和编辑器面板大小问题#312

Merged
xun082 merged 2 commits intoxun082:mainfrom
Hemomoo:fix-link
Feb 26, 2026
Merged

fix(editor): 修复链接样式和编辑器面板大小问题#312
xun082 merged 2 commits intoxun082:mainfrom
Hemomoo:fix-link

Conversation

@Hemomoo
Copy link
Copy Markdown
Collaborator

@Hemomoo Hemomoo commented Feb 26, 2026

为链接添加下划线样式以提升可识别性
将编辑器面板的默认大小从字符串改为数字类型
优化链接扩展的点击处理逻辑,支持alt/meta键点击在新窗口打开
修复联系组件描述文本高度问题

PR 描述

  1. 修复md链接不能不能跳转
  2. md语法不正确
  3. 修复跳出率为null的bug,当为null和undefined的时候 默认为0
  4. 优化加入社区的描述样式

PR 类型

  • 🐛 Bug 修复
  • ✨ 新功能
  • 💄 UI/UX 改进
  • ♻️ 重构
  • 🚀 性能优化
  • 📝 文档更新
  • 🔄 其他

Issue 关联

Closes #306

其他信息

image image image image

为链接添加下划线样式以提升可识别性
将编辑器面板的默认大小从字符串改为数字类型
优化链接扩展的点击处理逻辑,支持alt/meta键点击在新窗口打开
修复联系组件描述文本高度问题
@netlify
Copy link
Copy Markdown

netlify bot commented Feb 26, 2026

Deploy Preview for ornate-blancmange-89db6b failed. Why did it fail? →

Name Link
🔨 Latest commit 3870170
🔍 Latest deploy log https://app.netlify.com/projects/ornate-blancmange-89db6b/deploys/69a01717920a810008bcb964

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @Hemomoo, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

本次拉取请求主要聚焦于提升用户体验和修复编辑器及UI中的若干问题。通过为链接添加下划线样式,提高了链接的视觉可识别性;修正了编辑器面板的尺寸属性类型,确保了其正确配置;并增强了链接的交互性,允许用户通过快捷键在新窗口中打开链接。此外,还改进了 Markdown 链接的解析逻辑,并调整了联系组件的描述文本显示,以提供更稳定和友好的界面。

Highlights

  • 链接样式优化: 为编辑器中的链接添加了下划线样式,以提高其视觉可识别性。
  • 编辑器面板尺寸修正: 将编辑器面板的 defaultSize 属性从字符串类型修正为数字类型,确保了其正确配置。
  • 链接点击行为增强: 优化了链接扩展的点击处理逻辑,支持在按住 altmeta 键时在新窗口中打开链接。
  • Markdown 链接解析改进: 修正了 Markdown 链接的正则表达式匹配,以确保正确解析和跳转。
  • 联系组件描述高度调整: 调整了联系组件中描述文本的固定高度,以解决显示问题。
Changelog
  • apps/DocFlow/src/app/_components/homepage/contact.tsx
    • contact.description 所在的 p 标签添加了 h-10 类,以固定其高度。
  • apps/DocFlow/src/app/docs/[room]/page.tsx
    • Panel 组件的 defaultSize 属性值从字符串 "65" 修改为数字 {65}
  • apps/DocFlow/src/extensions/Link/Link.ts
    • 移除了一个不必要的注释。
    • 更新了用于匹配 Markdown 链接模式的正则表达式,以更准确地解析链接。
    • 新增了 handleClickOn 方法,实现在点击链接时若同时按住 altmeta 键,则在新标签页中打开链接。
  • apps/DocFlow/src/styles/partials/typography.css
    • .ProseMirror a.link 样式规则添加了 underline 属性,使其显示下划线。
Activity
  • 目前没有检测到人工活动。
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

此拉取请求修复了链接样式、编辑器面板大小问题,并优化了链接点击处理逻辑。同时,它还解决了联系组件描述文本的高度问题。总体而言,这些更改提升了用户体验和代码的健壮性。

Comment on lines +54 to +56
<p className="text-sm text-gray-600 mb-4 leading-relaxed h-10">
{contact.description}
</p>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

为描述文本设置固定的 h-10 高度可能会导致文本溢出或截断,如果描述内容超过两行(在 text-smleading-relaxed 的情况下)。这可能会影响用户体验,导致信息显示不完整。建议考虑使用 min-h-10 并在需要时允许文本自然扩展,或者通过其他方式确保所有描述都能完整显示。

Suggested change
<p className="text-sm text-gray-600 mb-4 leading-relaxed h-10">
{contact.description}
</p>
<p className="text-sm text-gray-600 mb-4 leading-relaxed min-h-10">
{contact.description}
</p>

@xun082 xun082 merged commit 7978cbe into xun082:main Feb 26, 2026
0 of 6 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.

md 链接语法无法转换

2 participants