56 Commits

Author SHA1 Message Date
1zrj
24aa2632d9 fix learning activity (ReadingCompanion, MasteryStudy, NoteCompanion) chat auto-follow (#2935) 2026-11-30 11:12:23 +08:00
Bingxi Zhao (Frank)
706ce1db38 fix(reading): zoom document images and synchronize annotations
Fixes #2499, #2472
2026-11-15 01:20:52 +08:00
Yin
054769a139 feat(reading): keep recorded help inside each quiz question 2026-11-10 00:23:38 +08:00
Bingxi Zhao (Frank)
20b7fa8c13 Load the document reader only for document tabs 2026-11-06 02:27:50 +08:00
Rimcat-JA
697249df56 fix(reading): don't adopt a /chat conversation as the collection's
The chat state is shared app-wide, so a /chat thread is still loaded when
a reading collection mounts. The effect that names the first turn's
session in the URL ran before the boot effect and wrote that thread's id;
the boot then took it for its own and never started a reading draft, so
Explain / Translate / Guide went to the /chat thread without the page or
selection. Bind the URL only after the collection has started its own
draft, and never to the session that was open when it did.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 15:24:02 +09:00
Bingxi Zhao (Frank)
c4f6b4972e fix(web): keep reading history controls reachable and refresh audit fixtures 2026-10-27 02:04:21 +08:00
Bingxi Zhao (Frank)
6bbcc00c55 Merge dev into preview, preserving preview features
Integrate dev fixes with preview's Python/TypeScript schedulers, chat queue, learning navigation, and live turn persistence.
2026-10-27 01:16:58 +08:00
Bingxi Zhao (Frank)
28c11e2ae8 feat: update notes, chat interactions and workspace UI on preview
Remove course pages, APIs and the course_study capability. Add anchored note
threads and reviewed learning-block generation, queued and withdrawable chat
messages, quote attachments, side chats, and the calendar/favorites/navigation
updates.

Keep preview's existing backend architecture. Wire the new features through
its Python application and existing chat engine, retain legacy selected-text
requests, persist mid-turn messages in replay, and restore note context when
regenerating. Leave stored user data intact.

Validate frontend contracts, dependency boundaries, types, 1290 node tests,
840 rendered tests, lint, localization and the production build. Exercise
session/notes/API regressions, 53 chat-engine tests and 20 Python/native
integration tests with isolated runtime data.
2026-10-26 22:13:34 +08:00
Bingxi Zhao (Frank)
583bdfc714 Merge PR #1945: fence edited submissions and isolate recovery by account and backend support 2026-10-19 01:03:40 +08:00
Bingxi Zhao (Frank)
399297e7f0 feat: preserve TypeScript engine migration and workspace updates 2026-10-18 23:09:10 +08:00
Mrmo072
adcf7dfa25 fix(chat): resolve browser-local unsent submission recovery 2026-10-15 14:41:46 +08:00
Bingxi Zhao (Frank)
33dea073bb perf(reading): load Markdown export only when requested 2026-10-15 01:52:08 +08:00
yepyhun
f986774b87 fix(chat): durably replace uncertain submissions and isolate recovery owners 2026-10-13 12:07:47 +02:00
Bingxi Zhao (Frank)
8986c31580 feat(reading): complete Watching convergence with safe legacy migration (#1378)
Adapted the migration foundation from PR #1384 while preserving current workspace, caption and turn-admission safeguards.

Co-authored-by: XZH <cto@xzh.ai>
2026-10-08 02:48:50 +08:00
Bingxi Zhao (Frank)
4cdf4fffcb perf(reading): load workspace dialogs only when opened 2026-10-07 20:58:20 +08:00
flower-moon
849ab28716 feat(web): fully resizable reading workspace panels + focus preset (#1310)
* feat(web): let the reading companion claim half the window with a focus preset

The companion column was drag-resizable only within a hard 640px cap, which
left readers with a narrow chat pane on wide monitors; leaving immersive
reading for the full chat loses the viewport-grounded context, so widening
the pane in place is the better escape hatch.

- Raise the drag ceiling to half the window width (the reader track keeps
  its minmax(360px,1fr) floor; the stored-width validator follows).
- Add a focus preset next to the panel toggles: one click collapses the
  contents navigator and sets the companion to half the window; exiting
  restores the previous width and navigator state. Ephemeral like the
  navigator collapse state - only the width persists.
- Hide the preset on narrow screens where the companion renders as a sheet.

* feat(web): fully resizable reading workspace panels

Extend the reading workspace from a companion-only drag handle to fully
user-sized panels:

- The contents navigator gains its own drag divider (184-400px, persisted
  in dt.reader.navigatorWidth) instead of a fixed 184-230px track.
- The companion's ceiling is now the reader's minimum width, not half the
  window: with the navigator collapsed the companion can claim all but
  360px, so readers on wide monitors can make the chat pane as large as
  the layout physically allows.
- The grid renders both dividers as dedicated 5px tracks so each handle
  owns one column and auto-placement lines the panels up.
- A persisted width that no longer fits (window moved to a smaller screen)
  is clamped at render time so the reader never drops below its floor.

* fix(web): measure the reading grid, not the window, for panel ceilings

The app sidebar sits outside the reading grid, so innerWidth overstates
the space the panels share and a companion dragged past the container
overflowed off-screen. Track the grid container with a ResizeObserver and
derive the companion ceiling (drag-time and render-time) plus the focus
preset from the measured frame, accounting for the divider tracks.

* Adapt reading panel resize and focus to current workspace layout

---------

Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
2026-10-07 20:51:05 +08:00
evan188199-tech
a597998134 fix(reading): converge the mobile header and dock the selection panel (#1734)
Below 768px the reader header converges to back, title + chapter,
bookmark and more: forward moves into the more menu (also when the
workspace hosts it), the file icon yields its width, and the chapter
indicator truncates inside a bounded share of the row instead of
disappearing. The selection panel becomes a bottom card on phones:
collapsed rows for short content, a capped scrollable body for the
note editor and overflow actions, a drag handle for pull-down-to-
dismiss, and safe-area padding; the desktop popover is unchanged.

Refs #916

Co-authored-by: XZH <cto@xzh.ai>
2026-10-07 20:29:14 +08:00
Bingxi Zhao (Frank)
ed3f9e9b4e fix(chat): distinguish unconfirmed replies from expired questions (#1648) 2026-10-04 18:14:40 +08:00
XZH
95e913a787 fix(reading): preserve EPUB outline anchors 2026-10-01 17:26:44 -07:00
Bingxi Zhao (Frank)
d2810c2812 Replace forwarded link titles with accessible tooltips 2026-09-27 10:41:33 +08:00
Bingxi Zhao (Frank)
108ca70072 fix(web): migrate learning and reading button title hints (#1526) 2026-09-27 10:29:14 +08:00
Bingxi Zhao (Frank)
105e8b237f fix(web): replace native title hints in question bank and reading workspace (#1526) 2026-09-27 05:02:24 +08:00
Bingxi Zhao (Frank)
d324df2b66 fix(reading): expose workspace skills in composer (#1596) 2026-09-27 04:55:15 +08:00
Bingxi Zhao (Frank)
a053fecf6e release: v1.6.11
The interface ships in French and Ukrainian alongside English and
Chinese, and /language pins a reply language for one conversation.
Immersive reading organizes collections as colored folders, adds a
fullscreen learning mode, and turns Explain / Translate / Guide me on a
selection into ordinary messages in the reading chat; "Quiz me on this
page" runs one quiz turn without changing the conversation's mode, which
retires the reading-openers endpoint and its task model. Images embedded
in DOCX, PPTX and PDF are extracted in place and reach vision models.

Office files preview as paged PDFs through LibreOffice (now in the Docker
image), falling back to the in-browser renderers without it. Web sources
re-sync on a durable schedule, linked folders sync on demand, .bib files
index, and a zotero_search tool queries Zotero. Settings gains Learning
progress and credential-free presets; admins import users from CSV;
split deployments can hand a session to a public device. Grok CLI joins
the subagents, Unifically the providers, ChatGPT exports the importers.

Gate cleanup: mypy/bandit findings in the new launcher, audio-overview,
web-source, reading-store and textbook modules; the task-model copy test
follows the retired reading_openers kind.

See assets/releases/ver1-6-11.md for the full notes, and the README
Releases row plus its eleven translations.
2026-09-24 09:59:56 +08:00
Bingxi Zhao (Frank)
53436f8190 feat(reading): collections as colored folders; rework reader interactions
Collections vs workspaces: a workspace holds many collections, and a
collection's files and reading conversations live in the workspace it
was created in. The library now shows collections as folders grouped
under their workspace, and creating one asks which workspace it goes
into.

- Folder page at /learning/reading/folders/[folderId]: breadcrumb,
  files, the collection's conversations, and "Start reading" that opens
  the whole folder in the reader. The reader's back link returns to it.
- Collections carry a user-picked color (new `color` column, migrated);
  tones are --folder-* tokens with dark variants.
- One shared "New collection" / "Edit collection" dialog with consistent
  type sizes.
- Selection popover gains AI actions; results land as cards at the foot
  of the companion. Read-aloud is a single header toggle.
- The three ⋯ menus (collection, document, conversation) merge into one.
- Outline toggle moves to the left and starts closed; navigator has
  Outline / Annotations tabs.
- Reading conversations live in the main sidebar (with a page-shaped idle
  mark) instead of a history dropdown in the companion.
- Fix sidebar rows never showing a selected state
  (bg-[var(--background)]/60 compiled to nothing).
- Composer floats over the conversation (no divider, bottom fade); the
  toolbar wraps by content instead of splitting under 420px.
2026-09-23 18:59:17 +08:00
Bingxi Zhao (Frank)
e2192ad7f6 perf(web): defer optional reading workspace views 2026-09-23 11:51:29 +08:00
Bingxi Zhao (Frank)
5726328d32 Align reading and progress UI with integrated navigation 2026-09-23 10:55:12 +08:00
Bingxi Zhao (Frank)
25211b7053 Merge PR #1367: fullscreen reading learning workspace 2026-09-23 10:30:04 +08:00
Bingxi Zhao (Frank)
d99ce81805 Merge PR #1380: transcript-aware reading media stage 2026-09-23 10:29:25 +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)
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
XZH
0c713da013 fix(reading): prevent learning shell layout overlap 2026-09-11 07:39:09 -07:00
XZH
b72fd85f17 feat(reading): add fullscreen learning workspace shell 2026-09-11 07:39:09 -07:00
XZH
071885cd2e feat(reading): add media transcript stage 2026-09-10 14:55:58 -07: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)
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)
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