💄 move toolbar buttons to the left

This commit is contained in:
TC
2026-06-14 19:09:15 +10:00
parent e09b5a964e
commit 7c5d39bef9

View File

@@ -420,6 +420,40 @@ export function AnalysisToolbar(): JSX.Element {
</> </>
) : ( ) : (
<> <>
<button
className={`toolbar-btn toolbar-btn-outline${revisionPanelOpen ? ' active' : ''}`}
onClick={toggleRevisionPanel}
title="Revision history"
>
</button>
<button
className={`toolbar-btn toolbar-btn-outline${outlineOpen ? ' active' : ''}`}
onClick={toggleOutline}
title={outlineOpen ? 'Hide document outline' : 'Show document outline'}
>
</button>
{activeFilePath && paragraphRhythm.length > 0 && (
<button
ref={rhythmButtonRef}
className={`toolbar-btn toolbar-btn-outline${rhythmOpen ? ' active' : ''}`}
onClick={() => setRhythmOpen(v => !v)}
title="Paragraph rhythm — sentence count per paragraph"
>
</button>
)}
{activeFilePath && sentenceStats && (
<button
ref={statsButtonRef}
className={`toolbar-btn toolbar-btn-stats${statsOpen ? ' active' : ''}`}
onClick={() => setStatsOpen(v => !v)}
title="Sentence length histogram"
>
</button>
)}
<button <button
ref={analyzeButtonRef} ref={analyzeButtonRef}
className={`toolbar-btn toolbar-analyze-btn${anyActive ? ' active' : ''}`} className={`toolbar-btn toolbar-analyze-btn${anyActive ? ' active' : ''}`}
@@ -518,31 +552,7 @@ export function AnalysisToolbar(): JSX.Element {
</div> </div>
<div className="toolbar-right"> <div className="toolbar-right">
<button {activeFilePath && paragraphRhythm.length > 0 && rhythmOpen && rhythmButtonRef.current && createPortal(
className={`toolbar-btn toolbar-btn-outline${revisionPanelOpen ? ' active' : ''}`}
onClick={toggleRevisionPanel}
title="Revision history"
>
</button>
<button
className={`toolbar-btn toolbar-btn-outline${outlineOpen ? ' active' : ''}`}
onClick={toggleOutline}
title={outlineOpen ? 'Hide document outline' : 'Show document outline'}
>
</button>
{activeFilePath && paragraphRhythm.length > 0 && (
<>
<button
ref={rhythmButtonRef}
className={`toolbar-btn toolbar-btn-outline${rhythmOpen ? ' active' : ''}`}
onClick={() => setRhythmOpen(v => !v)}
title="Paragraph rhythm — sentence count per paragraph"
>
</button>
{rhythmOpen && rhythmButtonRef.current && createPortal(
(() => { (() => {
const rect = rhythmButtonRef.current!.getBoundingClientRect() const rect = rhythmButtonRef.current!.getBoundingClientRect()
return ( return (
@@ -592,20 +602,8 @@ export function AnalysisToolbar(): JSX.Element {
})(), })(),
document.body document.body
)} )}
</>
)}
{activeFilePath && sentenceStats && ( {activeFilePath && sentenceStats && statsOpen && statsButtonRef.current && createPortal(
<>
<button
ref={statsButtonRef}
className={`toolbar-btn toolbar-btn-stats${statsOpen ? ' active' : ''}`}
onClick={() => setStatsOpen(v => !v)}
title="Sentence length histogram"
>
</button>
{statsOpen && statsButtonRef.current && createPortal(
(() => { (() => {
const rect = statsButtonRef.current!.getBoundingClientRect() const rect = statsButtonRef.current!.getBoundingClientRect()
const maxBin = Math.max(...sentenceStats.bins, 1) const maxBin = Math.max(...sentenceStats.bins, 1)
@@ -674,8 +672,6 @@ export function AnalysisToolbar(): JSX.Element {
})(), })(),
document.body document.body
)} )}
</>
)}
{activeFilePath && ( {activeFilePath && (
<span <span
className="toolbar-wordcount" className="toolbar-wordcount"