Spaces:
Sleeping
Sleeping
Commit History
-
a11y pass for accessibility expert review
ClaudeAudit-and-fix pass on the published-guide and editor templates before sending it for an external accessibility review (Rich Caloggero, MIT DSL). Published guide (guide.html / _doc_styles.html): * Drop role="presentation" from decorative <img alt="">. alt="" alone is the WAI-recommended decorative-image pattern; role="presentation" on <img> has spotty AT support — some readers ignore it, others still announce the image. Empty alt is sufficient and more reliable. * Drop the redundant aria-label on <details class="onscreen-text">. The <summary> is the accessible name; layering aria-label on top either overrides the visible summary (WCAG 2.5.3 Label in Name mismatch) or duplicates it. Remove. * Only emit audio aria-describedby="narration-N" when the narration block it points at is actually rendered. A dangling describedby is an ARIA validity bug (WCAG 4.1.2 / 1.3.1) and some screen readers silently swallow the relationship, leaving the audio undescribed. * Bump TOC link…5a2d8c8 -
editor: per-element alt-text and transcript toggles; rename 'Scene description'
ClaudeThree pieces of UX feedback: * Alt-text now has its own include checkbox in the per-section "Include in published guide" fieldset, default OFF. When off, buildFinalHTML blanks the <img alt> at download time. Because alt is an attribute (not a discrete element), the checkbox writes its state to data-include-alt-text on the section and buildFinalHTML reads it alongside the description-present check; the helper attribute is stripped from the final HTML. * Narration sections are now rendered as <details class="narration"> with summary "Transcript", collapsed by default — in both the editor view and the server-side render (guide.html). A matching per-element include checkbox sits in the fieldset, also default OFF, so transcripts no longer carry over to the published guide unless the editor explicitly opts in. The narration body keeps its stable id so any audio aria-describedby reference still resolves; when transcript is excluded the strip pass collects removed…0c2c651
-
editor: remove summary / key-terms / self-check (round 3)
ClaudeAccessibility team's round-three asks: * "Summary Field — redundant, remove" (now subsumed by the new detailed description paragraph from PR 2) * "Key Terms — REMOVE. This replicates the glossary." * "Self-check questions — REMOVE! This is an academic role and such questions are better placed in the platform." Scope of removal: * Editor (review.html): drops the summary <input>, the key-terms list editor block, the self-check-questions list editor block, the related CSS rules (.vgm-key-term-row, .vgm-self-check-row), the readState/applyState/syncBindings hooks, the makeKeyTermRow / makeSelfCheckRow row factories, the add-key-term / add-self-check click handlers, and the entire glossary/highlight injection inside buildFinalHTML. * Published guide (guide.html): drops the "In brief:" advance organizer, the self-check <details> block, the bottom glossary section, the highlight_terms filter usage on narration, and the build_glossary call at the top of <main>. * LLM (ll…b863381
-
Accessibility: term tooltips become real <a> links to glossary entries
ClaudeThe narration's inline highlighter wrapped each defined term in a <mark class="kt" title="…"> with the definition only in the title attribute. WCAG 2.5.1 / 4.1.2 — touch users can't trigger hover, keyboard users can't focus a <mark>, many screen readers skip the title attribute entirely. Definitions were effectively unavailable to roughly half of likely users. Build the glossary once at the top of <main> and pass it to the highlighter so each first-occurrence wrap becomes <a class="kt" href="#glossary-N" title="…">term</a> — focusable, touch-tappable, screen-reader announced as a link to the named target. The bottom glossary's <dt> ids match the hrefs the highlighter emits (build_glossary now stamps each entry with its own `id` field so server template and JS port share the contract). Terms with no glossary entry (defensive) fall back to the old <mark> shape. Mirror in buildFinalHTML: build the glossary entries before walking sections, thread the lookup through highlightTerms, reus…c28a145 -
Learner-focused features: summary, self-check, glossary, inline term highlighting
ClaudeTagged pre-learner-features at the commit before this so a single `git reset --hard pre-learner-features` (or non-destructive `git revert pre-learner-features..HEAD`) takes us back to known-good if anything misbehaves. Four learner-impact features ship together because they share data plumbing — same Segment/Metadata schema additions, same editor round-trip work: #2 One-sentence summary above each section. Claude's `summary` field from topic segmentation is now rendered as an "In brief:" advance organizer above the slide image. Primes the learner before they hit the detail; evidence-based for comprehension. Editable in the review screen. #4 Auto-built glossary at the end of the guide. Collects every segment's key_terms across the whole document, dedupes case- insensitively (first-occurrence wins), sorts alphabetically, and anchors each entry back to the section where the term was first introduced. #5 Inline key-term highlighting in narration. Defined terms w…d61b118
-
Fix bugs and security issues from post-a11y scan
ClaudeBugs: - _doc_styles.html: move @import to first line (was after :root, silently ignored by browsers — Merriweather/Source Sans 3 never loaded) - index.html: merge duplicate .vgm-scene-thumb rule; position:relative now lives in the main block so the ::after overlay always has a positioning context - index.html: add sandbox attribute to review iframe (allow-scripts allow-same-origin allow-downloads allow-forms) - index.html: reduce non-review format resetForRetry delay 2500→1500ms; focus is now returned sooner after download - review.html: makeKeyTermRow aria-label updates live as user types the term, matching the Jinja server-rendered row behaviour Security: - main.py: add HTTP security header middleware (X-Content-Type-Options, X-Frame-Options, Referrer-Policy, Content-Security-Policy) - llm_extract.py: scrub API key from exception messages before logging https://claude.ai/code/session_01EGBMur51izertyiu7msWPQ3964d02 -
WCAG 2.1 AA accessibility fixes across all templates
ClaudeContrast (1.4.3/1.4.11): - Banner secondary text: #ECBFC7 → #f5d5db (3.0:1 → 4.6:1 on #750014) - Subtle text color: #888 → #767676 (3.5:1 → 4.5:1 on #fafaf7) - Form input focus: restore outline:2px solid primary (was outline:none) - contenteditable outline: 1px dashed #D0D0D0 → 2px dashed #767676 Screen reader utilities (1.3.1/2.4.6): - Add .sr-only utility class to _doc_styles.html and index.html - Replace outdated left:-9999px sr-only h2 with proper .sr-only class Non-text content (1.1.1): - figcaption timestamp badge: aria-label → aria-hidden (was triple-announcing) - Equation figure: aria-label on wrapper → .sr-only figcaption (avoids overriding MathJax assistiveMml) - Deselected scenes: add diagonal stripe ::after so state isn't opacity-only Semantics / relationships (1.3.1): - Narration div: add aria-labelledby linking to label span (guide + review) - Key terms editor: add role="group" + aria-labelledby - Math equations editor: add role="group" + aria-labelledby - Key term i…b12bb48
-
Remove TL;DR view toggle from guide / review templates
ClaudeThe Full / TL;DR mode switch wasn't earning its complexity — TL;DR was the only alternate, and reviewers tended to either keep the full guide or skim it manually. Removing the toggle, its CSS, the mode-switch script, and the review-time injection that re-added them to downloaded guides. Net 127 lines deleted; no behavior change for the default Full view.0303a74 -
Accessibility audit fixes: gating drafts, removing role conflicts, etc.
ClaudeFollowing an audit pass, working through the remaining findings: B3 (alt-warning ships unconditionally on guide.html, advertising WCAG 1.1.1 non-conformance even when alt-text has been authored) → Segment now carries alt_text_reviewed: bool. Orchestrator flips it to True when LLM extraction supplies real alt text. Template gates the warning banner on any-segment-still-draft, gates the per-image data-alt-draft attribute on the segment's flag, and drops the '(needs human review)' figcaption suffix once it's no longer true. SegmentMetadata round-trips the field through save/load JSON so review-edited guides stay marked. B4 (draft alt text contained the meta-instruction 'Review and rewrite to convey purpose, not raw text' — screen readers read it aloud) → _draft_alt_from_ocr emits clean text only ('Slide text: …' / 'Lecture visual (alt text pending author review)'). The draft state is signalled ex…bfb97c5 -
Accessibility: target size, reduced motion, scroll padding, focus-after-skip
ClaudeThree pre-audit improvements I'm already confident about: - WCAG 2.5.8 (Target Size Minimum, Level AA): the View Full / TL;DR toggle buttons rendered at ~22px tall — under the 24px floor. Bumped to min-height 28px / min-width 44px with a hair more padding. - WCAG 2.3.3 (Animation from Interactions, Level AAA) and friends: added a global @media (prefers-reduced-motion: reduce) rule that collapses transition/animation durations to ~0 and disables smooth scrolling. Existing transitions are subtle (collapse markers, link underlines) but should still respect the OS pref. - WCAG 2.4.11 (Focus Not Obscured Minimum, Level AA): the sticky view-toggle bar can land focus targets underneath it when activating the skip link or a TOC anchor. Added scroll-padding-top: 3.25rem on <html> so the browser scrolls anchor targets clear of the sticky. - Skip-link target: <main id="main-content"> now has tabindex="-1" so focus consistently moves into the main region after the skip cl…583f6ac
-
Per-segment narration audio (Feature 5)
Claudeffmpeg slices each kept segment's [start, end) window from the source video into a 32 kbps mono MP3 (~500 KB per 2-min segment). Below 1.5s segments are skipped — too short to be useful. Failures are non-fatal: a segment without audio just doesn't render an <audio> element. ffmpeg-not-on-PATH skips the whole stage gracefully. Plumbing: app/pipeline/audio.py — slice_segment / slice_all helpers (subprocess ffmpeg, libmp3lame, 22 kHz mono, bounded timeout, stderr captured for warnings). PipelineInputs.extract_audio (default True) gates the stage. PipelineResult.audio_paths carries Path|None per segment. Segment.audio_filename / audio_data_uri reach the templates. Render paths: - zip: audio/ folder added to the bundle; templates use 'audio/{fn}'. - single: audio_data_uri inlined as base64 alongside images. - review: lazy-fetched via /audio/{job_id}/{filename} (mirrors the alts pattern). Editor download/previ…364bfae -
TL;DR view toggle in the published guide (Feature 6)
ClaudeAdds a Full/TL;DR toggle bar (sticky at the top of the rendered guide) that flips body[data-view='tldr']; CSS hides figures, narration, OCR details, timestamps, and the alt-warning in TL;DR mode while keeping the section heading + key terms + equations. Choice persists via localStorage so a learner who picks TL;DR keeps it across reloads. Both render paths get it: - Direct guide.html (CLI render-from-metadata, /single download) embeds the markup + script in the template. - Editor's buildFinalHTML strips all <script> tags during build, so the downloaded HTML re-injects the toggle bar after the skip link plus a minified IIFE script that wires it up.1896eac -
Phase C: MathJax equations, key terms, and subtitle/module
Claudeguide.html now renders seg.key_terms as <dl class="key-term"> and seg.math_equations as <figure class="equation" role="math"> with MathJax delimiters. The MathJax 3 CDN loader and tex-mml-chtml config are injected automatically when any segment has at least one equation. Header gains optional subtitle and module slots (module replaces eyebrow when supplied). review.html grows two per-segment list editors: - Key terms: term + definition rows with add/remove buttons - Math equations: LaTeX textarea, aria_label, label, caption, inline flag, and a live MathJax preview that retypesets on each keystroke Save edits (JSON) now stamps schema_version: 2 and emits key_terms + math_equations + subtitle + module fields. Load edits handles both v2 saves and v1 (legacy) saves via the migrate_v1_to_v2 path. Download final HTML reads the editor state, builds proper <dl>/<figure> elements in the cloned DOM, and injects the MathJax loader when any included segment has an equation. Verified: 33 pytes…6f7a34c -
Restyle guide/review templates after photosynthesis prototype
ClaudeRebuild guide.html and review.html on the visual structure of maryjoanz/video_to_studyguide/prototype_study_guide.html: doc-header banner with eyebrow + meta line, bordered TOC card with CSS-counter numbering, sections with section__heading auto-numbering, .figure cards with mono timestamp badges, .onscreen-text callout for OCR, narration label, and a quiet doc-footer. Shared CSS lives in _doc_styles.html so the editor view and final guide stay visually consistent. render_guide / render_review now accept eyebrow and meta_lines (defaults computed from segment count + total duration). The editor's selectors were updated for the section.section structure and verified end-to-end via the JSDOM harness; the downloaded final HTML retains every prototype-style class and the #750014 banner. https://claude.ai/code/session_01G3XpEehfr9DnX9L7BahQ4Ld9ecc7c