1644 Commits

Author SHA1 Message Date
lipeih
8f3b38cb29 fix(desktop): keep same-origin chat file URLs in the viewer
Use the Windows file menu and missing-file navigation integrated in #3051. Route a pasted absolute link to a published file through the same preview as its relative path, preserving the workspace query.
2026-12-01 10:06:30 +08:00
BackDEV
bedbfb3ee7 Merge remote-tracking branch 'origin/dev' into feat/calendar-month-year-picker 2026-12-01 08:15:17 +07:00
Antonio-Faure
a7f0bd5885 Merge dev into feat/inline-answer-cards
Resolve the executor conflict by keeping the new async
extract_chat_documents path and filtering answer attachments alongside
quotes. Node tests: 1418 passed; typecheck clean.
2026-11-30 14:15:32 +01:00
Benjamin Schwing
55cfc28642 Merge remote-tracking branch 'origin/dev' into tmp/quiz-judge-verdict
# Conflicts:
#	deeptutor/api/router_index.json
#	deeptutor/learning/semantic_assessment.py
2026-11-30 11:08:26 +00: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
BackDEV
f36fffec68 feat: replace year select with 12-year drill-down grid 2026-11-30 17:11:00 +07:00
BackDEV
5388ddff23 feat: add month and year picker to calendar 2026-11-30 17:04:09 +07:00
Qiu
ff0b7be3f8 fix(book): use the active clock for standalone chapter retries (#3098) 2026-11-30 06:33:07 -03:00
Benjamin Schwing
029a92e54e Merge remote-tracking branch 'origin/dev' into tmp/quiz
# Conflicts:
#	deeptutor/api/router_index.json
2026-11-30 08:33:38 +00:00
Chen jizhou
a3173eeb0e perf: reuse the textarea sizing mirror across edits (#2700)
Co-authored-by: chen-12-03 <184723954+chen-12-03@users.noreply.github.com>
2026-11-30 15:53:03 +08:00
Ding Junyao
f187580271 fix: add Source Han Fonts in font-family beside Noto Fonts (#2939) 2026-11-30 15:49:22 +08:00
Benjamin Schwing
a97a8e868a Merge remote-tracking branch 'origin/dev' into tmp/numeric
# Conflicts:
#	web/components/quiz/QuizViewer.tsx
2026-11-30 07:14:13 +00:00
sdloghub
45654d6618 fix(knowledge): browse files in connected IMA libraries 2026-11-30 14:04:19 +08:00
Chen jizhou
79a66cb3c1 perf: stop idle activity orbs and narrow theme observers (#2704) 2026-11-30 11:12:41 +08:00
1zrj
24aa2632d9 fix learning activity (ReadingCompanion, MasteryStudy, NoteCompanion) chat auto-follow (#2935) 2026-11-30 11:12:23 +08:00
David Alvarez
bad3f4230c fix(multi-user): prune stale deleted LLM models in GrantEditor (#3084) 2026-11-29 23:31:12 -03:00
OrdoAbChao7
8cb561362f fix(setup,llm): clear API key on vendor/region switch, unify compat retries, and honor Anthropic declared_reasoning 2026-11-29 20:49:02 +08:00
windyovo
e4f01a515e fix: refresh router index and lazy-load the speech decoder 2026-11-29 19:51:32 +08:00
Benjamin Schwing
063ceba67a Merge remote-tracking branch 'origin/dev' into merge/quiz-judge-verdict
# Conflicts:
#	deeptutor/api/router_index.json
#	web/components/quiz/QuizViewer.tsx
2026-11-29 12:22:03 +01:00
OrdoAbChao7
555d1ed561 perf(web): keep /chat route within JS budget via reasoning-effort dedup and lazy selector 2026-11-29 19:20:45 +08:00
windyovo
c587678b71 feat: stream Volcengine audio for chat read-aloud 2026-11-29 19:14:38 +08:00
OrdoAbChao7
33edb5d648 fix(llm): scope reasoning fallback cache by endpoint and align DeepSeek Flash default_on 2026-11-29 16:48:49 +08:00
Botong
dd29ff5a0a fix(i18n): sync frontend output language and remove zh-only UI fallbacks
Align frontend model-output language propagation and eliminate Simplified-Chinese-only UI shortcuts across chat, settings, books, reading, memory, and workspace surfaces:

- Preserve Traditional Chinese (zh-tw/zh-hk/zh-mo/zh-hant) and native aliases in resolveResponseLanguage(), and introduce shared effectiveResponseLanguage() and subscribeResponseLanguage() helpers.
- Sync response_language with language in SettingsStore when both were aligned, while preserving intentional divergence and clearing auto-synced pending response_language if an external desktop menu overrides language.
- Preserve per-conversation replyLanguageOverride when regenerating without a replay snapshot and subscribe ChatWorkspace's default reply-language label to live response_language changes.
- Route Book Creator, Book Chat fallback, Memory evolution/update, and Reading extension actions through effectiveResponseLanguage() instead of the UI language, and preserve zh-Hant in translationTarget().
- Route remaining zh ? ... : t(...) branches, hardcoded Memory labels, and binary zh/en date formatting through i18next and normalizeLanguage() so Traditional Chinese and all non-Simplified locales render through catalogs without modifying locale JSON files.

Related to #2933
Related to #684
2026-11-29 02:13:55 -06:00
Botong
24c55ee1f4 fix(i18n): fill European catalog gaps, plurals and stale French keys 2026-11-29 01:40:37 -06:00
lytanjie
ab51601b89 fix(web): keep statistics notation as inline math (#2878)
* fix(web): keep statistics notation as inline math

plausibleMathBody judged inline math by Latin words, so $Var(N)$, $Cov(X,Y)
and $Corr(X,Y)$ fell through escapeStrayDollars and displayed as source.
Add the common statistics functions to MATH_WORDS.

Also recover control characters left by JSON tool-argument decoding
(U+0008/U+000C/U+000D followed by a letter) back into \b, \f and \r, so
formulas already stored in notes render again.

Tests: latex-normalize.test.ts.

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

* fix(web): only restore a decoded escape that spells a KaTeX command

A form feed or carriage return in front of a word is not always a mangled
\frac or \right: text extracted from a PDF keeps a form feed between pages.
Rewriting every one of them showed a stray "\f" in front of the next word.
Restore the backslash only when the letters after it name a KaTeX command.

---------

Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: zszz3 <91608029+zszz3@users.noreply.github.com>
2026-11-29 15:29:03 +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
lytanjie
284e06145d fix(web): render GFM tables in learner card stems (#2879)
Learner-card stems go through InlineMarkdown, which only switches to the
rich renderer for math, emphasis, code and links; a stem whose only markup
was a table reached the learner as raw pipes. Detect GFM tables and route
those stems through RichInlineMarkdown, and add markdown-table.ts (table
detection plus a blank line after each table so a trailing sentence is not
swallowed as another row).

Tests: learner-card-table.spec.tsx, markdown-table.test.ts.

Co-authored-by: Claude Code <noreply@anthropic.com>
2026-11-29 14:53:07 +08:00
lytanjie
cf03cebdcb fix(web): split display fences that hug a matrix environment (#2880)
processLatexContent now runs normalizeEditorMdInlineMath, so a stem written
as $$P=\begin{pmatrix}...\end{pmatrix}$$ gets each $$ on its own line.
remark-math otherwise parses it as inline math and KaTeX fails on the first
ampersand or row break.

Tests: latex.test.ts, learner-card-math.spec.tsx.

Co-authored-by: Claude Code <noreply@anthropic.com>
2026-11-29 14:52:50 +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
mocias
23189ca690 fix(reading): keep Invidious picker controls inside its dialog (#3025) 2026-11-29 14:52:01 +08:00
Antonio-Faure
2df7cd1958 fix(web): center the new-partner wizard content (#2856)
The step body and footer capped themselves at max-w-2xl but stayed at the
left edge of the 1180px page container, leaving a wide empty column on the
right. Other partner surfaces (archives, chat) already center their
max-w-2xl column. Wrap the step header and body in a centered max-w-2xl
column and center the Back/Next row with it.

Layout-only change.

Co-authored-by: Antonio-Faure <209759495+Antonio-Faure@users.noreply.github.com>
2026-11-29 14:51:44 +08:00
欧八同学
5a1bd72ca2 fix: give the glass session viewer an opaque background (#2774) 2026-11-29 14:51:27 +08:00
于鸿伟
accf64c76d feat(i18n): prepare Traditional Chinese catalogs and fill translation gaps 2026-11-29 14:24:29 +08:00
Antonio-Faure
a70982c1e3 ci(web): make room for the inline answer cards in the route budgets
The card, marker parser and anchors add 17KB of raw JS to /chat and 7KB to
the reading route, taking them to 1113KB and 1371KB. Raise those two
budgets to 1120KB and 1375KB; the other routes are unchanged.

Verified with the production build: npm run perf:check -> all routes OK.
2026-11-28 20:48:29 +01:00
Antonio-Faure
8d65499cc8 feat(chat): attach inline answer cards to the next message
The assistant can put [[answer:q1]] on its own line after a question.
The reply renderer replaces it with a compact answer card; Attach puts
the written answer on the learner's next message as an answer
attachment, and the card folds to a chip that links to it. The user
message shows the answer as a chip that links back to the question.

The model receives the attached answers with the next turn and never
pauses: there is no tool call and no ask_user resume. The backend keeps
answer attachments out of document extraction and appends a grounded
answers block to the user message.

Verified: 3 backend tests, 1412 node tests, the answer-card Vitest,
typecheck, and the 4-test composer Playwright audit.
2026-11-28 20:14:30 +01:00
Benjamin Schwing
530ca9ae41 Merge remote-tracking branch 'origin/dev' into merge/quiz-judge-verdict
# Conflicts:
#	deeptutor/api/router_index.json
2026-11-28 17:30:24 +00: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
Carl
0b93ddd697 fix: use canonical npmjs.org URLs in web/package-lock.json (#3004) 2026-11-28 12:29:35 -03:00
Qiu
8c475445d2 fix(web): render bare scripted math in quiz prose (#2808)
* fix: render bare scripted math in quiz prose

* fix(web): recover quiz subscripts parsed as emphasis

Adjacent bare formulas can share Markdown emphasis delimiters. Mask candidate underscores only while locating prose ranges, then wrap the original symbols for KaTeX. Cover the reported circuit options through all three rendering routes.
2026-11-28 21:03:56 +08: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
OrdoAbChao7
9e1144b394 fix: address PR #2938 review blockers, reasoning sync, i18n, and quick setup edge cases 2026-11-28 17:15:46 +08:00
OrdoAbChao7
0c48637163 feat: add backend reasoning_control SSOT, 400 fallback, model guide banners, and clear API key action 2026-11-28 16:56:16 +08:00
OrdoAbChao7
3a843cd823 fix(i18n): translate quick setup and reasoning keys for Portuguese locale 2026-11-28 16:55:38 +08:00
OrdoAbChao7
22bc38effd feat(web): unfold settings nav, add locale-aware quick setup progress, and auto-detect reasoning toggle 2026-11-28 16:55:38 +08:00
OrdoAbChao7
9259aa2599 feat(web): add quick model setup workspace and collapse advanced model settings 2026-11-28 16:55:37 +08:00
kuanjames
883e8da26b fix: add the expert-voice settings string to every enforced locale 2026-11-28 13:15:17 +08:00
kuanjames
574ddaceb3 fix: fall back to configured expert voice when TTS discovery is empty
OpenAI-compatible TTS providers expose no voice-listing endpoint, so voice
discovery returns nothing and the audio overview pipeline fails with
'Configure distinct host and expert voices' even when the active model has a
voice configured. The chat entry point cannot recover because it never sends
per-request voices.

Add an optional expert_voice to the TTS catalog model (settings UI field +
runtime resolution) and let the audio overview fall back to the catalog's
voice/expert_voice pair when discovery yields no choices, with an explicit
distinctness check.
2026-11-28 12:56:52 +08: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