320 Commits

Author SHA1 Message Date
Antonio-Faure
75636f0735 perf(web): improve knowledge-base and settings accessibility and payload (#3139)
* fix(web): refine knowledge and settings accessibility and layout

Name row controls from their visible titles, portal tooltip descriptions out of tablists, and make the knowledge tabs keyboard-complete. Also stack the KB master-detail on phones, add a section-scroll hint, demote the indexing diagnostic to its detail tab, and consolidate the knowledge type scale.

* perf(web): cut knowledge and settings payload

Serve raster engine marks through next/image, stop preloading the serif face on pages that do not use it, and prefetch settings routes only on hover or keyboard focus instead of on first paint.

* docs(perf): record knowledge and settings audit

Document the protocol, baseline and after medians, payload and accessibility results, limits, and reproduction commands, with mobile before/after screenshots.

* test(web): match the model row's visible accessible name

The row no longer overrides its name with a provider-first aria-label; select it by the model-first text a screen reader now reads, which also contains the visible default/task badge.

* fix(web): keep the MinerU download-type name in the locale catalog

Reuse the existing Download models and Type strings instead of introducing a new t() literal, so the strict i18n audit stays green.

* docs(perf): link the UI audit from the handbook index

The docs contract requires every guide under docs-for-dev to be reachable from README.md.

* docs(perf): record the isolated knowledge-detail LCP

Re-measured the detail route with the host pinned away from unrelated work; the 668 ms row was contention, while the isolated median is 568 ms and the stable repeats overlap the baseline.

---------

Co-authored-by: Antonio-Faure <209759495+Antonio-Faure@users.noreply.github.com>
2026-12-01 17:12:12 +08:00
lipeh1
c1a2967045 feat(web): filter learning records by type (#2754)
Co-authored-by: lipeih <lipeihan@eazytec.com>
2026-12-01 14:02:04 +08:00
lipeh1
681b23766f feat(rag): support local rerankers for LightRAG queries (#3009)
* feat(rag): support local rerankers for LightRAG queries

Allow administrators to select a cross-encoder alongside the native LightRAG role models. Run scoring in a reusable worker and partition cached answers by reranker so model changes take effect on existing indexes.

Refs #2701

* fix(api): refresh the router index for LightRAG settings

* fix(rag): run LightRAG reranking in the shared reranker worker

anyio's process pool re-runs the server's __main__ file by path. When the
backend runs as `python -m deeptutor_cli.main serve` (the desktop app),
that file's relative imports fail, so every rerank call failed with
'Error during worker process initialization' and LightRAG silently kept
the original chunk order. Reuse the python -m reranker worker that the
LlamaIndex pipeline already uses.

---------

Co-authored-by: lipeih <lipeihan@eazytec.com>
Co-authored-by: zszz3 <zszz3@users.noreply.github.com>
2026-11-30 18:46:49 +08:00
1zrj
24aa2632d9 fix learning activity (ReadingCompanion, MasteryStudy, NoteCompanion) chat auto-follow (#2935) 2026-11-30 11:12:23 +08:00
lytanjie
305eb7bf75 fix: parse inline math in note tables and statistics notation (#2737)
* fix: parse inline math in note tables and statistics notation

BlockNote only renders `inlineMath` nodes, and two common shapes never
became one:

- `parseNoteMarkdown` converted inline `$...$` in a block's top-level
  content, but table cells live under `tableContent.rows`, which the walk
  never reached.
- The normaliser treated `$Var(N)$` and `$Cov(X, Y)$` as prose because the
  Latin-word heuristic did not recognise statistics function names, so it
  escaped the delimiters as stray dollars.

Recurse into `tableContent` cells and add the common statistics function
names to the math-word allowlist, with regression tests for both.

Co-Authored-By: Claude Code <noreply@anthropic.com>

* fix(web): count statistics names as maths only when they are called

"mean", "median", "rank", "span" and "var" are English words and a
keyword too, so with them in the word list "$52k mean, $48k median" became a
formula and a backticked `var x = 1` on a page with maths turned into KaTeX.
Keep them out of MATH_WORDS and accept them only before "(", which is how
Var(X) and Cov(X, Y) are written.

---------

Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: zszz3 <91608029+zszz3@users.noreply.github.com>
2026-11-29 15:11:07 +08:00
欧八同学
a345d44aef fix: remember the selected consult partner per chat (#2775) 2026-11-29 14:52:34 +08:00
Benjamin Schwing
648443b5dd fix(chat): don't open the quiz settings sheet when a quiz session loads (#2950)
* fix(chat): open quiz settings only when the learner picks the mode

The Activity panel auto-open watched the active capability, so loading or
reloading a session that was already in Quiz / Visualize / Research mode
counted as a switch into that mode. On a phone the panel is a full-screen
sheet, so every reopened quiz session started covered by its settings.

Open the config card from handleSelectCapability instead, the only path
for an explicit mode change (composer picker, slash command, launch
intent). Session hydration no longer opens it; restored per-session
settings are untouched.

Signed-off-by: Benjamin Schwing <63053132+BenjiAvH@users.noreply.github.com>

* test(chat): record viewer panel props through a spy

Assigning to the hoisted fixture inside the forwardRef stub trips
react-hooks/immutability; capture the props with a mock call instead.

Signed-off-by: Benjamin Schwing <63053132+BenjiAvH@users.noreply.github.com>

* fix(quiz): translate question badges and the German mimic label

The quiz card header printed the raw question type (short_answer,
fill_in_blank) and difficulty ids instead of the labels the quiz
settings already use, and the German catalog left "Mimic Paper"
untranslated.

Signed-off-by: Benjamin Schwing <63053132+BenjiAvH@users.noreply.github.com>

---------

Signed-off-by: Benjamin Schwing <63053132+BenjiAvH@users.noreply.github.com>
2026-11-29 14:52:18 +08:00
Qiu
506cea9d4f feat(desktop): finish Windows chat file actions (#3051)
Continues #2978 and closes #2887. Includes the original Windows file actions, integrates the changes with dev, and adds an explicit default-app action.

Co-authored-by: Botong Wu <2048400180@qq.com>
2026-11-28 13:09:15 -03:00
Qiu
6d0183d6f3 Merge pull request #2915 from Qiuner/mobile/react-native
feat(mobile): scaffold React Native chat client
2026-11-28 08:12:24 -03:00
LIziak112
ad355f454e feat(desktop): sync Windows menu preferences with web settings (#2971)
* feat(desktop): sync Windows menu preferences with web settings

* fix(settings): reconcile desktop preferences after updating the live baseline

* fix(desktop): guard menu zoom handlers against missing web view
2026-11-28 08:07:22 -03:00
Jinhang HE
76e3c0a4d4 fix(web): keep glass composer surface opaque over tucked tray (#2977)
* fix(web): keep glass composer surface opaque over tucked tray

- web/features/ui-layout/modern/modern.css: under theme-glass, set .dt-composer-surface background to --surface-raised so translucent --card no longer lets the tucked tray show through (#2329)
- Why: glass modern layout made the composer visually leak the tray behind it; opaque raised surface restores a solid input area without changing non-glass themes
MUST NOT commit: .env; .venv/; __pycache__/; node_modules/; dist/; target/; *.db; credentials*; *.pem; nested .git/

* fix(web): keep glass composer opaque in classic layout too
2026-11-27 12:35:15 -03:00
LIziak112
c328eff55c fix(chat): keep the classic extension tray off the composer controls
In the Classic layout the tray under the main input card (skills,
connectors, create, partners, answer mode) tucks up 20px behind the
composer and painted over its bottom row: the + button, the Chat mode
chip and the send button lost their lower halves to the tray's rounded
top edge at Windows display scaling. Modern was never affected - its
stylesheet already lifts the composer surface above the tray; Classic
had no such rule.

Scope the fix to Classic only: when the surface sits directly above the
tray it gets z-index 1, so it paints over the tucked tray at any
scaling. The shared Composer, the tray geometry and all Modern styles
are untouched.

Evidence (Windows 11, Chromium):
- web/tests/e2e/composer-tray.audit.ts, per-layout regression added
  with this commit: before the fix the classic case failed with
  "Resources is obstructed at its lower edge"; after it 3/3 pass
  (classic buttons clear, modern buttons clear, upward tray menus
  reachable).
- npm run typecheck: clean.
- npm run test:unit: 1468/1468 passed.
- npm run test:node: 1407/1407 passed.
- Before/after screenshots of the classic composer bottom row: the
  tray edge cutting the buttons vs. the buttons clear of the tray.

(cherry picked from commit a3d2a30cd85c81dbd245f6a61414b9607c357be1)
2026-11-25 17:56:40 +08:00
Qiuner
67deec1070 feat(mobile): scaffold React Native chat client 2026-11-24 04:08:27 -03:00
Bingxi Zhao (Frank)
66571c79db feat: acknowledge SiliconFlow partnership 2026-11-18 16:15:57 +08:00
Bingxi Zhao (Frank)
ce4434e75a fix(workspaces): reuse knowledge references in selective conversation moves
Fixes #2289
2026-11-15 01:42:46 +08:00
Bingxi Zhao (Frank)
e96cba219c feat(docling): expose optional enrichments and version remote cache
Fixes #2518
2026-11-15 01:20:52 +08:00
Bingxi Zhao (Frank)
9437173514 fix(i18n): translate tool hints through the selected UI catalog 2026-11-15 01:00:49 +08:00
Bingxi Zhao (Frank)
719e2a8e30 fix(chat): inherit ready workspace knowledge bases for untouched sessions 2026-11-15 01:00:49 +08:00
Bingxi Zhao (Frank)
47ae8a27e4 Merge PR #2515: feat(i18n): add Hungarian as an interface and reply language
Combine Hungarian with Italian UI and Hindi reply-language registries; translate 49 newly integrated keys and add the Hungarian endonym to Italian. Regenerate router and frontend contracts. 33 Python locale tests, full Node suite and locale parity pass.
2026-11-14 23:36:26 +08:00
Bingxi Zhao (Frank)
af403550ce Merge PR #2639: fix: explain missing LLM access in chat
Retain admission error text and localized model-access guidance; allow explicit retry to revalidate access instead of permanently blocking stored messages. No automatic retry on reload. Backend tests and both manual retry paths passed.
2026-11-14 23:19:09 +08:00
Bingxi Zhao (Frank)
2d493edb84 Merge PR #2521: feat(i18n): add Hindi as a reply language
Regenerate the lazy route index after the reply-language contract changes; targeted tests passed.
2026-11-14 23:16:33 +08:00
Bingxi Zhao (Frank)
a3dde93ffa Merge PR #2664: fix: admission rejections carry the server's text into the submission banner 2026-11-14 23:01:20 +08:00
Bingxi Zhao (Frank)
4c67b87018 Merge PR #2529: feat: add SpecStream as a web search provider
Register both independently added search providers and preserve both provider test cases and display labels.
2026-11-14 23:00:45 +08:00
Bingxi Zhao (Frank)
006b369008 Merge PR #2533: feat(search): add DeepSeek standalone SERP provider 2026-11-14 23:00:23 +08:00
Bingxi Zhao (Frank)
3fc9d2ce18 Merge PR #2534: feat(web_fetch): pluggable fetch backend with DeepSeek Fetch as first alternative
Combine independent locale additions and regenerate integrated route index.
2026-11-14 23:00:23 +08:00
Bingxi Zhao (Frank)
e6897249be Merge PR #2541: fix(web): language-aware CJK font stacks for chat prose 2026-11-14 23:00:05 +08:00
Bingxi Zhao (Frank)
5c7dbb2a7e Merge PR #2547: fix(web): move settings nav copy into locale catalogs (#2134) 2026-11-14 23:00:04 +08:00
Bingxi Zhao (Frank)
16cc590b63 Merge PR #2564: feat(chat): per-conversation reasoning-effort selector in the composer (#641) 2026-11-14 23:00:04 +08:00
Bingxi Zhao (Frank)
83f18f1be2 Merge PR #2577: feat(sidebar): group a practice session's questions into one Learning Records row 2026-11-14 23:00:04 +08:00
Bingxi Zhao (Frank)
68220257af Merge PR #2568: feat(guardian): show scoped Reading progress and quiz records
Combine independent locale additions and regenerate integrated route index.
2026-11-14 23:00:03 +08:00
Bingxi Zhao (Frank)
5d7843251e Merge PR #2643: fix(learning): load each source kind independently in the picker 2026-11-14 22:57:42 +08:00
zoran
e9ad28cc9f Mirror the learner vocabulary in the frontend types
The frontend surface union was narrower than the backend (it did not
admit "books"), and neither union admitted the mastery vocabulary.
Mirror grants.py in both type declarations and cover the extended
vocabulary with a grant + admission regression test.

Relates to #2638.
2026-11-14 00:01:53 +08:00
dach-a
09f2de1b1f fix: admission rejections carry the server's text into the submission banner
A start_turn_rejected terminal error already carries the server's own
explanation ("No LLM model is assigned to your account. Please contact
an administrator.", #2637; "This learning account cannot use this
mode...", the mastery case in #2638). The client toasted it for ten
seconds and then dispatched STREAM_END without it, so the persistent
composer-adjacent banner — the text users actually read — hardcoded the
transport copy "Couldn't reach the server..." for every rejection.

Carry the server text onto the flagged unsent row
(failedSubmissionMessage) and render it in the banner, falling back to
the connection copy only when the server provided no text. The toast
stays; the unsent row + Resend semantics from #1594 are unchanged.

Not persisted across reload: a reloaded unsent row shows the generic
fallback (its durable record keeps the exact request for retry); a
follow-up can extend the durable record if wanted.
2026-11-13 11:20:50 +00:00
ZQR1101
062eca80c0 fix(learning): load each source kind independently in the picker
The knowledge source picker fired all six source-library requests inside
one Promise.all and only rendered after every kind settled. A large
question bank (tens of thousands of practice entries accumulated
server-side) kept the whole panel on a spinner, so a ready knowledge base
could not be selected even after its own request had returned.

Land each kind in its own slice as its request settles, and gate each
consumer on the active kind's readiness instead of the aggregate. A ready
KB is now selectable while the question bank is still loading or has
failed; per-kind error alerts no longer paint a failure on a ready tab.
The aggregate loading flag still clears once everything settles.

Refs #2641
2026-11-12 19:55:50 +08:00
Junlin Li
560a80a17f fix: explain missing LLM access in chat 2026-11-12 16:58:52 +08:00
evan188199-tech
a074bcfcb9 feat(sidebar): collapse one practice session's questions into a single Learning Records row
Practice notebook entries recorded in one session now share a single
sidebar row, titled by that session with its question count, expandable
to each question's own practice link. Entries without a session (and
sessions that produced one question) keep individual rows, and the
Question Bank, answers and review links are unchanged.

The learning index navigation read gains the existing session id and
title (no new persisted field); grouping happens in the projection.
Sidebar strings added to every locale.
2026-11-10 00:33:52 +08:00
Yin
627d15fb2c feat(guardians): show durable question help separately from attempts 2026-11-10 00:31:22 +08:00
Yin
a420707623 feat(guardian): show scoped reading progress and quiz records 2026-11-09 23:07:32 +08:00
evan188199-tech
e837f0a1d9 fix(chat): never forward an unsupported reasoning-effort override (#641)
A persisted override the selected model no longer supports (e.g. a saved
xhigh after the catalog restricts the model to low/high) could reach the
provider: the selector re-listed the stale value, and the send path
forwarded the restored llm_selection.reasoning_effort unchecked.

- lib/reasoning-effort.ts: supportedReasoningEffortValues() returns the
  model's supported wire values (catalog list, else provider/model tables
  honouring declared_reasoning) without ever re-adding the stored value;
  effectiveReasoningEffort() resolves an override to null when the model
  does not support it; dropUnvalidatedReasoningEffort() strips it from an
  outgoing llm_selection — including when the option is unresolved, where
  the override is omitted (falls back to the configured default) rather
  than forwarded unvalidated.
- ReasoningEffortSelector: computeReasoningOptions uses the helper; a
  stale value is not offered and Auto renders as selected instead.
- ChatComposer: once the model options are loaded, a detected-unsupported
  persisted override is reset through the selector's onChange persist
  path; nothing is cleared while the option is still unresolved.
- ChatStateAdapter: outgoing llm_selection (live send and failed-turn
  resend) is sanitized via the last-known option catalog, which
  listLLMOptions now records (readLastKnownLLMOptions, synchronous).
- tests: helper/selector/restore-path coverage in
  reasoning-effort.test.ts, reasoning-effort-selector.spec.tsx and the
  new reasoning-effort-restore.spec.ts.
2026-11-09 22:36:10 +08:00
evan188199-tech
3b1730d758 feat(chat): per-conversation reasoning-effort selector in the composer (#641)
Carry the #958 service-layer reasoning_effort override through the whole
turn contract: the core TurnRequest LLMSelection accepts the field
(validated against VALID_REASONING_EFFORTS, old two-ID payloads unchanged),
the generated web contracts are regenerated, and ChatStateAdapter's
asLLMSelection restores a legal override instead of dropping it.

The composer gains a selector beside the model picker, offering only the
levels the selected model supports (live supported_reasoning_efforts or
the provider/model tables) narrowed to the wire vocabulary, hidden when
the model has none. The choice persists on the conversation's
llm_selection, so the next send uses it without a backend restart and
other conversations are unaffected; switching models resets the override.
Precedence stays conversation override -> profile/model default ->
provider default, and the context-budget readout reports the effective
effort beside the model when one was used.
2026-11-09 20:47:08 +08:00
evan188199-tech
da65a29e54 fix(web): dedicated voice nav key and bilingual settings search (#2134) 2026-11-09 17:46:38 +08:00
evan188199-tech
a312b26515 fix(web): move settings nav copy into locale catalogs (#2134) 2026-11-09 17:17:41 +08:00
evan188199-tech
91104d9a3f fix(web_fetch): settings UI for backend + harden DeepSeek fetch cap (#2448)
Addresses Air R1/R2 review blockers on top of the opened PR head:
Settings GET/PUT /api/settings/web-fetch with UI control; DeepSeek fetch
uses identity encoding, raw bytes, and capacity checks before buffer extend;
provider-branding treats `local` as generic.
Air Codex R3 on MacBook Air: READY.
2026-11-09 16:23:50 +08:00
evan188199-tech
a7df05f739 fix(web): tag assistant prose with the turn's recorded language (#2143)
AssistantMessage derived its lang attribute from the session-wide
language prop, so switching the reply language re-tagged every past
reply (zh->ja gave old Chinese replies Japanese fonts). Derive the
per-message language from the turn's request snapshot, recorded when
the turn was sent, and fall back to the session language only for
legacy messages without one. Add a behavior test covering two replies
with different recorded languages and the legacy fallback.
2026-11-09 14:53:24 +08:00
evan188199-tech
0a54ec76af feat(search): add DeepSeek standalone SERP provider (POST /v1/tools/search)
Engine-level search provider backed by DeepSeek's /v1/tools/search endpoint,
distinct from the model-side web_search tool mapping: works with any
configured LLM. Rows carry no model-written answer, so consolidation still
supplies it.

- providers/deepseek.py: Bearer auth, count capped 1-50, need_content
  default False (page Markdown kept in SearchResult.content only when
  requested), summary preferred over snippet as the model-facing blurb,
  authority/rerank_score in attributes, proxy honored, base_url used
  verbatim with the documented endpoint as fallback. No new dependency.
- SEARCH_PROVIDERS: label DeepSeek, requires_api_key=True,
  soft_fallback=False (billed per request; a missing key raises instead
  of landing on DuckDuckGo).
- Init wizard entry with DEEPSEEK_API_KEY/SEARCH_API_KEY env keys, keeping
  the wizard set equal to the backend table.
- TracePresentation PROVIDER_LABELS: deepseek -> DeepSeek (titleCase would
  render "Deepseek").
- Tests: row mapping, 401/402/429 paths, missing key fails before network,
  and the base_url/proxy/max_results contract via _NEW_PROVIDERS.
2026-11-09 11:52:03 +08:00
evan188199-tech
7117594329 fix: register SpecStream in wizard and branding for CI 2026-11-09 11:24:08 +08:00
Arrunabh Singh
b0bf8cf2d4 feat(i18n): add Hindi as a reply language
Add Hindi (hi, हिन्दी) to the reply-language contract, following step 4
of docs-for-dev/I18N.md and the earlier Malay change (550268e1):

- SUPPORTED_RESPONSE_LANGUAGES, the settings router's ResponseLanguage,
  the prompt-language label and the settings-spec reply choices;
- "hindi", "हिन्दी" and "हिंदी" aliases in the backend and web
  normalizers (hi-IN and hi_IN resolve through the base code);
- the web ResponseLanguage type, isResponseLanguage() and
  RESPONSE_LANGUAGE_OPTIONS, which the partner picker shares;
- regenerated frontend contracts, and tests mirroring the Malay change.

The interface language is unchanged: no web catalog or picker entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 18:24:54 +05:30
gezakepek-tech
adc80e5038 feat(i18n): add Hungarian as an interface and reply language
Adds a complete Hungarian (hu) locale alongside the existing catalogs, wired
through every seam a language has to pass so none of them silently serves
English to a Hungarian reader.

Frontend: the hu catalog covers all 6,584 English keys with matching
interpolation placeholders, registered in the locale registry, the lazy bundle
loader, Intl date/number formatting (hu-HU) and the reply-language picker.
`language.hungarian` ("Magyar") is added to every existing catalog so the
endonym is shown whatever the current interface language is.

Backend: "hu" is accepted by the launch, interface and reply-language
normalizers and offered in both settings choice lists, named in the prompt
language labels, and carries the Hungarian copy of the CLI-app, MCP and
sandbox messages, the quiz-judge prompt, the book export labels, the book
overview front page and the voice language list.

Scope: the CLI installer banner (`deeptutor/runtime/banner.py`) keeps its
English text for hu and falls back through `_pick_language`; it is terminal
setup copy unused in server deployments and is left for a follow-up.

Evidence:
- `python -m pytest tests/i18n/test_hungarian_locale.py` — 33 passed
- `npm run test:node` — 1353 passed (adds hungarian-locale-quality.test.ts)
- `npm run typecheck` — clean
- `node scripts/i18n_parity.mjs` — OK
- `node scripts/i18n_audit.mjs` — hu: 4529/4529 used keys (100.0%), strict
- `node scripts/generate-contracts.mjs --check` — no drift
- `ruff format --check` / `ruff check` on the touched Python files — clean

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-07 14:20:07 +01:00
evan188199-tech
5e46c4f32d fix(web): recover from synchronous socket construction failures (#2405) 2026-11-06 02:27:50 +08:00
evan188199-tech
aad58b82f8 feat: choose the model before a MasteryPath outline starts (#2407) 2026-11-06 02:27:50 +08:00