Repository navigation
feat: implement Typora-style live markdown rendering mode - #69
Closed
Hatsume0202 wants to merge 1 commit into
Closed
Hatsume0202 wants to merge 1 commit into
Hatsume0202 wants to merge 1 commit into
Conversation
Contributor
AI 审查结果代码审查结论本次 PR 实现了 Typora 风格的实时 Markdown 渲染模式,包含状态管理、布局切换和新组件创建。整体设计合理,但存在几个需要关注的问题。 问题列表严重程度:高问题 1:
if (editOverlayOpen || animation.isAnimating) // 需要额外处理动画状态
// 或更简单的方案:
Visibility(
visible: editOverlayOpen,
maintainState: false,
child: AnimatedPositioned(...)
)严重程度:中问题 2:
AnimatedPositioned(
duration: const Duration(milliseconds: 300),
curve: Curves.easeOutCubic,
left: 0,
right: 0,
bottom: 0,
height: editOverlayOpen ? overlayHeight : 0,
onEnd: () {
// 动画完成后的清理逻辑
if (!editOverlayOpen) {
// 可选:释放编辑器资源
}
},
child: ...
)问题 3:
// 方案1:使用 AnimatedBuilder
AnimatedBuilder(
animation: _animationController, // 需要添加 AnimationController
builder: (context, child) {
return Positioned(
right: 24,
bottom: editOverlayOpen ? overlayHeight * _animationController.value + 24 : 24,
child: child!,
);
},
child: FloatingActionButton.small(...),
);严重程度:低问题 4:
FloatingActionButton.small(
onPressed: onToggleEditOverlay,
backgroundColor: AppTheme.surface, // 或 AppTheme.primary
child: Icon(
editOverlayOpen ? Icons.close : Icons.edit_outlined,
color: AppTheme.onSurface, // 或 AppTheme.onPrimary
),
),问题 5:
Material(
elevation: Theme.of(context).elevationOverlayColor != null ? 8 : 4,
// 或使用 AppTheme.elevationMedium
color: Colors.white,
child: ...
)问题 6:缺少对
问题 7:
// 在 _TyporaPane 的构造函数或 build 方法中
final overlayHeight = MediaQuery.of(context).size.height * 0.4;
// 或使用 LayoutBuilder 但缓存结果严重程度:信息问题 8:文档中的 Git 操作步骤包含在 PR diff 中
总结本次 PR 实现了核心功能,但存在性能问题(不必要的 widget 构建)、UI 问题(动画对齐)和代码质量问题(硬编码值、缺少测试)。建议优先修复高严重性问题,并在后续迭代中补充测试。 |
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.
Closes #68
实现内容
实现了 Typora 风格的实时 Markdown 渲染模式,用户可以通过切换按钮在分栏编辑模式和实时渲染模式之间切换。
主要改动
使用方法