Skip to content

Restrict wordgrain to single file selection - #228

Merged
shimpeiws merged 2 commits into
mainfrom
issue-226-single-wordgrain-file
Mar 22, 2026
Merged

shimpeiws merged 2 commits into
mainfrom
issue-226-single-wordgrain-file

Conversation

@shimpeiws

Copy link
Copy Markdown
Owner

Summary

Closes #226

Change wordgrainFiles (string array) to wordgrainFile (single string) across config, services, and UI. Multiple wordgrain files dilute the persona concept — one rapper's vocabulary per session.

  • Config types: wordgrainFiles?: string[]wordgrainFile?: string
  • ConfigFile: read/write single file with migration from old array format (takes first element)
  • WordgrainManager: single-file APIs (getWordgrainFileInfo, validateWordgrainFile, getWordgrainStats)
  • VocabularyExtractor: accept single WordgrainFile instead of array, remove cross-file dedup
  • Remove unused loadWordgrainFiles function
  • UI: single file display, "Set/Clear" instead of "Add/Remove"

Changes

  • src/config/types.ts: wordgrainFile?: string in both MumblConfig and ResolvedConfig
  • src/config/ConfigFile.ts: Migration logic reads old wordgrainFiles array, takes [0], cleans up old key on save
  • src/config/ResolveConfig.ts: Use wordgrainFile
  • src/services/wordgrain/: Simplify all APIs to single-file, remove multi-file helpers
  • src/ui/: Single file display and management in config screen
  • README.md: Update config examples

Test plan

  • pnpm type-check passes
  • pnpm ci:all passes (type-check + lint + 967 tests)
  • Migration test: old wordgrainFiles array format correctly picks first element
  • New wordgrainFile format takes priority over old wordgrainFiles if both present
  • Manual: verify config UI shows single file, set/clear workflow works

Shin Takamatsu added 2 commits March 23, 2026 06:24
Change wordgrainFiles (string array) to wordgrainFile (single string)
across config, services, and UI. Multiple wordgrain files dilute the
persona concept of speaking with a rapper's vocabulary.

Migrate existing users: old wordgrainFiles array takes first element.
Old key is cleaned up on next config save.

Changes:
- Config types: wordgrainFiles[] → wordgrainFile string
- ConfigFile: read/write single file, migrate old array format
- WordgrainManager: single-file APIs (getWordgrainFileInfo, validateWordgrainFile, getWordgrainStats)
- VocabularyExtractor: accept single WordgrainFile instead of array
- Remove loadWordgrainFiles (no longer needed)
- UI: single file display, set/clear instead of add/remove
- Update all tests for new signatures and migration

Closes #226
@shimpeiws
shimpeiws merged commit 9362bf5 into main Mar 22, 2026
6 checks passed
@shimpeiws
shimpeiws deleted the issue-226-single-wordgrain-file branch March 22, 2026 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Restrict wordgrain to single file selection

1 participant