Skip to content

feat: builtin miniapps + IM bot UX overhaul + disabled-model safeguards#450

Merged
GCWing merged 5 commits intoGCWing:mainfrom
bobleer:feat/miniapp-builtin-and-bot-i18n
Apr 18, 2026
Merged

feat: builtin miniapps + IM bot UX overhaul + disabled-model safeguards#450
GCWing merged 5 commits intoGCWing:mainfrom
bobleer:feat/miniapp-builtin-and-bot-i18n

Conversation

@bobleer
Copy link
Copy Markdown
Collaborator

@bobleer bobleer commented Apr 18, 2026

Summary

  • Built-in MiniApps: bundles three apps (gomoku, daily-divination, regex-playground) and seeds them into miniapps_dir on first launch; reseeds on schema-version bump while preserving the user's storage.json.
  • IM bot UX overhaul: introduces a shared locale (zh-CN / en-US BotStrings) and MenuView model under service/remote_connect/bot/, rewrites command_router on top of it, and updates Telegram / Feishu / WeChat adapters to render the same menu through their native primitives.
  • Disabled-model safeguards: AIClientFactory now rejects requests routed to a disabled model with a clear error; SessionManager subscribes to config updates and auto-migrates active sessions back to auto when their bound model is disabled or removed, emitting a new SessionModelAutoMigrated event so the UI can refresh its model selector.
  • FlowChat scroll stability: tightens VirtualMessageList / useFlowChatFollowOutput so streaming output no longer fights the user's scroll position; updated companion notes in FLOWCHAT_SCROLL_STABILITY.md.
  • Misc: Tooltip a11y tweak, AgentAPI gains the new auto-migration hook, locale strings for new flows.

Test plan

Compilation has not been re-verified locally — please run pnpm run desktop:dev (or cargo check -p bitfun-core) before merging if you want a clean build signal.

1. Built-in MiniApps

  • Launch desktop app on a fresh profile (or remove <appdata>/miniapps/builtin-*).
  • Open the MiniApp gallery and confirm three new entries appear: 五子棋 / Gomoku, 每日占卜, Regex Playground.
  • Open each one, interact briefly, then restart the app and confirm:
    • the apps still appear (no duplicate seeding),
    • any state stored via storage.json (e.g. divination cards, regex input) survives restart.
  • Manually edit <appdata>/miniapps/builtin-gomoku/.builtin-version to 0, restart, and confirm the source files are rewritten but storage.json is untouched.

2. IM bot UX (covers Telegram / Feishu / WeChat)

For each platform you have configured:

  • Send /help (or the platform's equivalent text) and confirm the new menu renders with native controls (Telegram inline buttons, Feishu interactive card, WeChat numbered list).
  • Switch app language between zh-CN and en-US, trigger the menu again, and confirm all labels/replies localize correctly.
  • Walk through one full command flow (e.g. select an agent → ask a question → receive answer) and confirm there are no regressions vs the previous router behavior.
  • Confirm WeChat numeric shortcuts (1, 2, …) still resolve to the correct command.

3. Disabled / removed models

  • Open settings → AI models, disable the model that an active chat session is currently using, and save.
    • The chat should immediately fall back to auto (model selector refreshes; a notice may appear in the chat).
    • Sending a new message should succeed via the auto-routed model.
  • Manually invoke a disabled model (e.g. by editing the request) and confirm the backend returns a clear Model '...' is currently disabled error instead of silently failing.
  • Delete a model that a session is bound to and confirm the same auto-migration happens.

4. FlowChat scroll stability

  • Start a long streaming agent reply and scroll up while output is still streaming — the viewport should stay where you left it (no auto-jump-to-bottom).
  • Scroll back to the bottom and confirm follow-output resumes automatically.
  • Resize the window mid-stream and confirm no flicker / scroll jump.

5. Smoke

  • Tooltip still renders correctly on hover/focus across the app (no a11y regressions).
  • App language switch (zh-CN ↔ en-US) updates new strings in flow-chat without restart.

bowen628 added 2 commits April 18, 2026 17:31
Bundles three built-in MiniApps and reseeds them on launch when their
schema version changes (gomoku, daily-divination, regex-playground), with
user storage preserved across upgrades.

Rebuilds the IM bot UX around a shared locale/menu model so Telegram,
Feishu, and WeChat adapters render the same MenuView through their
native primitives, and rewrites the command router on top of it.

Adds disabled-model safeguards across the agentic stack: the AI client
factory rejects disabled models with a clear error, and the session
manager subscribes to config updates and auto-migrates active sessions
back to "auto" when their bound model is disabled or removed (with a
new SessionModelAutoMigrated event so the UI can refresh).

FlowChat receives scroll-stability fixes in VirtualMessageList /
useFlowChatFollowOutput, plus minor Tooltip and AgentAPI additions and
locale updates.
CSS rules like `.result-overlay { display: flex }` were overriding the
UA's `[hidden] { display: none }`, which made initially-hidden panels
(gomoku result overlay, divination intro card, regex empty state) show
up immediately on first paint. Add a global `[hidden]` enforcement to
each builtin's stylesheet and bump their schema version so existing
installs reseed the fixed sources.
@bobleer bobleer force-pushed the feat/miniapp-builtin-and-bot-i18n branch from cb773b5 to 45751d5 Compare April 18, 2026 09:38
bowen628 added 3 commits April 18, 2026 17:41
Match details were stuck in a side column that competed with the
pattern library and the spec ref, so when the library card was tall
the matches body collapsed to its title and users could not see any
hits. Move the matches card into the main column right under the
test text, switch to a responsive grid with capped height + internal
scroll, surface line/column locations, mark zero-width matches
explicitly, and add prev/next navigation that syncs the active mark
in the highlight overlay. Bump builtin schema version to reseed.
…tion

Each builtin had a strong concept on the hero element but generic SaaS
chrome elsewhere, breaking immersion. Re-skin all three end to end so
the chrome reinforces the function:

- divination: arcane tarot — deep indigo + antique gold + serif
  display + gilded corner ornaments + starfield, all panels (fortune
  matrix, do/don't suits, lucky cells) carry the same ritual language
- gomoku: traditional game-room — rosewood plank topbar, parchment
  side cards with serif + 4-character spacing, vermilion accents in
  place of generic blue, ink-on-paper result overlay with seal frame
- regex-playground: IDE / terminal — Tokyo-Night-ish palette,
  monospace-first chrome, prompt symbols ($ /) on input rows,
  syntax-color accents (blue/green/orange/purple/pink) on flags,
  matches, library and ref cards

Bump all three builtin schema versions so existing installs reseed.
@GCWing GCWing merged commit 8b4c7cc into GCWing:main Apr 18, 2026
4 checks passed
@bobleer bobleer deleted the feat/miniapp-builtin-and-bot-i18n branch April 18, 2026 15:00
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.

2 participants