docs(examples): add live overview page for all job types - #817
Merged
Conversation
Mirrors the starting page: one tabbed set covering every job type the SDK can create, with the rapids campaign preview swapping to match the selected tab, so a reader can try each modality without leaving the docs. Each preview is backed by a dedicated SDK-DOCS order that is created but never run, so it stays in preview state and collects no responses - the same setup as the four previews already embedded on the starting page. The selections are passed explicitly because compare, classify and ranking otherwise inherit a default validation set, which puts two unrelated qualification tasks in front of the one the tab is meant to show. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Co-Authored-By: lino <68745352+LinoGiger@users.noreply.github.com>
…hones Replaces the tabbed overview with one card per job type, each a real campaign you can try in place, with a link to the example behind it. Headings give the page a table of contents to jump between modalities. Seven live rapids apps is roughly 6 MB and 340 requests if they all boot at once, so `data-preview-lazy` holds each phone until it is nearly in view, and the boots are serialised: loading them in parallel means every phone requests the same rapids bundle before any of them has populated the HTTP cache, so the page pays for that bundle seven times over. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Co-Authored-By: lino <68745352+LinoGiger@users.noreply.github.com>
Rapid types with a text answer autofocus their input once the app boots. Focusing anything inside an iframe makes the browser scroll the parent document to reveal it, so the free text phone booting while still half off-screen threw the reader ~850px down the gallery and skipped the cards in between - once per visit, since the autofocus only happens on the frame's first load. Two changes, because neither is sufficient alone. Phones now wait until half visible before booting, which keeps any resulting lurch small; demanding near-full visibility instead was worse, leaving a scroll window only tens of pixels wide that a paging reader skips over, so the phone never booted at all. And since booting trails the reader's scroll by about a second, the phone can be off-screen again by the time focus lands - so the position is captured and put back. A cross-origin iframe fires no focusin on the parent; the only notification is a window blur, which arrives before the scroll. Corrections are skipped once the reader has pointed at that phone themselves, so tapping into the answer field still scrolls it into view the way they asked for. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Co-Authored-By: lino <68745352+LinoGiger@users.noreply.github.com>
LinoGiger
marked this pull request as ready for review
August 14, 2026 14:03
The cards are the only headings, so the contents list just restated the seven titles the reader is already scrolling past. Hiding it widens the content column, which left the two phone columns stretching apart, so the gallery is capped at the width of two phones and centred. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Co-Authored-By: lino <68745352+LinoGiger@users.noreply.github.com>
LinoGiger
approved these changes
Aug 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
docs/examples/index.md— an overview page on the Examples tab showing every job type the SDK can create as a scrollable gallery of live phones. Each card is a real campaign you can try in place, with a link to the example behind it for the code. The headings feed Material's table of contents, so the right rail jumps between modalities rather than making you scroll.Seven cards: Classification, Comparison, Locate, Draw, Select Words, Free Text, Ranking.
The page is wired into
navand into thellmstxt-mdExamples section.Load cost
Seven live rapids apps is not free, so this was measured rather than assumed. One phone is 43 requests / ~870 KB / ~0.6 s. All seven booting eagerly: ~340 requests, ~7.4 MB.
Two mitigations in
docs/js/preview-embed.js:data-preview-lazy— the iframe ships with nosrc; an IntersectionObserver fills it in 150 px before the phone enters view. First paint boots only the 2–4 phones actually on screen.load+ 500 ms, with a 3 s cap so a stalled phone can't block the queue) lets everyone after the first read it from cache.That's the floor for auto-playing embeds, since each phone is a full Next.js app. A click-to-load facade (static poster + "try it" overlay) would take first paint to near zero at the cost of one click before interaction — happy to switch if that trade reads better.
Both the existing embeds (starting page, quickstart) keep their current eager behaviour; lazy is opt-in per wrapper.
The preview campaigns
Each card points at a dedicated
SDK DOCS examples <type>order that is created but never run, so it stays inpreviewstate, collects no responses, and is never billed — the same setup as the four previews already on the starting page.selections=[LabelingSelection(amount=3)]is passed explicitly when creating them. Without it, compare / classify / ranking inherit a default validation set and the backend puts two unrelated qualification rapids (a red panda, a sentiment question) in front of the task the card is meant to demonstrate. Locate, draw, select words and free text have no default set and are unaffected.cmp_1SCZysSRxUHIJ5cmp_1SCZyXpfpHFbmdcmp_1SCZhvwq8dKVfQcmp_1SCZiFks5AUIMicmp_1SCZiZoHgeFf8tcmp_1SCZitM8vyAoTCcmp_1SCZzu6YH6ncAsWorth a look before merging: these are owned by
poseidon@rapidata.ai, whereas the four starting-page previews are owned bylino@rapidata.ai/org_1PHx4XH5QQEGY6. They render fine (the preview endpoint is public), but if that service account is ever cleaned up the previews go with it. Say the word and I'll recreate them under the same account as the existing ones.Verified
uv run --group docs mkdocs buildclean (no new warnings)The first commit on this branch is the earlier tabbed-set version, kept in history for comparison.
🔗 Session: https://poseidon.rapidata.internal/chat/session-52146939
🤖 Generated with Claude Code