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>
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.
Adapted the migration foundation from PR #1384 while preserving current workspace, caption and turn-admission safeguards.
Co-authored-by: XZH <cto@xzh.ai>
* 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>
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>
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.
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.
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.
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>
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.
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.
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
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
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