demo(words): enrich status bar with char count + selection + dynamic link/commit (F4.5b)

Before: 'Optional editor · 64 words · none'

After:  'Optional · 64 words · 453 chars · none'  (no link, no commit)
        'Required · 64 words · 453 chars · range · https://...'  (selection + link)
        'Optional · 64 words · 453 chars · none · save'  (after commit)

- Drops the redundant 'editor' suffix; the surface is already an editor.
- Adds char count from plainText.length — useful for size limits.
- Adds the existing selectionState (none/collapsed/range) inline.
- Splits link/commit into separate optional segments instead of
  collapsing them into one slot.

Demo-only change in +page.svelte. The eidos Words.Status wrapper
still passes children through unchanged — enriching the eidos default
status snippet itself would require Words provider to expose
wordCount/charCount, which is a larger refactor.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
active-uix
dev 4 months ago
parent 5bd9f9fe4f
commit f25bf1558e

@ -1063,9 +1063,19 @@
<Words.HiddenInput />
{#if showStatus}
<Words.Status>
{invalid
? 'Invalid content'
: `${required ? 'Required editor' : 'Optional editor'} · ${wordCount} words · ${selectedLink ? selectedLink.href : lastCommit}`}
{#if invalid}
Invalid content
{:else}
{required ? 'Required' : 'Optional'}
· {wordCount} words
· {plainText.length} chars
· {selectionState}
{#if selectedLink}
· → {selectedLink.href}
{:else if lastCommit !== 'none'}
· {lastCommit}
{/if}
{/if}
</Words.Status>
{/if}
{/snippet}

Loading…
Cancel
Save

Powered by TurnKey Linux.