Skip to content

feat: collapsible section bands and a flat table treatment for INQUIRE listings - #7

Open
cjt-0627 wants to merge 3 commits into
sago-cream:mainfrom
cjt-0627:feat/inquire-collapsible-sections
Open

feat: collapsible section bands and a flat table treatment for INQUIRE listings#7
cjt-0627 wants to merge 3 commits into
sago-cream:mainfrom
cjt-0627:feat/inquire-collapsible-sections

Conversation

@cjt-0627

@cjt-0627 cjt-0627 commented Aug 15, 2026

Copy link
Copy Markdown

Depends on #6. Please merge that one first — this branch is built
on top of it.

What this changes

Two related improvements to INQUIRE listings, kept as separate commits.

1. Section bands become toggles

The general education listing puts every course of every section into a single
83-row table, so reaching a later section means scrolling past all the earlier
ones. Each section band now folds the rows underneath it, up to the next band.

2. Listings get a flat table treatment

CCXP renders listings with ridged borders and cellspacing, so a page reads as a
grid of boxes. Listings now use horizontal rules only, a more heavily
underlined column header row, alternating row shading and a hover tint.

This is scoped with table:has(tr.class1, tr.class2) so it only reaches real
listings. The same markup builds forms and page layout elsewhere — the entry
form on JH62f001.php, for one — and those tables need CCXP's original frame
to stay legible. Table widths are left alone for the same reason.

Trade-offs worth reviewing

  • :has() support (Chrome 105+, Firefox 121+). The alternative is tagging
    listing tables from sections.ts and selecting on a data attribute, which
    would make the styling commit depend on the feature commit. Happy to switch
    if the support floor matters.
  • Collapsed by default hides courses from Ctrl+F until a section is opened,
    and there is no persistence, so a reload collapses everything again. Both are
    easy to change if you would rather have it the other way.
  • Horizontal fit. The listing's min-content width is 927px, so it fits
    without sideways scrolling once the content area is about 930px — a 1280px
    window with the classic sidebar just clears it. Narrower windows still
    scroll. Forcing mid-word breaks would close the gap but shreds course codes
    (11510GEC 110301 breaks into four lines), so it was left out.

Testing

Five tests in test/main/main-sections.test.ts cover the collapse/expand round
trip, column header rows not being mistaken for bands, empty bands and empty
tables being hidden while populated ones are left alone, and the enhancement
being idempotent.

bun run check: typecheck, lint and format pass. Tests are 67 passed, 1
failed — test/inquire/inquire-captcha.test.ts already fails on a clean
checkout of main at 06daa52 and is unrelated to this PR.

Demo

Screenshot 2026-08-15 at 8 34 13 PM

cjt-0627 and others added 3 commits August 13, 2026 22:30
CCXP styles its section header rows through the .class1 rule in its own
stylesheet, which paints white text on a blue band. The main scope clears
that band along with every other table background, but none of the white
text rules can reach the row: they all match on a colour attribute or an
inline style, and .class1 sets the colour from a stylesheet instead. The
headings were left as white text on the white page.

Restore a muted band for those rows so the headings stay visible, for
example the 向度 groupings on the general education listing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Long listings such as the general education curriculum stack every course
of every section into one table, so reaching a later section means
scrolling past all of the earlier ones.

Turn each section band into a toggle that folds the rows underneath it,
up to the next band. CCXP reuses .class1 for column header rows too, so a
band is recognised by its structure instead: a row holding a single
spanning cell. The heading nodes move inside the button, which keeps the
heading text as the accessible name and leaves aria-expanded to carry the
state. Sections start collapsed and the state lasts for the page view.

A toggled row drops the restored band and reads as a heading with a rule
under it and a chevron at the end of the row. Sections that hold nothing
are dropped rather than shown: a band with no rows under it is hidden,
as is a table rendered without a single row, along with the heading
sitting directly above it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
CCXP renders every listing with ridged table borders and cellspacing, so
each page reads as a grid of boxed cells.

Collapse the frame down to horizontal rules: drop the table border, keep
the cells tight, underline the column header row more heavily than the
data rows, shade alternate rows, and tint a row on hover. Listings carry
a dozen columns, so the padding stays small and the header wraps rather
than pushing the page into a sideways scroll.

Only tables carrying CCXP's listing header rows are treated this way. The
same markup builds forms and page layout elsewhere, and those tables lean
on the original frame to stay legible. Table widths are left alone for
the same reason.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@cjt-0627 cjt-0627 changed the title Feat/inquire collapsible sections fix: keep CCXP section header rows readable Aug 15, 2026
@cjt-0627 cjt-0627 changed the title fix: keep CCXP section header rows readable feat: collapsible section bands and a flat table treatment for INQUIRE listings Aug 16, 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