All stream notes

Reviewing an AI suggestion, and shipping the bilingual voice picker and stream notes site

I reviewed an AI suggestion for Kando's `--list-menus` command, finished a Bilibili chat voice picker with per-viewer limits and locks, and launched a bilingual litomore.live site with sharing cards and an incremental translation workflow.

Read on GitHub

Today I reviewed an AI suggestion for Kando's --list-menus command, let viewers choose the voice that reads their Bilibili chat, and built English and Simplified Chinese pages for the voice picker and stream notes.

A code review question for AI suggestions

kando --list-menus prints JSON to stdout so other apps can read the menu list. One extra log line while loading an older config can make JSON.parse fail. The AI suggested replacing globalThis.console in the CLI process to send logs to stderr. That reminded me of an ESLint rule I'd used before. Why change where every console.log goes just to handle one migration message? Someone reading another module would have no clue that the CLI had redirected its logs. Unicorn's no-global-object-property-assignment rule

The migration function already returned didMigration, so we used that to let the desktop app log a successful migration and let the CLI print the menu list. Looking only at the JSON, both approaches could give the same result. That's how a change to global behavior can slip through review even when the feature works. When I review an AI suggestion, I want to ask one more question. What else would these lines change for the code around them? Kando PR #1637

Pick your voice in Bilibili chat

You can now preview any of the 31 voices in the picker, copy the command beside the play button, and paste it into chat. I gave the three Siri 2 voices distinct names so you can tell them apart in a message. Send /voice Siri 2 普通话 for Mandarin or /voice Siri 2 粤语 for Cantonese, and you'll hear the new voice announce your choice. Voice picker · Voice picker changes

Viewers get three changes per day by default. As the broadcaster, I can send /voice @小明 彬彬 without using any of 小明's allowance. I migrated the existing chat-selected voice and its daily count to SQLite. Each change now saves the voice and its count together, so viewers can switch while I edit pronunciations or individual limits in JSON. Chat commands and storage

Locking a viewer's voice

When I want to lock a voice, I set users["小明"].voice in config.json. Saving the file copies the voice to SQLite. While the lock is in place, both 小明's own /voice command and my broadcaster command leave the voice and daily count alone. Deleting just the voice field unlocks it. 小明 keeps that voice until the next switch. Voice lock documentation

I ran npm start -- --migrate-initial-voices for the nine viewers whose voices I'd previously set by hand. All nine kept their voices and can change them in chat. Their pronunciation settings stayed in JSON. Migration implementation

Rebuilding the voice picker with Vite

I noticed the picker always requested styles.css, even after I changed the styles. I moved the site to Vite 8.4.1, React, and TypeScript. The production build now gives CSS and JavaScript filenames a content hash, so a change gets a new URL and browsers can pick it up on the next page load. Voice picker migration

I kept all 31 voice cards in the initial HTML so you can browse the list while React loads. I tested the production build under the same /voices/ path used by GitHub Pages and checked that I could combine filters, switch audio samples, and copy a chat command. To try the picker locally now, run npm ci and npm run dev in the website checkout. Local development guide

One homepage for stream notes and chat voices

I bought litomore.live and built an English homepage where you can find a link from a stream or hear a voice before you choose it for chat. I moved the picker there and removed the old React site, Vite build, and GitHub Pages workflow from voices. I still maintain the CLI, speech synthesis, catalog, and MP3s in that repository. After the cleanup, all 10 tests passed, and I checked that the website imported the same 31 public voices with byte-for-byte identical samples. Stream notes · Chat voices · Voices cleanup

The first version of the site read each daily note's title from a one-line <!-- website-title: ... --> comment below the date. That let me revise the title alongside the report, and GitHub keeps the comment out of the rendered Markdown. Changes to notes, voice data, or samples trigger a website update through a GitHub App. The workflow syncs both sources, builds the site, and commits the snapshot when the content changes. Content sync script · Update workflow

What a shared stream link shows

My first version of the sharing preview used the note's title, date, and opening paragraph. I checked the generated HTML with JavaScript disabled so a link preview service can read it directly. I made three 1200 × 630 pixel-art cards for the homepage, notes, and voices, plus a dark 1280 × 640 preview for the GitHub repository. I kept the editable template and design prompts with the artwork so I can reproduce the cards later. Page metadata · Sharing cards

Choosing a language on litomore.live

I replaced the one-click language switch with a dropdown. Opening the language icon shows English and 简体中文 with a check beside the current choice. If someone sends you a link to a particular voice, you can switch languages and stay on that voice. I tested the menu with a keyboard and at phone and desktop widths, and checked the initial bilingual snapshot of three notes and 31 voices. The copied /voice command works the same in either language. Website changes

Translating only what changed

I set up a GitHub Agentic Workflow to read each new or edited note in full, write a title and short summary in both languages, and translate the body into Simplified Chinese. The archive and link previews use those summaries. With the workflow generating titles from the text, I removed the website-title comments from the existing notes and dropped that step from the writing instructions. The importer still skips the comment in older copies. For a voice, the agent supplies a Chinese label and an English translation of its greeting. I configured the workflow to use my personal Copilot Pro account and put the writing instructions in the website's AGENTS.md so my local agent can follow them too. Localization workflow · Shared writing instructions

I tested what happens when I polish a translation by hand and then sync again. Each entry stores a hash of its source text, so my edit survives while the source stays the same. Changing one article queues just that article. Replacing an MP3 on its own skips Copilot entirely. I also tested a translation with an altered Markdown link and confirmed validation rejected it before publication. After syncing with the latest website commit, I pushed the bilingual site and clarified how to deploy it from GitHub with Cloudflare Pages. Incremental update and validation · Cloudflare Pages setup