From 34d3fec449cfbb0518c0524324b8467a1cb10e55 Mon Sep 17 00:00:00 2001 From: hunter-dev Date: Wed, 26 Aug 2026 19:10:49 +0800 Subject: [PATCH] =?UTF-8?q?fix(ui):=204=E9=A1=B9=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E7=BE=8E=E5=8C=96=E2=80=94=E2=80=941.=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=E7=BB=9F=E4=B8=80=E7=BA=AF=E8=89=B2=E5=AD=97=E7=AC=A6(?= =?UTF-8?q?=F0=9F=8E=A8=E2=86=92=E2=97=90/=F0=9F=95=B8=E2=86=92=E2=97=87/?= =?UTF-8?q?=F0=9F=93=81=E2=86=92=E2=96=A3/=F0=9F=93=A5=E2=86=92=E2=86=93/?= =?UTF-8?q?=F0=9F=93=84=E2=86=92=E2=97=89=20=E5=85=A8=E9=83=A8=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E5=BD=A9=E8=89=B2emoji);=202.Resizer=E5=8A=A0?= =?UTF-8?q?=E6=8B=96=E6=8B=BD=E6=89=8B=E6=9F=84+=E6=82=AC=E5=81=9C?= =?UTF-8?q?=E9=AB=98=E4=BA=AE+accent=E5=BC=BA=E8=B0=83=E8=89=B2;=20EditorT?= =?UTF-8?q?oolbar/Toolbar=E6=8C=89=E9=92=AE=E5=8E=BB=E8=BE=B9=E6=A1=86+?= =?UTF-8?q?=E5=9C=86=E8=A7=92+=E6=82=AC=E5=81=9C=E8=83=8C=E6=99=AF;=20Titl?= =?UTF-8?q?eBar=E6=8C=89=E9=92=AE=E5=AE=BD=E5=BA=A6=E6=94=B6=E7=B4=A7+?= =?UTF-8?q?=E5=9C=86=E8=A7=92;=203.=E8=87=AA=E5=AE=9A=E4=B9=89=E6=BB=9A?= =?UTF-8?q?=E5=8A=A8=E6=9D=A1(6px=E5=AE=BD+=E5=8D=8A=E9=80=8F=E6=98=8E+?= =?UTF-8?q?=E5=9C=86=E8=A7=92+hover=E5=8A=A0=E6=B7=B1)=20webkit+firefox?= =?UTF-8?q?=E5=8F=8C=E5=BC=95=E6=93=8E;=204.@media=20print=E9=9A=90?= =?UTF-8?q?=E8=97=8F=E6=BB=9A=E5=8A=A8=E6=9D=A1+overflow=20visible?= =?UTF-8?q?=E9=98=B2=E8=BF=9B=E5=BA=A6=E6=9D=A1=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../renderer/features/editor/EditorToolbar.tsx | 7 +++++-- .../src/renderer/features/file-tree/FileTree.tsx | 2 +- .../src/renderer/features/graph/LinkGraph.tsx | 2 +- .../src/renderer/features/shell/Resizer.tsx | 8 +++++++- .../src/renderer/features/shell/TitleBar.tsx | 6 +++--- .../src/renderer/features/toolbar/Toolbar.tsx | 6 +++--- apps/desktop/src/renderer/styles.css | 15 ++++++++++++--- 7 files changed, 32 insertions(+), 14 deletions(-) diff --git a/apps/desktop/src/renderer/features/editor/EditorToolbar.tsx b/apps/desktop/src/renderer/features/editor/EditorToolbar.tsx index 5e041a9..5e8f420 100644 --- a/apps/desktop/src/renderer/features/editor/EditorToolbar.tsx +++ b/apps/desktop/src/renderer/features/editor/EditorToolbar.tsx @@ -11,10 +11,13 @@ function StarButton() { return ; } -const btn: React.CSSProperties = { minWidth: 30, height: 28, border: '1px solid var(--control-border)', background: 'transparent', color: 'var(--text-primary)', cursor: 'pointer', borderRadius: 4, fontSize: 13 }; +const btn: React.CSSProperties = { minWidth: 28, height: 26, border: 'none', background: 'transparent', color: 'var(--text-secondary)', cursor: 'pointer', borderRadius: 4, fontSize: 13 }; function T({ onClick, title, children, disabled }: { onClick: () => void; title: string; children: React.ReactNode; disabled?: boolean }) { - return ; + return ; } export function EditorToolbar() { diff --git a/apps/desktop/src/renderer/features/file-tree/FileTree.tsx b/apps/desktop/src/renderer/features/file-tree/FileTree.tsx index 0905540..ce5825b 100644 --- a/apps/desktop/src/renderer/features/file-tree/FileTree.tsx +++ b/apps/desktop/src/renderer/features/file-tree/FileTree.tsx @@ -111,7 +111,7 @@ export function FileTree() { onDragOver={e => { if (n.type === 'folder') { e.preventDefault(); setDragOver(n.path); } }} onDragLeave={() => setDragOver(null)} onDrop={e => n.type === 'folder' && onDrop(e, n.path)}> - {n.type === 'folder' ? (isCollapsed ? '▶' : '▼') : '📄'} + {n.type === 'folder' ? (isCollapsed ? '▶' : '▼') : '◉'} {isRenaming ? ( setRenameVal(e.target.value)} onKeyDown={e => { if (e.key === 'Enter') { setRenaming(null); invoke(IPC.fileRename, { from: n.path, toName: renameVal }).then(r => { useTabs.getState().renamePath(n.path, r.path); syncCurrentPath(n.path, r.path); loadTree(); }); } if (e.key === 'Escape') setRenaming(null); }} diff --git a/apps/desktop/src/renderer/features/graph/LinkGraph.tsx b/apps/desktop/src/renderer/features/graph/LinkGraph.tsx index f8c56c6..548a0ef 100644 --- a/apps/desktop/src/renderer/features/graph/LinkGraph.tsx +++ b/apps/desktop/src/renderer/features/graph/LinkGraph.tsx @@ -72,7 +72,7 @@ export function LinkGraph({ onSwitchToEditor }: { onSwitchToEditor?: () => void .attr('fill', 'var(--bg-secondary)').attr('stroke', (d) => d.color || 'var(--control-border)').attr('stroke-width', 1.5); nodeSel.append('rect').attr('x', -CARD_W / 2).attr('y', -CARD_H / 2).attr('width', 4).attr('height', CARD_H).attr('fill', (d) => d.color || '#5db0ff'); // FR-G1:文档图标 - nodeSel.append('text').attr('x', -CARD_W / 2 + 12).attr('y', 0).attr('font-size', 12).attr('fill', 'var(--text-tertiary)').text('📄'); + nodeSel.append('text').attr('x', -CARD_W / 2 + 12).attr('y', 0).attr('font-size', 12).attr('fill', 'var(--text-tertiary)').text('◉'); // 标题 nodeSel.append('text').attr('x', -CARD_W / 2 + 28).attr('y', -2).attr('fill', 'var(--text-primary)').attr('font-size', 12).attr('font-family', 'sans-serif') .text((d) => truncate(d.title, 14)); diff --git a/apps/desktop/src/renderer/features/shell/Resizer.tsx b/apps/desktop/src/renderer/features/shell/Resizer.tsx index 2efd573..041ec92 100644 --- a/apps/desktop/src/renderer/features/shell/Resizer.tsx +++ b/apps/desktop/src/renderer/features/shell/Resizer.tsx @@ -12,5 +12,11 @@ export function Resizer({ onDrag, side }: { onDrag: (delta: number) => void; sid window.addEventListener('mousemove', move); window.addEventListener('mouseup', up); }; - return
(e.currentTarget.style.background = 'var(--accent)')} onMouseLeave={e => (e.currentTarget.style.background = 'transparent')} />; + return ( +
{ e.currentTarget.style.background = 'var(--control-border)'; const h = e.currentTarget.querySelector('div'); if (h) (h as HTMLElement).style.background = 'var(--accent)'; }} + onMouseLeave={e => { e.currentTarget.style.background = 'transparent'; const h = e.currentTarget.querySelector('div'); if (h) (h as HTMLElement).style.background = 'var(--text-tertiary)'; }}> +
+
+ ); } \ No newline at end of file diff --git a/apps/desktop/src/renderer/features/shell/TitleBar.tsx b/apps/desktop/src/renderer/features/shell/TitleBar.tsx index c752bb7..5ea378f 100644 --- a/apps/desktop/src/renderer/features/shell/TitleBar.tsx +++ b/apps/desktop/src/renderer/features/shell/TitleBar.tsx @@ -15,10 +15,10 @@ export function TitleBar({ onToggleView, view, onSettings, onAppearance, onToggl
狩夜人笔记
- +
- + @@ -31,4 +31,4 @@ export function TitleBar({ onToggleView, view, onSettings, onAppearance, onToggl ); } -const btn: React.CSSProperties = { width: 36, height: 28, border: 'none', background: 'transparent', color: 'var(--text-secondary)', cursor: 'pointer', fontSize: 12 }; +const btn: React.CSSProperties = { width: 34, height: 28, border: 'none', background: 'transparent', color: 'var(--text-secondary)', cursor: 'pointer', fontSize: 12, borderRadius: 4 }; diff --git a/apps/desktop/src/renderer/features/toolbar/Toolbar.tsx b/apps/desktop/src/renderer/features/toolbar/Toolbar.tsx index 1f1cffd..78d7786 100644 --- a/apps/desktop/src/renderer/features/toolbar/Toolbar.tsx +++ b/apps/desktop/src/renderer/features/toolbar/Toolbar.tsx @@ -50,8 +50,8 @@ export function Toolbar() { return (
- - + + {/* FR-V4:最近库下拉快速切换 */} {vault?.recents && vault.recents.length > 1 && ( @@ -74,4 +74,4 @@ export function Toolbar() {
); } -const btn: React.CSSProperties = { padding: '4px 10px', border: '1px solid var(--control-border)', background: 'transparent', color: 'var(--text-primary)', borderRadius: 4, cursor: 'pointer', fontSize: 12 }; \ No newline at end of file +const btn: React.CSSProperties = { padding: '4px 12px', border: 'none', background: 'transparent', color: 'var(--text-secondary)', borderRadius: 4, cursor: 'pointer', fontSize: 12, transition: 'all 0.15s' }; \ No newline at end of file diff --git a/apps/desktop/src/renderer/styles.css b/apps/desktop/src/renderer/styles.css index 4fdbe76..b8b1710 100644 --- a/apps/desktop/src/renderer/styles.css +++ b/apps/desktop/src/renderer/styles.css @@ -1,5 +1,12 @@ * { box-sizing: border-box; } html, body, #root { margin: 0; height: 100%; } + +/* 自定义滚动条——细+半透明+圆角 */ +::-webkit-scrollbar { width: 6px; height: 6px; } +::-webkit-scrollbar-track { background: transparent; } +::-webkit-scrollbar-thumb { background: var(--control-border); border-radius: 3px; } +::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); } +* { scrollbar-width: thin; scrollbar-color: var(--control-border) transparent; } /* Tiptap 编辑器正文 */ .tiptap-wrap .ProseMirror { font-size: var(--editor-font-size, 14px) !important; @@ -87,10 +94,12 @@ html, body, #root { margin: 0; height: 100%; } /* FR-X2:打印/另存为 PDF 干净排版 + 代码语法高亮 */ @media print { body * { visibility: hidden; } + ::-webkit-scrollbar { display: none !important; } + * { scrollbar-width: none !important; } .tiptap-wrap, .tiptap-wrap * { visibility: visible; } - .tiptap-wrap { position: absolute; left: 0; top: 0; width: 100%; padding: 20px; } - .tiptap-wrap .ProseMirror { font-size: 14px !important; color: #000 !important; } - .tiptap-wrap .ProseMirror pre { background: #f4f4f4 !important; color: #333 !important; border: 1px solid #ddd; padding: 8px; border-radius: 4px; overflow: visible; } + .tiptap-wrap { position: absolute; left: 0; top: 0; width: 100%; padding: 20px; overflow: visible !important; } + .tiptap-wrap .ProseMirror { font-size: 14px !important; color: #000 !important; overflow: visible !important; } + .tiptap-wrap .ProseMirror pre { background: #f4f4f4 !important; color: #333 !important; border: 1px solid #ddd; padding: 8px; border-radius: 4px; overflow: visible !important; } .tiptap-wrap .ProseMirror pre code { color: #333; } .tiptap-wrap .ProseMirror h1, .tiptap-wrap .ProseMirror h2, .tiptap-wrap .ProseMirror h3 { color: #000; } .tiptap-wrap .ProseMirror blockquote { border-color: #ccc; color: #555; }