Add author and token count sorting#256
Open
Archkr wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add Author and Token Count sorting to the Characters browser and Token Count
sorting to the Personas browser. Character author ordering is case-insensitive,
keeps blank authors last, and uses character name/id tie-breakers. Character
token totals count Description, Personality, and Scenario separately before
server-side pagination. Persona token totals count Description through a new
authenticated, user-scoped
POST /api/v1/personas/token-countsendpoint.Both token sorts resolve the active profile model, fall back to the default
profile model, and ultimately use the existing
ceil(text.length / 4)behaviorwhen no exact tokenizer is available. Persona requests are made only while
Token Count is selected and use a generation guard so stale model/persona
responses cannot replace current counts. Group Chats continue to expose only
Recent, Name, and Created. Labels were added to all six existing locales.
No main-menu sorting button, persona author field, database migration, or schema
change is included.
Validation
Commands and results:
Manual validation used an isolated temporary Lumiverse instance and disposable
30-character/30-persona data set. Verified:
stable pagination, search interaction, and persistence after reload.
and persistence after reload.
The isolated server and disposable validation data were removed afterward.
Required checklist
stagingbranch and targetsstaging, notmain.Current local branch is
staging, but no remote sync or PR target wasperformed/verified.
bun x tsc --noEmitcd frontend && bun run typecheck,bun run lintUI changes (if applicable)
the mobile PWA.
viewport and at a 390x844 responsive mobile viewport. An installed PWA and a
second browser were not tested.
Performance changes (if applicable)
resolves ordering before pagination and reuses the tokenizer service's loaded
tokenizer and content-hash count caches. Focused tests cover stable pagination.
Security-sensitive changes (if applicable)
The new persona token-count endpoint uses the authenticated user id and queries
only that user's persona ids/descriptions. It accepts only an optional string
model_id. No Spindle surface, privilege boundary, database schema, or storedcredential behavior changed; no separate security audit was performed.
LLM-assisted work (if applicable)
in a live environment.