Repository navigation
Export html deck - #64
razodin137 wants to merge 26 commits into
Conversation
Every slide renders as WebP inlined into one navigable file: arrows, click, swipe, counter, and #N deep links. hype export deck.html, the --html flag, and Export as HTML (Ctrl+Alt+E) in the editor. Co-Authored-By: Claude Code <noreply@anthropic.com>
The desktop identity follows the binary's name, so the fork installs beside an installed hype with its own entry and icon, Writecam-style. Co-Authored-By: Claude Code <noreply@anthropic.com>
The HTML folder export passes no filename patterns to the portal file chooser, since a folder has no extension to filter on. The chooser still sent the resulting empty filter as "filters" and "current_filter", and the portal rejects a filter with no rules outright, failing the whole SaveFile call with "invalid filter: no filters". Send no filter options at all in that case. Co-Authored-By: Claude Code <noreply@anthropic.com>
[Medium impact] The changes reach Hype's export and slide-presentation workflows. Do not merge until copied files are checked, media names stay distinct, and embedded Markdown cannot swallow the deck script. Findings
SummaryAdds self-contained HTML decks, editable HTML folders, and shared slide transitions for the app and browser.
Three issues need attention: folder exports can share private local files, duplicate media names can lose pictures, and some valid code examples leave exported decks blank.
|
Media from outside the deck's folder is copied into images/ or videos/ when the editable HTML folder is exported, but the embedded Markdown kept the author's path. An absolute path still resolved on the author's machine and failed everywhere else, so a shared folder showed missing pictures and videos. Rewrite those references, posters included, to the paths the copies take; code and comments keep their text. Also render svg blocks as data-URL images rather than page markup, so a shared deck's drawing cannot run script or restyle the page, and require a table's delimiter row before treating a pipe line as a table. Co-Authored-By: Claude Code <noreply@anthropic.com>
Transitions are one GLSL ES 1.00 fragment body each, defining vec4 transition(vec2 uv) over fromTex and toTex with a progress uniform. The registry prepends the shared simplex-noise, hash and cosine-palette helpers, wraps a body for Qt Quick's ShaderEffect, and publishes every body as compact JSON for the HTML exports' WebGL renderer. The bodies avoid ES 3.00 features, so the identical source runs in both places. The first library is crossfade, dissolve, liquid and glitch, with "none" as the default no-op. Wiring them into the editor and the exports comes next. Co-Authored-By: Claude Code <noreply@anthropic.com>
A deck's front matter chooses the default transition and its duration; a slide's hype: directive overrides them. The model exposes both, writes the deck default through setScalar, and upserts a slide's directive through withSlideProperty, so every choice is undoable. The selected slide reports the transition it will play: its own valid choice, or the deck's. Co-Authored-By: Claude Code <noreply@anthropic.com>
hype_commands now runs test_deck_transitions alongside the render, svg and navigation suites.
A fenced example containing a hype: directive was read as the slide's real property, so code samples overrode the chosen transition and the writer could never win against them. Match properties in outsideCode, as the writer already does.
The note removal pass masked code across the whole presentation, so a backtick on one slide could pair with another slide's backtick and hide a private note in between from the removal. Scan each slide's range separately, matching how the editor reads notes.
A font or colour containing & or < produced invalid XML, so the drawing failed to decode and vanished from the browser deck. Escape attribute values before building the SVG, as the native renderer does.
Line cleanup removed a trailing backslash before code spans were parsed, so a backslash inside a span that crossed a line boundary was lost from the exported slide. Strip hard-break markers only outside code.
Cached textures captured the first frame, so leaving a playing video showed its old frame during the transition. Repaint the outgoing and incoming textures when a transition starts.
Every visited slide kept a full 1920x1080 canvas for the lifetime of the page. Keep only the slides a transition can need and repaint the rest on demand.
Advancing before an image loaded uploaded an empty canvas and never refreshed the texture, so the picture was missing for the whole animation. Check texture readiness and skip or defer until the media is painted.
The preview switched to the new slide before the transition frames were ready, so the new slide flashed, then the old one returned and faded again. Keep the outgoing render on screen until the shader starts.
test_deck_render was never added to hype_commands, so bin/test skipped the fitted-text and list checks even with Chromium installed.
The .scratch/split logs were committed by an older split-serial.sh that staged with a plain `git add -A`. The exclusion pathspec was added midway through that run, too late to affect a loop bash had already parsed, so all nine steps picked up their own transcript. They made up 12,276 of the 17,210 added lines on this branch and are agent transcripts rather than anything the feature needs. Untrack them and ignore the directory, along with .hype-backups, which the editor writes beside every presentation and which must never be committed. Co-Authored-By: Claude Code <noreply@anthropic.com>
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
99bad22 to
d764623
Compare
| const auto media = parseMedia(slide.source, base); | ||
| for (const auto &item : {qMakePair(media.path, media.video), qMakePair(media.poster, false)}) { | ||
| // A missing file is not a failure: the browser draws Hype's missing-media | ||
| // notice in its place, as the editor does. | ||
| if (item.first.isEmpty() || !QFile::exists(item.first)) | ||
| continue; | ||
| QString target = QDir(base).relativeFilePath(QFileInfo(item.first).absoluteFilePath()); | ||
| if (target.startsWith("..")) | ||
| target = (item.second ? "videos/" : "images/") + QFileInfo(item.first).fileName(); |
There was a problem hiding this comment.
Exports can include private files.
exportHtmlFolder copies any existing file named by a media or poster reference. parseMedia accepts arbitrary paths, and validateStructure checks slide boundaries, not file contents. A supplied deck referencing /home/alice/.ssh/id_rsa therefore bundles that file into the shared folder, even though the browser cannot display it.
Verify that copied files really are supported media, and require approval before including unrelated files outside the presentation folder.
How this was verified: Markdown paths pass through assetPath unchanged when absolute, then reach QFile::copy after only an existence check.
| QString target = QDir(base).relativeFilePath(QFileInfo(item.first).absoluteFilePath()); | ||
| if (target.startsWith("..")) | ||
| target = (item.second ? "videos/" : "images/") + QFileInfo(item.first).fileName(); | ||
| if (seen.contains(target)) | ||
| continue; | ||
| seen.insert(target); | ||
| copies.append({item.first, target}); | ||
| targets.insert(QFileInfo(item.first).absoluteFilePath(), target); |
There was a problem hiding this comment.
Duplicate names lose exported pictures. Two external files such as
/a/photo.png and /b/photo.png both get the destination images/photo.png. The second hits continue, so it is neither copied nor added to targets. Its Markdown keeps the original path, and the export reports success despite missing that picture when shared.
Give different source files unique destination names and record a mapping for each one. The same problem affects posters.
HTML Export. You don't have to merge my vibe coded slop but it works for me and consider it a feature request.