You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
5.4.0 — 2026-11-27
There is now a StudyHub terminal client (TUI) for practising, studying and reviewing in a terminal. It lives in the repository under packages/studyhub-tui and is not yet part of the DSH plugin or desktop downloads: run it from a source checkout with npm run tui:build and npm run tui (guide: packages/studyhub-tui/docs/GUIDE.md, also opened by /guide inside the client). It is built on React 19 and Ink 8 and reads the same library as StudyHub. It covers practice, the library, materials, WrongBook, Notes, Board, Tasks, Audio, Book, Generate, Settings, Exam and ExamCoach views, Ctrl+K full-text search, deck import / merge / split, study plans, review and exam modes, reader and export tools, and a board that syncs with StudyHub. It also has Alt+click mouse support (normal clicks still select text), a warm-amber dark theme and a low-contrast soft-sage theme, a 96-column centred layout, compact and relaxed spacing, a daily study brief, a prompt after 20 seconds of being stuck, clickable source links (OSC 8), and recently used commands pinned in the command palette. The exam-prep page shows the saved 备考计划 from the backend; its [T] table and Markdown export come from it. Not verified: any of this in a real terminal other than the automated PTY/E2E harness, and Windows terminals other than the test environment.
The TUI assistant answers by what it can really do, and no longer says "已完成" when nothing happened. The assistant can skip a card, move a card to the end of the queue, check grading status and explain a card. A request it cannot fulfil gets a short explanation with the real entry point, and irreversible actions still ask for confirmation. A failed action shows a readable reason and an "[A] 重试" retry entry; "已完成" appears only after a real backend side effect. The "标记错因" chip appears only after a wrong answer and offers six reasons, and undo clears the mark; the wrong-book export shows the reason. Score changes accept only an explicit 0–5. Explain, guided, retell and follow-up chats share one send / abort layer and one prompt core; follow-ups are multi-turn, show source excerpts for questions tied to page ranges, and clear when you switch card or result. Notes saved from explanations get plain titles, and note.qa.save no longer overwrites a saved follow-up by default. The term glossary can suggest AI translations behind a confirmation, with manual entry as the fallback. Not verified: behaviour against a live model provider in a real terminal; the tests use fake models.
TUI keys, layout and saving were reworked so shortcuts stop colliding and a failed save no longer loses data. All global, Ctrl and Alt shortcuts go through one key router used by all 16 primary views; Alt+arrows, Alt+PgUp/PgDn, Alt+Home/End and a quick double Esc are no longer swallowed, and Esc that clears a filter no longer also collapses the assistant panel. packages/studyhub-tui/docs/KEYBINDINGS.md and the guide are checked against the code automatically. Below 60×18 an overlay covers the page instead of unmounting it, so unsaved input, cursor and scroll position stay. Ctrl+O opens the latest 50 notifications, where you can copy or clear them. Grade labels now read 0 无答案或完全错误, 1 答对一小部分, 2 接近, 3 答对(通过), 4 良好, 5 完整; the pass line (grade ≥ 3) and stored data are unchanged. Due, weak and mastery numbers on the dashboard, library and board come from single sources and count the same population (learnable cards; suspended cards are shown beside the total). Settings, deck, board, draft, notes and exam-prep writes use one atomic temp-file-and-rename path with rollback; corrupt files are backed up first, a failed backup aborts the write, and a file that cannot be read right now (for example locked on Windows) is not overwritten. tui.json gets version: 1, and a newer version is left untouched. Free text and question-stem previews are no longer saved to preferences, and recommendation-button usage goes to a separate tui-usage.json. Unreadable, corrupt or newer-version retrieval, notebook, coach-daily, estimate-calibration and desktop config files are not overwritten. The large ReviewView.tsx (3083 → 696 lines) and WorkspaceTab.tsx (2699 → 608 lines) were split, with a 1000-line ratchet on TUI source files; the split also fixes multi-blank cloze drafts (blank 2 and later) being dropped when you leave a card and come back. Not verified: the persistence changes on a real user library (only temporary directories in tests), and the TUI as a whole outside the PTY test harness.
Typing 「直接讲完」 to the guided-teaching step check now reveals the rest of the steps instead of grading that sentence as an answer. Skipping a step and revealing all remaining key points already worked from the panel's buttons and from the TUI keys; what was missing is the typed sentence itself: 「直接讲完」, 「剩下的直接讲给我听」, 「全部跳过」, "skip all", "show the rest" and close variants now end the walkthrough with every remaining key point listed, no model call, and the steps kept out of 已掌握 — the same as pressing the button. A real explanation that happens to contain those words (a longer sentence) is still graded normally, and one-step phrases such as 跳过 or "skip this step" still skip only that step.
Not verified: the sentence lists are hand-written; an unusual phrasing outside them is still sent to the model as an answer. Only the Chinese and English copies shipped with the panel were checked; no other languages exist yet.
Showing right or wrong after an answer, 下一题, and opening the source beside a question no longer stall. With a material open beside the question, every answer and every next question made the browser restyle the whole page, the chapter of source text included. Now only the question's own part is restyled. Measured on a library of 3 books of 800 pages each, at 1440 px with the source docked beside the question: style work from an answer to the verdict went from about 250 ms to about 70 ms; 下一题 from 430–515 ms to 100–150 ms; 看这题的原文 from 216–248 ms to 85–100 ms. The formula scan on opening an 800-page book went from about 350 ms to about 30 ms. Nothing looks different: the bar at the bottom after an answer still never covers what has the keyboard focus, and highlights, marks, find results and the cited passage in the source are drawn as before.
Not verified: the numbers are from the preview page (development React, Chromium). They were not measured inside DSH, in the desktop app, or in a narrow window where the source opens as a dialog, and the highlights were not looked at in WebKit. The find highlight and the linked-passage highlights of the reader are held by a check of the rules only: no passing browser test saw them drawn (the 4 browser tests that cover them already failed before this change). The number of backend calls on opening a source and after each answer is unchanged, so a very large material still waits for its data. The dropped class recordings from the same comment are not addressed.
The workspace starts with 160 KB less to download, because 找功能 (the "where is X" finder) now loads the first time you open it. The finder's list of every feature was the largest single piece of the first load, and most sessions never open it. Pressing Ctrl K, / or the sidebar row now opens the same dialog at once; the list appears as soon as it has arrived (a moment the first time, instant afterwards), and the list itself, its search and its 「带我去」 are unchanged. Not verified: it was not opened in a real browser or inside DSH, so the first-open wait on a slow connection and the focus returning to the control that opened it were checked in markup and unit tests only.
Whole-course prerequisite linking and term extraction run as a background job. Course-level organising runs as a task in 任务, with each term extraction as a step; the confirm dialog first shows the card count and an approximate range of model calls. Auto-added links are tagged, the job reports "partial" when term extraction fails, and automatic prerequisite links can be undone in one pass, however many there are. Same-topic sibling questions are no longer auto-linked. Not verified: a very large real course through a live model.
Parent and child course scope, deck-to-course assignment and new-card order are consistent. Methods, companions, guided study and the review book read parent and child courses the same way, and exam-coach scope is isolated. Search filters historical versions, the daily plan excludes example, archived, historical and deleted items, and stats count rubric and voice attempts. Renaming or merging a course keeps its data, and the course field in deck management starts from the deck's real course, so saving no longer removes a deck from its course. The recommended deck order needs confirmation before it is applied. Not verified: large multi-course libraries on a real Desktop install.
Questions can be tuned to the learner's foundation level and to code courses. A learner foundation level is added, and the zero-foundation prerequisite gap scan now produces prerequisite cards that pass validation and can be published; the level is kept through draft continuation, retry and review. A code-reading question strategy removes answer-leaking code comments and drops cards that still leak. Cloze blanks inside fenced code blocks are multi-line text areas (Enter adds a line, Ctrl/⌘+Enter submits, Esc leaves the field), and blank counts, voice answers, grading and export handle them. Generation estimates now count the learner-level scan. Not verified: real-model generation of code-reading or zero-foundation cards (tests only).
A few interface details are fixed. A Tooltip closes on Escape regardless of focus or pointer. The thumb-feedback tray closes on an outside click. The sample library keeps each practice record on its own local day, so its streak no longer breaks when it is loaded late at night or just after midnight. Not verified: these details in a packaged Desktop window; they were checked by unit and browser tests.
The practice page has inline Socratic tutoring. The practice page gets an inline Socratic panel and a context stack that returns you to the original question. Tutoring steps no longer count as answers, and help taken in the drawer is recorded against the question. The Socratic drawer no longer reopens by itself when you return to a card, and a Socratic hint counts as exposure only if it was shown in the current round. Follow-up explanations can show inline SVG diagrams, loaded lazily. Not verified: inline SVG diagrams and the inline panel in a real DSH host or packaged Desktop window; only unit and browser tests.
Search and index fixes keep retrieval hits and the settings count right. Source ids too long for a filename are hashed, which fixes ENOENT and stale content after edits. Pages that only need an index key-format upgrade are counted separately from edited pages, so a library with only pending upgrades no longer looks empty. Prefix-scoped searches no longer drop every hit. Re-importing a scanned document is no longer blocked by the sync guard. Not verified: an index rebuild on a real large library.
About 100 fixes from user research. Startup waits for the UI language and shows a compact banner with Retry and sidecar-restart recovery instead of a crash screen. Guided teaching and retell errors appear in Chinese, and retry buttons are hidden for errors that cannot be retried. Archived reference samples stay usable; only deleted ones block generation, with an explanation. Renaming a regular PDF no longer hides "sync latest file content". Desktop config recovery re-reads the file first and aborts the reset if the backup fails. The backup upload limit is 256 MB with clearer errors. Before AI classify, materials show a single upper-bound usage estimate. Not verified: each item in a real Desktop window; they were checked by unit and browser tests.
Pressing 发给主会话 in the 问 AI panel is no longer lost when the book shifts under the pointer. If the page moved the panel while the button was held (a picture loading above it, the book laying out again), the press reached no button and nothing happened. The panel now stays put while you hold a button in it and follows the page once you let go; the same holds for the 译 chip and the translation card in the reader. If the point the panel was opened on has left the book in the meantime, 发给主会话 now says 这一节已不在总纲里。 instead of doing nothing.
Not verified: the press was checked in Chromium only, with a test that grows the page under a held button; not in WebKit, on a touch screen, or by hand in DSH. Whether this was the cause of the dropped clicks seen in the hand-off browser test under CI load is not proven.
A change made in the main chat or the command line while you answer a question or save your reading place now shows up at once. Before, if another writer (the main chat, the command line, the desktop app's helper, or a background job) changed the library during one of these quick saves, StudyHub took that change for its own and did not refresh; you saw it only at the next periodic check or when you came back to the window. Your own answers and reading saves still do not make the page reload.
Not verified: checked with tests that write the library from outside during a save; not tried by hand in DSH or in the desktop app with a real main-chat edit.
The reader no longer jumps when a material takes a moment to open. While a material was being read, 正在打开资料… took a line above the quote and the text, the 目录 button and each page's 看原页 were missing, and in a wide window the 目录 column was not there yet. On a fast machine the jump came within half a second of the click; on a slow one it was easy to see. Now 正在打开资料… floats over the top of the text, 目录 and each 看原页 keep their place (hidden until they can be pressed), and in a wide window the 目录 column keeps its width, so nothing already on screen moves when the material comes. Before, when the material came:
that line went away, so the quote and the text moved up about 60 px;
the toolbar grew a few pixels;
every page grew a line for its 看原页;
in a wide window the text slid 272 px to the right.
Not verified: measured in the preview page (Chromium) at 1280 and 420 px, with the material's answer held back as on a slow machine. Not looked at inside DSH, in the desktop app or in WebKit. Some things still move when the material comes:
A material with no 目录 at all, opened in a wide window, gives its reserved column back.
The 错题 and 思维导图 buttons still appear in the toolbar, which moves the place line beside them.
The 看原页 inside a figure line and the one beside the quote still appear only then.
Tests, CI and agent tooling (no user-facing change). A test-quality audit tool (scripts/test-audit.mjs) with a non-blocking CI check was added, and rolling batches replaced weak source-grep and constant-echo assertions with behavioural tests. Tests no longer open a real browser, several timing races on slow runners were fixed, and CI now enforces zero ESLint warnings repo-wide plus TUI gates. Decision-moment agent skills and a hook were added and mirrored for Codex and Antigravity. Not verified: the hooks in agent hosts other than the one they were written in.
在带学的步骤检验里打字说「直接讲完」,现在会把剩余步骤一次讲完,而不是把这句话当答案批改。 跳过单步、直接讲完剩余要点本来就能用面板按钮和终端按键做到;缺的是这句话本身:「直接讲完」「剩下的直接讲给我听」「全部跳过」「skip all」「show the rest」及常见变体现在会结束带学并列出每一层剩余要点,不调用模型,这些步骤也不计入已掌握——与按按钮完全一致。句中恰好包含这些词的真实解释(较长的句子)仍照常批改;「跳过」「skip this step」这类单步说法仍然只跳过当前这一步。
检索与索引修复,命中和设置页数量更准确。 过长、无法作文件名的资料 id 会被哈希,修复「找不到文件」报错和编辑后残留旧内容;只需升级索引键格式的页面与已编辑页面分开统计,只有待升级页面的资料库不再显示为空;按前缀范围检索不再丢光命中;重新导入扫描文档不再被同步检查拦下。未验证:在真实大型资料库上重建索引。