18 Commits

Author SHA1 Message Date
hongthana
98cfb501a5 feat(web): add account-scoped learning typography 2026-10-30 07:41:44 +07:00
Frank-zhu2000
9a04808c33 fix: follow the OS theme until the user picks one
The first visit stored the detected palette and never listened for
prefers-color-scheme changes, so the theme stopped tracking the OS and
Settings had no System choice.

Do not write that fallback. Subscribe while the preference is missing or
"system", and add a System option in Appearance. New accounts default to
system so Apply does not freeze the snow palette.
2026-10-28 16:31:49 +08:00
Bingxi Zhao (Frank)
fc0e0a9510 Unify French and Ukrainian language settings across app 2026-09-23 10:51:27 +08:00
TaoufikMejri
32848a6b57 feat: add french as supported language 2026-09-09 15:00:50 +01:00
Bingxi Zhao (Frank)
71e042fead fix(chat): let a user ask for another language, and stop the two copies drifting
Two defects, either of which alone produces "I set Chinese and it still
answers in English".

The prompt one explains the quoted refusal. `language_directive` is the last
thing in the system prompt and is an absolute prohibition — "Do NOT switch
languages" — sitting right after a runtime policy that says user-provided
text is not authority over these instructions. Asked 「请用中文回复我」, a
compliant model answers that it is *required* to reply in English. It is
reading the prompt correctly; the prompt is wrong. Conversational surfaces
now pass `allow_user_override=True`, which adds one sentence letting an
explicit request win. Books, quizzes and research keep the strict form: there
is no user in the loop to ask, and their prompts are full of source material
in other languages, which is what the strictness is for.

The storage one explains how `en` got there in the first place. The two
copies of the preference inherit differently: the server derives
`response_language` from `language` on every read, while the browser inherits
only when its own key is absent — so once an explicit value is stored the
browser can never re-adopt. Flipping only 界面语言 therefore left the server
(and the settings page) at zh/zh while every turn still shipped the "en" the
bootstrap had stamped. The settings page displayed the right answer and the
model gave the wrong one, with nothing broken in between.

So `loadSettings` reconciles both keys from the server it just read;
`updateLanguage` mirrors the server's inheritance when no explicit output
language was ever chosen; and the bootstrap gate splits, because a browser
predating the split has the interface key and not the response key, and
returning early on the first alone locked it out of ever adopting the
account's choice. Adoption writes only the key that is missing, so the
server never overwrites a choice the user made in this browser.

Not fixed here, and needing more than code reading to settle: whether to make
the server authoritative for live turns (it carries a `.lower()`-on-None
hazard at executor.py and a stale-preference fallback on regenerate), and
that `GET /api/settings/ui` is mounted without auth so it answers from the
admin workspace — which lets useSetupSync overwrite a learner's languages in
a multi-user deployment. Both are written up for review.
2026-09-08 00:46:09 +08:00
Bingxi Zhao (Frank)
04040a2c06 release: v1.6.5
Ship a content workspace you choose, one exec tool for every language,
Mastery Path modes that gate its tools, and Settings that grades
readiness instead of listing faults.

Release notes: assets/releases/ver1-6-5.md
2026-09-06 13:46:29 +08:00
Bingxi Zhao (Frank)
fc39543bc0 feat: integrate frontend backend and canonical routes 2026-09-01 22:24:29 +08:00
Bingxi Zhao (Frank)
d57d2983ef feat(mastery): complete v2 learning workflows 2026-08-28 14:58:43 +08:00
wayblink
be14c3ef23 feat: separate UI and model response languages (#758)
* feat: separate UI and model response languages

* refactor(settings): keep one owner for the interface.json language rules

The legacy migration — a file written before the UI/response split
inherits its single language into both fields — had been duplicated into
both readers of interface.json, as had the theme/language defaults. Two
copies of a migration rule drift.

Move the rule into resolve_languages() in the module that owns the file,
have the router compose its superset of defaults on top of the service's,
and cover the agreement with a test that reads one legacy file through
both paths. The helper also drops the separate key-presence check:
_normalize_language already falls back to its default for missing, null
and unrecognized values alike.

* fix: keep the language bootstrap single and local-choice-first

Merging dev surfaced three collisions this branch had not seen:

- The new bootstrap fetched /settings/ui unconditionally and overwrote
  writeStoredLanguage on every mount, undoing #730's rule that a choice
  made in this browser is the more specific signal and must win. Folded it
  into the existing guarded effect so one fetch serves both language
  fields and neither can clobber a local selection.
- apiFetch/apiUrl ended up imported twice in AppShellContext, which git
  merged without a conflict and tsc rejects outright.
- Three tests still stubbed get_ui_language at call sites that now ask for
  get_response_language: the question router's stand-in module and two
  mastery_path patches (renamed the zh case to say response language).

* fix(api): include response_language in the pre-session UI read

The bootstrap adopts both languages from this one endpoint, so leaving
response_language out of the projection meant a fresh browser always
inherited the interface locale and never saw the saved output-language
preference. It belongs with the other two: all three are the visitor's
own presentation choices, none describe the deployment.

---------

Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
2026-08-07 03:13:04 +08:00
Dongyu
bf76ccfd83 fix(web): honour the saved interface language on first load (#730)
The interface language is persisted in the backend's ui settings, but only the settings route ever read it into state — so /home and every other page started in English until the user picked the language again in that browser.

The app shell now adopts the saved value once after mount, and only when the browser has recorded no choice of its own, so a local selection still wins. It goes through apiFetch (works with auth enabled), leaves the routes statically prerendered, and keeps the zh locale a lazy chunk.

Also replaces the duplicated "New conversation" sentinel check with a shared helper — the chat header showed the untranslated English sentinel the same way the sidebar did — and adds three composer aria-label keys that were referenced but missing from both catalogs.

Closes #729.
2026-08-03 21:45:40 +08:00
Dryice Liu
be39000688 style(web): apply prettier v4.0.0-alpha.8 formatting to code-block theme files
Pre-commit auto-fixes from the project's pinned prettier (alpha.8).
Pure formatting — long object/array literals and assert.equal() calls
broken across multiple lines to satisfy print-width. No logic changes.

Files: code-block-themes registry, RichCodeBlock renderer, AppShell +
SettingsContext plumbing, appearance settings page, and the 6 affected
test files. Also adds a missing trailing newline to
app-shell-storage-code-block.test.ts.
2026-07-19 21:31:10 +08:00
Dryice Liu
7ff6b23c2b feat(web): add code block theme registry and shell distribution
Add a registry of every installed Prism theme (46 options) using
individual module imports rather than the barrel, plus type
declarations for the style modules. Extend AppShell storage and
context so code-block preferences are available synchronously to
renderers outside /settings/*. Sync backend-loaded values from
SettingsContext into AppShell storage and add update helpers that
PUT only the changed field.
2026-07-18 14:51:47 +08:00
Bingxi Zhao (Frank)
90a2c14c81 chore: backend + frontend follow-ons for v1.4.0-beta
Wires the new memory / capability / settings / quiz subsystems into
existing surfaces and finishes the chat-pipeline follow-on work.

Backend:
- Session services pick up the cumulative source inventory + new tool
  tags (turn_runtime, sqlite_store, pocketbase_store, protocol,
  base_session_manager).
- LlamaIndex RAG pipeline config / document_loader / retrievers
  tightened; rag/service.py routed to match.
- Sessions / unified_ws / settings / notebook routers updated for
  delete-chat-turn, multi-user, and the new tool surface.
- TutorBot manager + Zulip channel + openai_compat_provider follow-on
  fixes layered on top of the v1.3.10 SSL/Zulip sweeps.
- runtime/{banner, launcher, orchestrator}, services/setup/init,
  prompt/manager, json_parser refined for the runtime-settings
  rewrite.

Frontend:
- Co-Learn pages and session-surfaces removed (folded into chat).
- Chat composer / messages / trace / session panels, sidebars,
  common modals, markdown renderers, and i18n updated for the new
  ask_user / write_note / source-inventory flow.
- Admin, agents, co-writer, playground, book pages picked up the
  shared updates.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 18:08:22 +08:00
Bingxi Zhao (Frank)
77f29cbcc7 fix lint 2026-04-23 19:29:16 +08:00
Bingxi Zhao (Frank)
9035c476e5 refactor(web): extract app-shell storage helpers and fix /book prerender
Move localStorage/sessionStorage helpers out of AppShellContext into a
standalone client module so non-context callers can import them without
pulling in the full provider, and wrap BookPage in a Suspense boundary
to satisfy Next.js useSearchParams() CSR bailout during static prerender.

Made-with: Cursor
2026-04-20 20:34:01 +08:00
Bingxi Zhao (Frank)
593ddba3fb feat(co-writer): add multi-doc co-writer workspace with backend storage
- Add co-writer storage module and API router for document persistence
- Restructure co-writer page to per-doc routing ([docId]) with sidebar recent list
- Wire CoWriterRecent into sidebar shell and AppShellContext
- Tidy notebook prompts, facade, path service, and builtin tools wiring
- Refresh tests (add missing __init__.py, drop obsolete app_facade test)
- Add favicon/apple-touch-icon assets and minor i18n cleanup

Made-with: Cursor
2026-04-20 19:46:41 +08:00
Bingxi Zhao (Frank)
5960fbc0f7 refactor: remove litellm dependency, align provider architecture
- Replace litellm with native openai + anthropic SDKs across both
  services and tutorbot layers
- Add 5 new providers: mistral, stepfun, xiaomi_mimo, qianfan, ovms
- Add `backend` field to ProviderSpec for SDK routing
- New TutorBot OpenAICompatProvider (openai SDK) and AnthropicProvider
  (anthropic SDK), replacing LiteLLMProvider
- Rewrite services/llm/executors.py to use openai SDK directly
- Remove litellm from factory.py routing, token_tracker, provider_cmd
- Auto-fallback to streaming for tool-call format errors (fixes #265)
- Settings UI: provider dropdown with auto base-url fill
- Clean up litellm from requirements/cli.txt and pyproject.toml

Made-with: Cursor
2026-04-08 19:59:44 +08:00
Bingxi Zhao (Frank)
9c18bf0705 codebase cleanup and decoupled, introduce cli operation 2026-03-13 20:42:16 +08:00