Skip to content

Move the library below the curriculum and add the mascot helper - #93

Merged
jsshin2022 merged 2 commits into
mainfrom
library-helper
Nov 7, 2026
Merged

jsshin2022 merged 2 commits into
mainfrom
library-helper

Conversation

@jsshin2022

@jsshin2022 jsshin2022 commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

The library page and the hub section showed too much at once: size stats, three start cards, eight source buttons, kind chips and every item of every topic. This trims both and adds the team mascot as a helper visitors can type questions to.

Hub page

  • "자료실" now comes right after the curriculum, both on the page and on the nav line.
  • The section shows a search box and five topics per shelf, with "N개 더" linking to that shelf in the library.

Library page

  • Removed the stats row, the start cards, the source buttons and the kind chips. The ?src= and ?kind= links still work.
  • Each topic shows its first three items and "N개 더 보기". Counts in the tabs and the index still show the full totals.
  • At most three "먼저 알아 둘 용어" per topic.

Mascot helper (assets/js/helper.js)

  • Where: the mascot sits in the bottom-right corner of the hub, the library and article pages. On first visit only, it shows "궁금한 걸 물어보세요" for a few seconds.
  • Asking: clicking it opens a small panel with three suggested questions for that page and a text box.
  • Answers come from the library itself (topics.json and glossary.json), with at most three links:
    • "처음…", "입문…": the starting topic for causal inference, or for A/B testing when the question mentions experiments
    • a glossary term: the English term, the web book chapter that covers it, and its topic
    • a topic keyword: the topic's first two items and a link to the whole topic
    • nothing found: says so
  • Handing off to AI:
    • Every answer has "Claude에게 이어서 묻기", which opens claude.ai with a prepared Korean prompt. The prompt carries the question, the article title on article pages, and the library links the helper found.
    • "프롬프트 복사" copies the same prompt for any other AI chat.
  • Privacy: nothing typed is stored. The helper sends helper_ask with the first 100 characters, the match type and the page, so we can see which questions the library cannot answer yet. It also sends helper_open, helper_click and helper_handoff.
  • Accessibility:
    • The button has a label and aria-expanded. The panel is a labelled non-modal dialog, and answers are announced politely.
    • Esc closes the panel and returns focus to the button.
    • Enter sends; Shift+Enter adds a line.
    • Motion is off under reduced motion.
  • Image: the mascot is assets/img/mascot.webp (360px, 21 KB), cut out from the supplied sticker.

Checks

  • Tested at 1440 and 390, light and dark: no console errors and no sideways scroll.
  • axe finds nothing with the helper open on the library topics, the glossary and the hub section.
  • I tried eleven questions. Answers were checked for the 은/는 particle, and starting questions route to the right shelf. An off-topic question falls through to the AI handoff.
  • Existing hub scripts and check_data.py pass. One axe run on the events card flagged the header passport button in dark mode mid-scroll. It does not reproduce when run alone.

Generated by Claude Code

Fixes from a walkthrough (second commit)

  • Back button: jumping from a topic to a term or from a term to a topic now adds a history entry. Back and Forward return to the previous spot and restore the tab and scroll position. Before this, Back left the library.
  • Helper on phones: tapping a helper link to a spot on the same page closes the panel, so the reader sees where it went.
  • Mascot over links: pages with the helper get extra space under the footer, so the mascot never covers the last links on the page.
  • CSP for GA: GA4 also sends hits to https://www.google.com/g/collect. Every page's CSP blocked it, which logged a console error on each hit on the live site. connect-src and img-src now allow https://www.google.com on all pages and in the generated Builder pages.
  • Checks:
    • Walked through these flows on desktop and phone:
      • hub search to library results
      • "N개 더" to a shelf
      • expanding a topic
      • topic to term to topic, then Back, Back, Forward
      • search switching tabs
      • the level test sheet covering the helper
      • the helper on an article page
    • axe finds nothing, existing scripts pass, and nothing touches the mascot at the true page bottom.

Generated by Claude Code

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