From 4f1fbec868ac29bc6b9f236e80cf9ca8673cf522 Mon Sep 17 00:00:00 2001 From: TC Date: Sun, 14 Jun 2026 21:00:38 +1000 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20estimated=20read?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/components/Editor/Editor.css | 12 ++++++++++++ src/renderer/components/Editor/MarkdownEditor.tsx | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/renderer/components/Editor/Editor.css b/src/renderer/components/Editor/Editor.css index 5056595..268cdfa 100644 --- a/src/renderer/components/Editor/Editor.css +++ b/src/renderer/components/Editor/Editor.css @@ -17,6 +17,7 @@ .editor-statusbar { flex-shrink: 0; + position: relative; display: flex; align-items: center; justify-content: space-between; @@ -45,6 +46,17 @@ opacity: 0.5; } +.statusbar-center { + position: absolute; + left: 50%; + transform: translateX(-50%); + pointer-events: none; +} + +.statusbar-readtime { + opacity: 0.8; +} + .statusbar-right { margin-left: auto; display: flex; diff --git a/src/renderer/components/Editor/MarkdownEditor.tsx b/src/renderer/components/Editor/MarkdownEditor.tsx index 25d1bce..c554919 100644 --- a/src/renderer/components/Editor/MarkdownEditor.tsx +++ b/src/renderer/components/Editor/MarkdownEditor.tsx @@ -1171,6 +1171,18 @@ export function MarkdownEditor(): JSX.Element { ) : sentenceWordCount > 0 ? ( {sentenceWordCount} in sentence ) : null} +
+ {(() => { + const wc = countWords(activeFileContent) + const mins = wc / 238 + if (wc < 10) return null + if (mins < 1) return {'<'} 1 min read + const h = Math.floor(mins / 60) + const m = Math.round(mins % 60) + const label = h > 0 ? `${h}h ${m}m read` : `${Math.round(mins)} min read` + return {label} + })()} +
{(() => { const docWc = countWords(activeFileContent)