💄 move selection word count to bottom
This commit is contained in:
@@ -35,6 +35,16 @@
|
|||||||
opacity: 0.8;
|
opacity: 0.8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.statusbar-selection-wordcount {
|
||||||
|
opacity: 0.75;
|
||||||
|
}
|
||||||
|
|
||||||
|
.statusbar-selection-wordcount::before {
|
||||||
|
content: '·';
|
||||||
|
margin-right: 8px;
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
.statusbar-share-btn {
|
.statusbar-share-btn {
|
||||||
background: none;
|
background: none;
|
||||||
border: none;
|
border: none;
|
||||||
|
|||||||
@@ -685,7 +685,7 @@ export function MarkdownEditor(): JSX.Element {
|
|||||||
const [commentDraft, setCommentDraft] = useState('')
|
const [commentDraft, setCommentDraft] = useState('')
|
||||||
const [wordStats, setWordStats] = useState<{ atCursor: number; total: number }>({ atCursor: 0, total: 0 })
|
const [wordStats, setWordStats] = useState<{ atCursor: number; total: number }>({ atCursor: 0, total: 0 })
|
||||||
const wordTotalRef = useRef(0)
|
const wordTotalRef = useRef(0)
|
||||||
const { activeFilePath, activeFileContent, setContent, annotations, fontSize, theme, focusMode, scrollPositions, pendingScrollToLine, clearPendingScrollToLine } = useEditorStore()
|
const { activeFilePath, activeFileContent, setContent, annotations, fontSize, theme, focusMode, scrollPositions, pendingScrollToLine, clearPendingScrollToLine, selectionWordCount } = useEditorStore()
|
||||||
|
|
||||||
function saveComment(): void {
|
function saveComment(): void {
|
||||||
if (!pendingComment || !commentDraft.trim()) return
|
if (!pendingComment || !commentDraft.trim()) return
|
||||||
@@ -1134,6 +1134,9 @@ export function MarkdownEditor(): JSX.Element {
|
|||||||
{activeFilePath && (
|
{activeFilePath && (
|
||||||
<div className="editor-statusbar">
|
<div className="editor-statusbar">
|
||||||
<span>word {wordStats.atCursor.toLocaleString()} of {wordStats.total.toLocaleString()}</span>
|
<span>word {wordStats.atCursor.toLocaleString()} of {wordStats.total.toLocaleString()}</span>
|
||||||
|
{selectionWordCount !== null && (
|
||||||
|
<span className="statusbar-selection-wordcount">{selectionWordCount.toLocaleString()} selected</span>
|
||||||
|
)}
|
||||||
<button
|
<button
|
||||||
className="statusbar-share-btn"
|
className="statusbar-share-btn"
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
|
|||||||
@@ -133,7 +133,6 @@ export function AnalysisToolbar(): JSX.Element {
|
|||||||
toggleOutline,
|
toggleOutline,
|
||||||
revisionPanelOpen,
|
revisionPanelOpen,
|
||||||
toggleRevisionPanel,
|
toggleRevisionPanel,
|
||||||
selectionWordCount
|
|
||||||
} = useEditorStore()
|
} = useEditorStore()
|
||||||
|
|
||||||
const streamingContentRef = useRef('')
|
const streamingContentRef = useRef('')
|
||||||
@@ -533,11 +532,6 @@ export function AnalysisToolbar(): JSX.Element {
|
|||||||
>
|
>
|
||||||
≡
|
≡
|
||||||
</button>
|
</button>
|
||||||
{selectionWordCount !== null && (
|
|
||||||
<span className="toolbar-selection-wordcount" title={`${selectionWordCount} words selected`}>
|
|
||||||
{formatWordCount(selectionWordCount)} sel
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
{activeFilePath && paragraphRhythm.length > 0 && (
|
{activeFilePath && paragraphRhythm.length > 0 && (
|
||||||
<>
|
<>
|
||||||
<button
|
<button
|
||||||
|
|||||||
Reference in New Issue
Block a user