Skip to content

feat(tui): show periods, progress, and the next session in class details - #112

Merged
m1ngsama merged 1 commit into
mainfrom
feat/class-detail
Nov 18, 2026
Merged

m1ngsama merged 1 commit into
mainfrom
feat/class-detail

Conversation

@m1ngsama

Copy link
Copy Markdown
Member

A class detail page showed only the time, room, teacher, and a raw week list, so it could not answer what students open it for: when is the next one, and how many are left.

The page now reads like this, from a real timetable:

西方财务会计

时间   周四 08:00–09:35  ·  第 1–2 节  ·  95 分钟
地点   SF104
教师   楚雪
周次   1、2、4–6、8–17  ·  现在第 10 周
       ■ ■ · ■ ■ ■ · ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ·
进度   已上 7 次,还剩 9 次
下次   明天 08:00  ·  21 小时 58 分钟后
另有   周一 08:00–09:35  ·  第 18 周
  • Week lists collapse runs of three or more weeks, so "1, 3, 5, 6, 7, … 17" becomes "1、3、5–17".
  • The strip marks each teaching week: past weeks dim, the current week highlighted, weeks without this class as dots. Terminals too narrow for it leave it out.
  • Progress and the next session count every slot of the course, so a course that meets twice a week, or has a make-up week, reports one total.
  • "下次" shows "正在上课,还剩 20 分钟" during the class and "本学期已结课" once the course is over.
  • "另有" lists the course's other weekly slots.
  • In narrow terminals, values break between the · segments rather than inside "21 小时 58 分钟后".

Validation: npm run check passes, and the full test suite also passes with TZ=America/Los_Angeles. I opened the detail pages for three courses of the cached timetable in a pseudoterminal at 100 and 44 columns.

@m1ngsama
m1ngsama merged commit ff2ccfe into main Nov 18, 2026
4 checks passed
@m1ngsama
m1ngsama deleted the feat/class-detail branch November 18, 2026 06:26
@m1ngsama m1ngsama mentioned this pull request Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant