Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

Wrap demo GIFs in styled figures for mobile responsiveness

Maximilian Roos3f1adc9ea450
diff --git a/docs/content/select.md b/docs/content/select.md
index c632e930c..16e650958 100644
--- a/docs/content/select.md
+++ b/docs/content/select.md
@@ -10,7 +10,9 @@ group = "Commands"
Interactive worktree picker with live preview. Navigate worktrees with keyboard shortcuts and press Enter to switch.
-![wt select demo](/assets/wt-select.gif)
+<figure class="demo">
+<img src="/assets/wt-select.gif" alt="wt select demo">
+</figure>
## Examples
diff --git a/docs/content/why-worktrunk.md b/docs/content/why-worktrunk.md
index b90d19232..5cf60222d 100644
--- a/docs/content/why-worktrunk.md
+++ b/docs/content/why-worktrunk.md
@@ -7,7 +7,7 @@ Worktrunk is a CLI for git worktree management, designed for parallel AI agent w
## Quick demo
-<figure>
+<figure class="demo">
<img src="/assets/wt-demo.gif" alt="Worktrunk demo showing wt list, wt switch, and wt merge">
<figcaption>Listing worktrees, creating one, working, merging back</figcaption>
</figure>
diff --git a/docs/sass/custom.scss b/docs/sass/custom.scss
index 7af50c1bf..41b3c73ed 100644
--- a/docs/sass/custom.scss
+++ b/docs/sass/custom.scss
@@ -299,6 +299,16 @@ main {
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
}
+// Demo GIFs - shrink to min-width, then horizontal scroll
+.content figure.demo {
+ overflow-x: auto;
+ -webkit-overflow-scrolling: touch;
+
+ img {
+ min-width: 800px; // Shrink until readable, then scroll
+ }
+}
+
// Tighten spacing between paragraphs and code blocks
.content p + pre,
.content p + .terminal,
@@ -1230,7 +1240,7 @@ header nav .nav-item {
// Code block hover glow - enhance the existing shadow
.content pre {
- transition: box-shadow 100ms ease;
+ transition: box-shadow 50ms;
&:hover {
box-shadow: 0 0 0 1px var(--wt-color-accent-soft),
diff --git a/src/main.rs b/src/main.rs
index 04a5f94d5..c6ee4bb00 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -300,8 +300,8 @@ fn colorize_ci_status_for_html(text: &str) -> String {
/// Expand demo GIF placeholders for web docs.
///
-/// Transforms `<!-- demo: filename.gif -->` into `![wt command demo](/assets/filename.gif)`.
-/// The HTML comment is invisible in terminal --help output, but expands to a markdown image
+/// Transforms `<!-- demo: filename.gif -->` into an HTML figure with the `demo` class.
+/// The HTML comment is invisible in terminal --help output, but expands to a styled figure
/// for web docs generated via --help-page.
fn expand_demo_placeholders(text: &str) -> String {
const PREFIX: &str = "<!-- demo: ";
@@ -314,7 +314,10 @@ fn expand_demo_placeholders(text: &str) -> String {
let filename = &result[after_prefix..after_prefix + end_offset];
// Extract command name from filename (e.g., "wt-select.gif" -> "wt select")
let alt_text = filename.trim_end_matches(".gif").replace('-', " ");
- let replacement = format!("![{alt_text} demo](/assets/{filename})");
+ // Use figure.demo class for proper mobile styling (no shrink, horizontal scroll)
+ let replacement = format!(
+ "<figure class=\"demo\">\n<img src=\"/assets/{filename}\" alt=\"{alt_text} demo\">\n</figure>"
+ );
let end = after_prefix + end_offset + SUFFIX.len();
result.replace_range(start..end, &replacement);
} else {