Spaces:
Running
Running
Commit History
-
feat: images mode without a transcript needs no HH-MM-SS filenames
ClaudeWhen no transcript is uploaded there's no narration to align, so slide timestamps are pointless. Names now only matter when a transcript is present: * With a transcript: filenames must carry HH-MM-SS (unchanged) so narration lines up by time. * Without a transcript: build_frames_ordered_by_name sorts slides by natural filename order (slide2 before slide10) and assigns synthetic positions — no timestamp parsing, any names work. Such segments are marked "untimed": build_segments titles them "Slide N" (not "Segment N — 0:0N") and both the guide and editor templates suppress the start–end time label, which would otherwise show meaningless synthetic values. Threaded via PipelineInputs.untimed and a new Segment.untimed field. The /jobs/from-images endpoint picks the builder by whether a transcript was provided; images.html explains both cases. Tests: natural-sort ordering with no timestamps; untimed render omits meta-time and titles "Slide N"; the timed path still shows the label. …bbe4867
-
fix: security + bug findings from the new-feature audit
ClaudeAdversarial audit of the images-input and /edit features found four confirmed issues, all fixed: [HIGH bug] image_input.py timestamp regex fused a date/counter prefix onto the time. Delimiters were interchangeable, so "2024-01-15_00-05-30.png" parsed as 01:15:00 (the date's 01-15 fused with the time's leading 00), losing the real 00:05:30 — the slide landed ~70 min off, or the upload was rejected outright for a validly-named file. Now the two separators must be the SAME delimiter (backreference), so a mixed "-"/"_" date-time boundary can't match; matching runs inside a lookahead so overlapping candidates are all found, and the trailing in-range one wins. [HIGH security] /edit arbitrary server-file read via audio_filename path traversal. /edit renders untrusted JSON; the image guard required an inlined image_data_uri, but audio fell through to a disk read when audio_data_uri was null, and metadata_to_segment did Path(frames_dir)/audio_filename with no sanitisation — "../../../../etc/p…1ca1018 -
feat: self-contained edits export + /edit page to reopen a shared JSON
ClaudeMakes the editor's JSON export a true handoff artifact: one file that someone else can open and keep editing, with no accompanying images and no live job. Self-contained export (review.html): * readState now embeds each segment's current image as a data URI (and audio when inlined), so "Save edits (JSON)" carries the slides, not just references to them. The primary <img> src is already a data URI in review mode (even after alt-switching), so it's captured verbatim; a non-data src is omitted rather than saved broken. * downloadZIP strips those embedded URIs before POSTing (it sends images separately + keeps audio server-side) so the ZIP request doesn't carry the image bytes twice. * applyState restores the <img> from image_data_uri when a self-contained JSON is loaded into a live editor, so a file from another session shows the right slides. Data model (metadata.py, html_gen.py): * SegmentMetadata gains optional image_data_uri / audio_data_uri; migration + round-trip…89cae6c
-
fix: persist and honor per-element include toggles (bug audit cluster 1+2)
ClaudeAdversarial bug audit found the per-element include toggles (added this week) were DOM-only state that neither survived Save/Load JSON nor was honored by the server-side render path (Download ZIP, CLI --metadata). Result: a user who curated which blocks carry over got a ZIP that contradicted Download final HTML, and Save→reopen→Load silently reset every toggle to defaults. Also fixes an a11y regression where a duplicate contenteditable-strip made the ARIA-cleanup pass dead code. Persistence (review.html): * readState now serializes alt_text_included, on_screen_text_included, transcript_included, audio_included (description_included already existed), plus page lang and meta_lines (were dropped, resetting a non-English guide to lang=en and losing header metadata on ZIP re-render). * applyState restores all five per-element flags and lang via a shared applyElementInclude helper; a Load JSON refreshes the bulk-toggle indicators. * Description read/write now uses innerText (not…9a3cbf9
-
editor: Download Markdown — semantic .md export
ClaudeAdds a "Download Markdown" button to the editor toolbar that produces a single self-contained .md file from the current editor state. Mirrors "Download final HTML"'s contract: same per-element include toggles, same description-replaces-alt rule, no server round-trip. Output is semantic markdown (no raw HTML hacks): * # for the page title, ## per section, --- between sections * Eyebrow as *italic*, subtitle as plain paragraph * Timestamps as *italic* sub-line under each heading * Image as  — alt is empty when a scene description is present (matches the published-HTML behaviour) or when the alt-text include checkbox is off * Scene description as plain paragraphs (blank-line separated) * On-screen text as a labelled blockquote (>) when its include toggle is on * Transcript as plain paragraphs when its include toggle is on * Math equations as $…$ (inline) or $$…$$ (block), GitHub-flavoured Markdown compatible Audio is intentionally skipped — markdo…e363538
-
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: drop the 'Include section' bulk toggle
ClaudeA global toggle for the per-section master include switch doesn't read as a meaningful bulk action — flipping it either does nothing (every section already included) or empties the published guide. Remove it from the bulk bar; the per-section checkbox stays. The bulk bar now only carries toggles for things that make sense to apply uniformly across all sections: Scene description, Alt-text, On-screen text, Transcript, Audio. https://claude.ai/code/session_01EM8jiYxdVFy1w3LeJ9GBJg007ae3b -
editor: bulk include toggles that drive every section at once
ClaudeAdds a "Apply to all sections" bar between the toolbar and the document header. One checkbox per include key — Whole section, Scene description, Alt-text, On-screen text, Transcript, Audio. Three behaviours: * Standard tri-state. The bar reflects the union of per-section state on page load: all-checked, all-unchecked, or indeterminate when sections disagree. * Bulk → per-section. Toggling a bulk box sets every matching per-section checkbox to the bulk's new state and dispatches a synthesised 'change' event on each, so the existing per-section sync (data-include, data-included, data-include-alt-text) fires for free. No duplicated wiring. * Per-section → bulk. Any individual checkbox change re-runs the union calculation so the bulk indicator stays accurate. Applies after Load JSON too (applyState calls syncBulkToggles when it finishes mutating per-section state). A bulk box for a key with zero matching per-section checkboxes (e.g. Audio when no segment carries an au…93e4afe -
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: stop emitting the alt-review figcaption when description carries the meaning
ClaudeTwo paths were leaking the "Alt-text needs author review." caption into the final HTML even when it no longer applied: * review.html rendered the figcaption purely on `seg.alt_text_reviewed`, so a segment with a populated description (alt is intentionally empty, not pending) still got the warning. Add `not seg.description` to the conditional so the editor view and the server-side review render both stay quiet in that case. * buildFinalHTML blanked the <img alt> when a description was present but never touched the figcaption next to it. Now the same per-section pass also strips figure.figure > figcaption when either (a) the description is present-and-included, or (b) the user edited alt-text in this session (data-alt-reviewed flipped to 'true'). Both cases mean the "needs review" note is stale. Adds a regression test confirming the caption disappears once `seg.description` is set, regardless of `alt_text_reviewed`. https://claude.ai/code/session_01EM8jiYxdVFy1w3LeJ…9eb147c
-
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 -
editor: long-form image description field (round 2)
ClaudeAdds the "Detailed description" field the accessibility team asked for — an editable open paragraph rendered UNDER the slide image that doubles as the long-form image description. When non-empty AND included in the published guide, the <img alt> drops to "" and the image is marked role="presentation": the description carries the meaning in body text where sighted AND non-sighted readers both encounter it, so there's no need to duplicate it inside an alt attribute that only screen readers hear. The pieces: * SegmentMetadata + Segment + migration gain description / description_ reviewed fields. Round-trips through Save/Load JSON. * New LLMToggles.description toggle. _FIELD_PROMPTS adds a description prompt that follows the team's example ("A gallery of purple flower stem macro photographs is shown. These demonstrate..."), and the structured-output schema gains a matching description field that only fires when the toggle is on (no wasted output tokens otherwise). * Orchestra…cf53b59 -
editor: accessibility-team UX pass (round 1)
ClaudeRound-one feedback from the accessibility team, focused on changes that don't alter the data model or remove fields: * Banner trimmed — three sentences down to one. * Segment image moved above the editable fields so the editor sees what they're describing before they describe it. * Alt-text field is now a multi-row textarea, not a single-line input. Some descriptions take two paragraphs and the old input made that impossible without scrolling a clipped one-liner. * New per-element "Include in published guide" fieldset replaces the single per-section checkbox. The whole-section checkbox stays. Two new checkboxes: - On-screen text from video (defaults to included) - Narration audio clip (defaults to EXCLUDED — per the team, audio shouldn't carry over to the published guide by default) Each checkbox drives data-include on a matching [data-element=…] node; buildFinalHTML now strips anything still flagged false, plus the data-include / data-element attributes …3672e55
-
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 -
Cleaner study-guide output: drop redundant per-section key-term list
ClaudeUser feedback: with inline term highlighting AND a bottom glossary, showing the same vocabulary again as a per-section <dl class="key-term"> was triple-redundant and visually noisy. - Drop the per-section <dl class="key-term"> from guide.html. Definitions remain accessible two ways: - inline via the .kt highlighter (hover tooltip on the first occurrence in each paragraph) - at the end of the document via the auto-built glossary (alphabetised, back-anchored to source section). - Mirror in buildFinalHTML so downloaded HTML matches. - Update test_render_guide_renders_key_terms_and_equations to expect the glossary instead of the per-section list. Also cleaned up two other visually-noisy bits while in the same file: - Figure's "Lecture slide." caption: redundant with the section heading + meta-time line and the figure-internal timestamp badge. Now we only emit a figcaption when there's something real to say ("Alt-text needs author r…8fb4d34 -
Update test_html_gen.py
12caec6 -
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
-
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
-
Consolidate zip assets under static/
ClaudePreviously the zip put images in static/ but audio in a separate audio/ folder. Now everything lives in one static/ directory: scene_*.jpg frames and segment_*.mp3 clips share the namespace (different filename prefixes prevent collisions) and the bundle has a clean two-entry layout: study-guide.html static/ scene_0000.jpg scene_0001.jpg segment_0000.mp3 segment_0001.mp3 Changes: - bundle_zip writes audio_paths under static_dir_name (was audio_dir_name). - guide.html template emits {{image_dir}}/<filename> for both image and audio src, so a renamed image_dir flows through to audio too. - Orchestrator slices audio into inputs.frames_dir directly instead of a sibling audio/ dir, so freshly-built export-metadata bundles have audio in the same place metadata_to_segment expects. - main.py's worker reads audio bytes from result.audio_paths directly, no longer guessing the on-disk layout. - metadata_to_segment looks in frames_…f2b292d -
Fix CLI audio output: inline for single, bundle for zip, schema round-trip
Clauderun_pipeline already slices per-segment audio and sets seg.audio_filename, and guide.html emits src="audio/..." when that field is present. But the CLI's build command never inlined audio for --format single nor passed result.audio_paths to bundle_zip() for --format zip — so: - 'vgm build --format single' produced HTML referencing audio/segment_0001.mp3 paths that didn't exist next to it, breaking the 'self-contained HTML' contract. - 'vgm build --format zip' produced a zip with the HTML but no audio/ folder, so the audio references 404'd on extraction. - 'vgm render-from-metadata' had no audio_filename in the metadata schema at all; round-tripping a previously-built guide silently lost the audio entirely. Fixes: - SegmentMetadata gains audio_filename + migration default. The save/load round-trip now preserves it (test guard). - metadata_to_segment loads audio from <frames_dir.parent>/audio/<fn> when inline_images=True (so render-from-metadata -…c4e5c07 -
Live progress bar (web SSE + CLI rich) and rename images dir to 'static'
ClaudePipeline progress ----------------- orchestrator.run_pipeline now accepts an optional ProgressCallback and emits ProgressEvent(percent, stage, message) at each major phase: scene_detect, filter, transcript, ocr (per-frame), render, done. Errors emit a final 'error' event so consumers always see a terminal state. Web UI ------ New POST /jobs spawns the pipeline in a background thread, returns {job_id, events_url, result_url} (HTTP 202). GET /events/{job_id} streams Server-Sent Events with progress payloads. GET /result/{job_id} hands back the prepared HTML or zip. The upload page (templates/index.html) now intercepts the form submit, hides the form, shows a <progress> element with stage chip + message, subscribes via EventSource, and on 'done' either navigates to the review HTML (review mode) or kicks off a download (single/zip). The original synchronous /process endpoint is kept for non-browser clients. CLI --- `vgm build` and `vgm export-metadata` now display a rich progress bar (…4b79268 -
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 -
Add browser-based review/edit step
ClaudeNew format=review (now the default) returns a self-contained HTML page with inline images, an editor toolbar, and per-segment controls for section title, alt text, narration, OCR text, and an include toggle. The editor is fully client-side: edits stay in the DOM, "Save edits" exports a JSON metadata file (per-segment section_title, alt_text, narration, ocr_text, include), "Load edits" reapplies a saved file, and "Download final HTML" snapshots a clean copy with editor chrome stripped, excluded segments removed, and the TOC renumbered. Inspired by the two-pass JSON workflow in maryjoanz/video_to_studyguide, but with the review step inlined into the browser so the metadata file is optional rather than a required intermediate. https://claude.ai/code/session_01G3XpEehfr9DnX9L7BahQ4L81fca62 -
Build initial VideoGuideMaker MVP
ClaudeFastAPI web app that turns an instructional video plus VTT/SRT transcript into a WCAG 2.2 AA-ready HTML study guide. Pipeline: PySceneDetect + OpenCV for scene detection and frame sampling, Haar-cascade face detection to drop talking-head frames, Tesseract OCR for on-screen text, timestamp-based narration alignment, Jinja2 template with proper landmarks, headings, lang, skip link, time elements, and data-alt-draft="true" flags on auto-drafted alt-text. Output is either a self-contained HTML file (base64-inlined images) or a zip bundle (HTML + images/ folder). Includes unit tests for the transcript parser and HTML generator. https://claude.ai/code/session_01Q9yxSTNAMqkjcYLDJAbV3Zb6f361a