Commit Graph

66 Commits

Author SHA1 Message Date
Bingxi Zhao (Frank)
7d330f043c Merge remote-tracking branch 'origin/pr-1503' into codex/merge-pr-1503
# Conflicts:
#	deeptutor/services/session/turns/executor.py
2026-09-23 10:32:28 +08:00
Bingxi Zhao (Frank)
ee24f44fa7 fix(ui): unify accessible tooltips (#1526) 2026-09-21 14:51:29 +08:00
Bingxi Zhao (Frank)
da856ad670 release: v1.6.9
Ship folder-based workspaces and data migration, daily practice, redesigned
provider and model settings, and streaming conversation improvements.
Synchronize README translations and document the archive/permanent-delete
upgrade behavior in assets/releases/ver1-6-9.md.

Reduce initial JavaScript by deduplicating English resources and loading
animation features after hydration. Keep the existing route size budgets.
Update regression fixtures and browser audits for scoped URLs and the new
settings and learning interfaces.
2026-09-21 02:30:40 +08:00
Bingxi Zhao (Frank)
c74915ab8b style(reading): retain the frontend quotation and semicolon conventions 2026-09-19 16:19:26 +08:00
Bingxi Zhao (Frank)
fe482d64eb fix(assessment): persist reading answers reliably across learning surfaces 2026-09-19 16:16:39 +08:00
Gao-Chenkai
3eb831d108 feat(learning): persist cross-surface Focus-Check in Question Bank
Route Mastery, Book, and Immersive Reading attempts through one review record so reading quizzes are server-graded, retryable, and show the learner's pick next to the reference answer.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 21:21:15 +08:00
flower-moon
f43c4ec49e fix(web): keep the reader's figure captions off the monospace rule
reading-display-preferences.test.ts asserts the reader view contains no
font-mono, guarding against the silent monospace readouts that used to sit
beside the display controls. A fallback picture's caption is not one of those
— it is a small muted label — so it keeps the muted styling without the
monospace family and the web test suite stays green.
2026-09-17 18:48:43 +08:00
flower-moon
e1b4954a23 feat(documents): Office/PDF 嵌入图片全链路支持 — 提取、显示、喂视觉模型
- 新增 utils/document_images.py:docx(OOXML单遍扫描)/pptx(python-pptx+OOXML兜底)/pdf(pymupdf, xref去重)
  嵌入图片提取,统一 [图片 N: name] 正文标记 + ImageBudget 预算(单文档12张/12MB,单回合16张/12MB)
- 聊天附件:extract_documents_from_records 产出嵌入图片 image 记录(embedded 标记),
  turn_runtime 托管附件库后经现有多模态注入管道发给视觉模型,UI 零改动渲染图片附件
- 阅读区:Extraction.media + 标记→locator 映射,入库 media/ + media.json,
  新增 GET /materials/{id}/media(/{name}) API,TextUnitView 图片条(article 外侧,不动逐字锚定),
  immersive_reading 回合注入当前页图片(≤4张),read_material 结果附图片清单
- docx 富提取顺带补齐 python-docx 一直丢掉的表格文本;EMF/WMF 矢量图计数尾注不静默丢弃
- MaterialManifest 新增 media_count(向后兼容);media_path 索引校验防路径穿越
- tests: test_document_images.py 8 用例;utils 51 + 阅读区全套 + session 209 通过

详细文档: docs/文档图片支持_提取显示与视觉模型_2026-09-07.md (gitignored)
2026-09-17 18:46:28 +08:00
Bingxi Zhao (Frank)
00979bd74b fix(reading): let the outline follow the page the reader is actually on
Turning pages in an EPUB, PDF or Markdown moved the header's counter and left
the outline behind: the sidebar stayed on whichever row was last clicked —
chapter one, for a reader who never clicked one — while the document was
eighty sections further along (#1447).

The workspace owns `activeLocator` because the outline panel is what needs it,
and only the rendered document knows where the reader is. The media stage has
always reported it up through `onLocatorChange`. The document surface had no
such prop: `handleVisibleLocator` set its own state and wrote the viewport,
both of which stay inside `ReaderPane`, so nothing the workspace reads ever
moved. Giving it the same seam the media stage has makes both branches say the
same thing to the same listener.

Scrolling the active row into view is deliberately not part of this. The
highlight being wrong was the defect; a panel that scrolls itself while the
reader is browsing it is a separate decision, and not obviously the right one.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 02:08:29 +08:00
AoHanBei
c986215fbe fix(reading): keep material loading during hydration (#1442) 2026-09-14 01:28:54 +08:00
evan188199-tech
791c8d28db fix(reading): package PDF.js decoder assets (#1305)
Co-authored-by: XZH <cto@xzh.ai>
2026-09-10 23:41:36 +08:00
Bingxi Zhao (Frank)
3466cf0cb0 fix(reading): stop the annotation popover disarming the toolbar
Selecting text and pressing 翻译成中文 did nothing at all — no request, no
spinner, no error. Two components were fighting over one piece of state and
the toolbar lost.

`AnnotationPopover` implements outside-dismiss with a document-level,
CAPTURE-phase `pointerdown` listener, and `onDismiss` was
`() => setSelection(null)`. The toolbar is a sibling far outside the
popover's ref, so pressing one of its buttons ran: pointerdown captured at
`document` → selection cleared → React flushes at the microtask checkpoint
between `pointerdown` and `mousedown` → the button re-renders `disabled`,
because the four selection-gated actions declare `requires: ["selection"]` →
and a disabled control is sent none of the rest of the activation sequence.
The click never happened.

It is not only translation: 引导我, 翻译成英文, 翻译成中文 and 解释词汇 are
all selection-gated and all equally unreachable, in every render mode. The
two the user did not report broken — 测一测 and 朗读 — are exactly the two
with no selection gate. Nor is it new in v1.6.5: the popover's listener dates
to v1.5.14 and the toolbar to v1.6.0, so these actions have never been
clickable. Escape routed to the same handler, so there was no way around it.

So "there is a selection" and "the popover is open" become two states. The
mount condition has to move with it — gating on `selection` alone would leave
Escape and outside-click unable to close the popover at all.

Two more that would have bitten immediately afterwards. The bar sent the
viewport locator while the selection carried its own, and the server verifies
the quote against the text of the unit it is told about — so the first
working click would have been a 400. And `busy` was a single global key, so
one action disabled all six for up to the 30s server timeout, wearing the
same dead 50%-opacity look as the bug.

The result-reset effect is split in two: a result is keyed on the material
(scrolling one page used to erase a card being read), while speech keeps both
keys, because it must stop the moment the reader navigates away.

The regression test mounts the reader and clicks the real button. Nothing
could have caught this before: the unit test is regex-over-source, and all
three Playwright audits that drive the reader stub /api/reading/extensions to
[], which makes the toolbar render nothing at all.
2026-09-08 00:39:12 +08:00
Bingxi Zhao (Frank)
771174f494 fix(web): re-send a refused answer instead of discarding it (#1273)
When a question's turn is gone, `submit_user_reply` is refused — correctly;
the backend has no waiter left. What the three composers did with that
refusal is the bug: they raised "This question is no longer active, so your
answer could not be sent. Send a new message to continue." and returned.

The composer had already cleared the box, so the return discarded what the
user had typed. And the advice was impossible to follow: every subsequent
message hit the same branch, because the predicate that routes into it reads
only the persisted card, which nothing ever retires. The one instruction the
error gave was the one thing it was preventing.

So a refused reply now falls through to `sendMessage` with the same content.
The card is one way to answer, never the only one, and the conversation
cannot trap the user — whichever of the several ways in to a dead turn they
came by (a backend restart, a Stop, a replay race).

The message says what actually happened rather than reporting a failure:
the text was delivered, just not to the question. `REPLY_NOT_DELIVERED`
stays for the card banners, where it remains true — a card's own Submit has
no composer to fall through to.

The regression test pins the refusal path specifically: it fails against the
previous `return`, which is the shape that stranded the reporter.

This does not remove the need to retire a dead card server-side (no
`ask_user_resolved` counterpart is ever emitted when a turn dies) — that is
the deeper half and is left as follow-up.
2026-09-08 00:26:00 +08:00
Bingxi Zhao (Frank)
895d2cce25 fix(web): stop the copy button reporting a success that never happened
The button inferred success from its handler's promise *resolving*, and the
handler it was given could not fail: `copyAssistantMessage` awaited
`navigator.clipboard.writeText` inside a try/catch that logged and swallowed.
So the only failure signal was destroyed one frame before the only code that
could have used it — and every clipboard failure rendered 已复制 with a
checkmark. Because the label is also the `aria-label` on an `aria-live`
element, the false success was announced to screen readers.

The failure is not exotic. `launcher.py` binds the web app to 0.0.0.0 while
printing a localhost URL, so opening the same instance from another machine
on the LAN is an ordinary way to run DeepTutor — and on that plain-http
origin `navigator.clipboard` does not exist, so reading `.writeText` throws
synchronously. `FilePreviewDrawer` already carried a comment naming this
exact cause; the handling was local instead of shared.

So: one `copyText` helper that rejects when the text did not reach the
clipboard, with a selection-based fallback for insecure origins (probed
before any await, since `execCommand` needs the click's user activation);
`CopyActionButton` narrowed to a `Promise<void>` handler and given a real
failure state, so the contract cannot be reintroduced by the next consumer;
and the three consumers plus the two other optimistic sites moved onto it.

`Promise.resolve().then(() => onCopy(...))` replaces
`Promise.resolve(onCopy(...))` because the latter runs the handler outside
the chain, which is where the synchronous TypeError was escaping.

Also adds the `attachments` and `references` locale keys. Both call sites
pass a lowercase noun for inline reading, neither key existed, and i18next is
configured to return a missing key verbatim — which is why a Chinese UI
rendered "5 attachments" in English next to this very button.
2026-09-08 00:22:08 +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)
93df3d48b7 release: v1.6.4
Ship lighter isolated runtimes, richer Books and Mastery flows,
Reading/session polish, and explicit model API capabilities.

Release notes: assets/releases/ver1-6-4.md
2026-09-03 01:38:54 +08:00
Bingxi Zhao (Frank)
6e6e56aedb release: v1.6.3
Ship the breaking front- and back-end runtime and route refactor,
learner and guardian flows, grounded reading, knowledge and parser
updates, and recoverable long-running streams.

Release notes: assets/releases/ver1-6-3.md
2026-09-02 04:09:11 +08:00
Bingxi Zhao (Frank)
fc39543bc0 feat: integrate frontend backend and canonical routes 2026-09-01 22:24:29 +08:00
Bingxi Zhao (Frank)
02ba56793e chore: checkpoint backend stabilization workspace 2026-09-01 21:28:15 +08:00
Bingxi Zhao (Frank)
bfdf874a10 refactor(web): remove v1 chat transport and legacy surfaces 2026-09-01 20:16:46 +08:00
Bingxi Zhao (Frank)
829be646a1 chore(web): enforce frontend architecture boundaries 2026-09-01 19:55:48 +08:00
Bingxi Zhao (Frank)
f63e29c7c5 refactor(web): split chat message and trace presentation 2026-09-01 18:23:31 +08:00
Bingxi Zhao (Frank)
68bb0d108d feat(web): unify turn lifecycle feedback 2026-09-01 18:13:58 +08:00
Bingxi Zhao (Frank)
13698a9a7e refactor(web): retire the unified chat context path 2026-09-01 17:59:50 +08:00
XZH
55bb5f7c13 feat(reading): add session-scoped cross-material navigation history 2026-08-31 08:44:08 -07:00
Bingxi Zhao (Frank)
57df37b75f Merge pull request #1119 from evan188199-tech/codex/feat-reading-translation
# Conflicts:
#	pyproject.toml
#	web/components/reading/ReadingExtensionBar.tsx
#	web/locales/en/app.json
#	web/locales/zh/app.json
#	web/tests/reading-extensions.test.ts
2026-08-31 20:08:59 +08:00
Bingxi Zhao (Frank)
dd154501a0 Merge pull request #1115 from evan188199-tech/codex/feat-reading-quiz-extension
# Conflicts:
#	pyproject.toml
#	web/components/reading/ReadingExtensionBar.tsx
#	web/locales/en/app.json
#	web/locales/zh/app.json
#	web/tests/reading-extensions.test.ts
2026-08-31 20:01:30 +08:00
Bingxi Zhao (Frank)
2f26e468b6 Merge pull request #1108 from evan188199-tech/codex/feat-reading-vocabulary
# Conflicts:
#	pyproject.toml
#	web/components/reading/ReadingExtensionBar.tsx
#	web/tests/reading-extensions.test.ts
2026-08-31 19:57:20 +08:00
Bingxi Zhao (Frank)
37fc1f1b06 Merge pull request #1106 from evan188199-tech/codex/feat-reading-study-guidance
# Conflicts:
#	pyproject.toml
#	web/components/reading/ReadingExtensionBar.tsx
#	web/locales/en/app.json
#	web/locales/zh/app.json
#	web/tests/reading-extensions.test.ts
2026-08-31 19:55:28 +08:00
Bingxi Zhao (Frank)
efcee00757 Merge pull request #1036 from Zuan0/reading-citation-grounding
# Conflicts:
#	web/components/chat/home/ChatMessages.tsx
#	web/components/common/AssistantResponse.tsx
#	web/components/reading/ReaderPane.tsx
#	web/context/ReadingContext.tsx
#	web/context/UnifiedChatContext.tsx
#	web/lib/reading-turn-state.ts
#	web/tests/e2e/reading-citation-material.audit.ts
#	web/tests/reading-citations.test.ts
#	web/tests/reading-turn-state.test.ts
2026-08-31 19:34:01 +08:00
Bingxi Zhao (Frank)
09b5698039 Merge pull request #1031 from Zuan0/reading-citation-capture
# Conflicts:
#	web/components/reading/AnnotationList.tsx
#	web/components/reading/ReaderPane.tsx
#	web/lib/reading-api.ts
2026-08-31 19:10:34 +08:00
Bingxi Zhao (Frank)
f80b2b4a71 Merge pull request #1009 from evan188199-tech
# Conflicts:
#	web/tests/reading-outline.test.ts
2026-08-31 18:40:45 +08:00
Bingxi Zhao (Frank)
1fc797169b Merge pull request #1100 from contributor
# Conflicts:
#	web/components/reading/workspace/useReadingWorkspace.ts
#	web/context/UnifiedChatContext.tsx
#	web/hooks/useMasteryStudySession.ts
2026-08-31 18:18:03 +08:00
Bingxi Zhao (Frank)
8d0378f3f8 Merge pull request #1104 from contributor 2026-08-31 17:51:52 +08:00
Bingxi Zhao (Frank)
3dc372f551 release: v1.6.2 — immersive watching and extensible visualizers
Add synchronized YouTube learning, a plugin-driven visualizer catalog, and Hermes, OpenClaw, and DeepSeek agent harnesses. Refresh Reading, Knowledge, Partner status, guided updates, documentation, translations, and release notes for v1.6.2.
2026-08-31 01:13:07 +08:00
XZH
f3079d72ed feat(reading): add source-grounded translation extension (#1117) 2026-08-30 08:09:19 -07:00
XZH
d6735ec986 feat(reading): add source-grounded quiz extension (#1114) 2026-08-30 07:29:26 -07:00
XZH
c102bd0917 feat(reading): add source-grounded vocabulary extension 2026-08-30 05:41:11 -07:00
XZH
928be1e5f2 fix(reading): render study-guidance steps 2026-08-30 05:26:49 -07:00
XZH
78f291d311 feat(reading): add source-grounded study guidance extension (#1105) 2026-08-30 05:15:35 -07:00
XZH
1fb291045d feat(reading): add safe read-aloud extension (#1103) 2026-08-30 04:56:05 -07:00
XZH
2c06318fe4 fix(courses): preserve handoff course scope (#1099) 2026-08-30 03:49:02 -07:00
Bingxi Zhao (Frank)
5228af9141 merge: integrate recent issue fixes
# Conflicts:
#	web/context/UnifiedChatContext.tsx
#	web/tests/reading-turn-state.test.ts
2026-08-30 17:49:11 +08:00
Bingxi Zhao (Frank)
f694f204a8 feat: add app updater and unify workspace chat flows 2026-08-30 17:40:47 +08:00
Bingxi Zhao (Frank)
3f3bf0b841 feat(reading): render safe versioned web snapshots 2026-08-30 16:01:40 +08:00
XZH
d5d381650f fix(reading): bind citations to turn materials and verified locators 2026-08-30 15:45:45 +08:00
Bingxi Zhao (Frank)
ce7c2dc2dc release: v1.6.1 — one key, one navigator, one sidebar you arrange
Model configuration was one layer replicated seven times: every service
stored its own profile with its own credentials, so a single OpenRouter
key had to be pasted into five separate pages. This release splits that
in two — a **connection** holds one vendor credential and links it down
to every service that vendor can serve, and a **task model** takes the
calls nobody asks for (naming a conversation, writing the composer's
starting points) off the model picked for actual reasoning. Both are
opt-in; existing per-service profiles resolve exactly as before.

Around that: Settings drops the card grid for a persistent searchable
navigator whose landing page answers "what state am I in" instead of
repeating the directory; Mastery Path files study conversations under
their topic and opens them in the tutor rather than dropping them on
/home; the sidebar folds features into More and reorders by drag; the
reading companion is rebuilt from /home's own chat components; and the
LightRAG engine talks to the SDK directly, so its extra no longer drags
MinerU in transitively.

Also back-merges PR #1041 (Anthropic SDK 1.x temperature via extra_body)
and PR #741 (owner-only auth secret/token files), which had been merged
straight into main and never flowed back to dev.

Release notes: assets/releases/ver1-6-1.md
Gates: pre-commit 15/15, ruff clean, pytest 5802 passed, web 450 node
tests, eslint 0 errors, docs build clean.
2026-08-30 13:19:42 +08:00
Bingxi Zhao (Frank)
43c9fe7ea0 feat(course): make a course the container, not a dashboard
A course held the right model — the syllabus that gives progress a
denominator, resources as references, conventions apart from the
assistant's own notes — but almost nothing crossed the edges between it
and the surfaces it was supposed to contain.

Getting in. Course Study was offered in the composer's mode menu while
the only way to bind a course was a link on the course page, so choosing
it there produced a conversation identical to an inert one, and the mode
advised pressing a button that did not exist. The composer now carries
the binding next to the mode: shown whenever there is one, and offered
as an unfinished field in Course Study when there is not. `_course_id`
rides every turn, so detaching detaches and the pill can never drift
from what the turn actually saw.

What a conversation inherits. `default_capability` and `default_persona`
were stored, validated and returned by the API while changing nothing:
`_apply_course_defaults` only fills fields a payload *omits*, and this
composer always sent all of them. They are applied client-side now,
along with the course's knowledge bases, where the learner can watch the
mode and material become the course's before they type. The dialog grows
the editor they never had.

Conventions. "Every conversation in this course starts knowing these" was
true only if the model happened to call `course_overview`. They ride in
the per-turn summary now, and — because the promise is not scoped to one
mode — in the system prompt of any course-bound turn.

Coming back. Mastery Path and Immersive Reading now read `?course=`,
scope themselves to it, and attach whatever is built there; the tiles and
hand-offs pass it; the picker offers to start one. A course could only
ever reference what already existed, so filling a new one meant leaving,
building, and remembering to return.

Hand-offs. A target with no ref stored an opening line for an index that
never consumes it, which then surfaced weeks later in an unrelated path.
An unresolvable ref was passed straight through: observed live, a
syllabus unit id ("u2") sent as a mastery path, producing a card pointing
at a page that does not exist. Refs are checked against the subsystem
that owns them — existence, not membership, since a path built outside
this course routes perfectly well.

Also: the sidebar groups conversations by course, so filing them is
finally readable; a course-scoped notebook console no longer shows
another course's notes beside a list saying there are none (the clear
raced an in-flight detail fetch that landed after it); a hand-off the
model also printed as prose is not rendered twice; a provider error is no
longer stored as a conversation's permanent title; `/space/courses` goes,
having been an unreferenced copy of `/courses`; and the Visualize mode
description gets its missing Chinese.
2026-08-30 00:09:36 +08:00
Bingxi Zhao (Frank)
fc0be68d6f wip: course / partner groups in progress 2026-08-29 22:29:53 +08:00
XZH
8263cddec8 feat(reading): expose EPUB headings in the persistent outline 2026-08-28 08:15:53 -07:00