Skip to content

feat(docs): redesign hero with llm copy block and extracted features#213

Merged
bbopen merged 3 commits intomainfrom
feat/hero-copy-block
Mar 22, 2026
Merged

feat(docs): redesign hero with llm copy block and extracted features#213
bbopen merged 3 commits intomainfrom
feat/hero-copy-block

Conversation

@bbopen
Copy link
Copy Markdown
Owner

@bbopen bbopen commented Mar 21, 2026

Replaces the Get Started button with a text-copy prompt container and migrates features from Markdown into the Hero3D layout. Fixes contrasts and creates a responsive UI for the copy block.

@github-actions github-actions Bot added area:docs Area: documentation area:ci Area: CI and automation labels Mar 21, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 21, 2026

Warning

Rate limit exceeded

@bbopen has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 18 minutes and 28 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: cfb14727-e989-46b1-8a36-3dd174a4512f

📥 Commits

Reviewing files that changed from the base of the PR and between 8a1c396 and ce56ad1.

📒 Files selected for processing (3)
  • docs/.vitepress/theme/components/Hero3D.vue
  • docs/public/llms-full.txt
  • scripts/generate-llms-full.mjs
📝 Walkthrough

Walkthrough

This PR enhances the documentation's hero component with a "Copy prompt" feature that fetches from llms-full.txt and copies to clipboard, adds a feature cards section to the hero, restructures the layout to be responsive with two columns, and updates the build script to transform relative documentation links into absolute URLs.

Changes

Cohort / File(s) Summary
Hero Component & Copy Prompt Feature
docs/.vitepress/theme/components/Hero3D.vue
Replaced call-to-action buttons with "Copy prompt" interaction. Implemented copyPrompt() function that fetches llms-full.txt, copies content to clipboard, and displays transient "Copied!" feedback. Added features data array with feature cards rendering via v-for and v-html. Restructured layout to two-column responsive design with updated padding/min-height. Removed previous button styling and desktop layout rules. Note: scrollRafId state is removed but still referenced in onScroll and onBeforeUnmount.
Documentation Content Updates
docs/index.md
Removed features section containing four feature entries (Full Type Safety, Multi-Runtime, Rich Data Types, Zero-Config CLI) with icons and descriptions.
Link Transformation
docs/public/llms-full.txt, scripts/generate-llms-full.mjs
Updated all documentation links to use absolute URLs (https://bbopen.github.io/tywrap/...) instead of relative paths. Build script now post-processes documentation files to transform relative markdown links (starting with ] to absolute URLs during generation.

Sequence Diagram

sequenceDiagram
    participant User
    participant Hero3D as Hero3D Component
    participant Network as Network/Fetch
    participant Clipboard as Clipboard API
    participant UI as Component State

    User->>Hero3D: Click "Copy prompt"
    activate Hero3D
    Hero3D->>Network: fetch('llms-full.txt')
    activate Network
    Network-->>Hero3D: Return file content
    deactivate Network
    
    Hero3D->>Clipboard: navigator.clipboard.writeText()
    activate Clipboard
    Clipboard-->>Hero3D: Success
    deactivate Clipboard
    
    Hero3D->>UI: Set copied = true
    Hero3D->>User: Display "Copied!" feedback
    
    Note over Hero3D: Wait 2 seconds
    Hero3D->>UI: Set copied = false
    deactivate Hero3D
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

documentation, enhancement, area:docs

Poem

🐰 A hero with features so bright,
Copy prompts with a click—what a sight!
Links now absolute, no paths to chase,
The docs take their rightful place!
Hop, hop, hop—onward we race! 🚀

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main changes: redesigning the hero component with a new LLM copy block feature and extracted features from markdown, which aligns with the changeset.
Description check ✅ Passed The description is directly related to the changeset, explaining the replacement of the Get Started button with a copy prompt container and migration of features to the Hero3D layout.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/hero-copy-block

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@coderabbitai coderabbitai Bot added documentation Improvements or additions to documentation enhancement New feature or request labels Mar 21, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8a1c396bad

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 8 to +10
let threeScene: ThreeSceneReturn | null = null
let scrollTicking = false
let scrollRafId: number | null = null

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restore the missing scrollRafId state

The declaration for scrollRafId was removed here, but onScroll() and onBeforeUnmount() still read and assign that variable later in this component. Since the repo's normal checks only lint/typecheck src and test, this can ship to the docs site and then throw ReferenceError: scrollRafId is not defined on the first homepage scroll or when navigating away, breaking the hero animation/cleanup path in production.

Useful? React with 👍 / 👎.

Comment thread scripts/generate-llms-full.mjs Outdated
Comment on lines +80 to +81
let text = await readFile(file, 'utf8');
text = text.replaceAll('](/', '](https://bbopen.github.io/tywrap/');
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Rewrite page-relative links when generating llms-full.txt

This replacement only handles root-relative markdown links, so llms-full.txt still contains page-relative links such as ./node, ./bun, and ./browser after regeneration (for example around docs/public/llms-full.txt:1044-1046 and :1722). Because this commit's new homepage CTA tells users/agents to consume llms-full.txt directly, those leftover relative links now resolve nowhere outside the original page context.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/.vitepress/theme/components/Hero3D.vue`:
- Around line 22-37: The pending copy timer can fire after the component is
unmounted; make copyTimeout nullable (e.g. initialize as null and type as number
| null), update copyPrompt to clear the timeout only if copyTimeout is not null
and then set copyTimeout = null after clearing, and add an onBeforeUnmount()
hook that clears the timer (if non-null) and sets copyTimeout = null; reference
the existing copied ref, copyTimeout variable, copyPrompt function, and add
onBeforeUnmount to perform the teardown.
- Around line 8-10: The component removed the declaration for scrollRafId but
still reads/writes it (causing TS errors and runtime ReferenceError) and also
never clears copyTimeout on unmount; restore a top-level declaration like
scrollRafId: number | null = null (or appropriate WindowAnimationFrameHandler
type) alongside scrollTicking, and in onBeforeUnmount() cancel any pending frame
with cancelAnimationFrame(scrollRafId) (and set scrollRafId = null) and clear
the copy timeout with clearTimeout(copyTimeout) (and set copyTimeout = null) so
both the RAF and the copy timeout cannot fire after unmount; update types to
match lang="ts" and ensure copied.value is not mutated after unmount.

In `@scripts/generate-llms-full.mjs`:
- Around line 80-81: The current replacement in scripts/generate-llms-full.mjs
uses text.replaceAll('](/', '](https://bbopen.github.io/tywrap/') and only
rewrites root-relative links; instead, parse and rewrite all non-anchor markdown
links in the loaded text using the source file path (variable file) as the base
so doc-relative links like ./node resolve correctly, and derive the canonical
site base from the shared VitePress/config value (import or read the config used
in docs/.vitepress/config.ts) rather than hardcoding
https://bbopen.github.io/tywrap/; update the code around readFile(file, 'utf8')
and the replaceAll usage to perform URL resolution per-link (using the source
file path and the site base) so every link is fully resolved.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: f8350ef8-f4b8-425d-ba65-4dd38c481167

📥 Commits

Reviewing files that changed from the base of the PR and between c977786 and 8a1c396.

📒 Files selected for processing (4)
  • docs/.vitepress/theme/components/Hero3D.vue
  • docs/index.md
  • docs/public/llms-full.txt
  • scripts/generate-llms-full.mjs
💤 Files with no reviewable changes (1)
  • docs/index.md
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: os (windows-latest)
🧰 Additional context used
🧠 Learnings (6)
📚 Learning: 2026-01-19T21:14:37.032Z
Learnt from: bbopen
Repo: bbopen/tywrap PR: 127
File: src/runtime/bridge-core.ts:375-385
Timestamp: 2026-01-19T21:14:37.032Z
Learning: In tywrap (src/runtime/bridge-core.ts and similar), environment variable parsing follows a tolerant/best-effort policy. For example, `TYWRAP_CODEC_MAX_BYTES=1024abc` should be accepted as 1024. Only reject clearly invalid values (non-numeric start or <=0). This avoids surprising failures from minor typos.

Applied to files:

  • docs/public/llms-full.txt
📚 Learning: 2026-01-19T21:49:05.612Z
Learnt from: bbopen
Repo: bbopen/tywrap PR: 127
File: runtime/python_bridge.py:99-123
Timestamp: 2026-01-19T21:49:05.612Z
Learning: In the tywrap repository, TYWRAP_REQUEST_MAX_BYTES uses strict integer parsing that rejects values with trailing characters (e.g., "1024abc"). This differs from TYWRAP_CODEC_MAX_BYTES, which uses tolerant/best-effort parsing that accepts numeric prefixes. The strict policy for REQUEST_MAX_BYTES ensures explicit integer values and consistent parse behavior across Node/Python implementations.

Applied to files:

  • docs/public/llms-full.txt
📚 Learning: 2026-03-17T05:27:14.946Z
Learnt from: CR
Repo: bbopen/tywrap PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-17T05:27:14.946Z
Learning: Set `TYWRAP_PERF_BUDGETS=1` to enable performance budget assertions in tests

Applied to files:

  • docs/public/llms-full.txt
📚 Learning: 2026-01-20T16:01:14.323Z
Learnt from: bbopen
Repo: bbopen/tywrap PR: 152
File: docs/adr/002-bridge-protocol.md:599-602
Timestamp: 2026-01-20T16:01:14.323Z
Learning: In `src/runtime/node-bridge.ts` (NodeBridge), a test message is sent to the Python subprocess to confirm the bridge is responsive before marking it as ready.

Applied to files:

  • docs/public/llms-full.txt
📚 Learning: 2026-01-20T16:01:14.323Z
Learnt from: bbopen
Repo: bbopen/tywrap PR: 152
File: docs/adr/002-bridge-protocol.md:599-602
Timestamp: 2026-01-20T16:01:14.323Z
Learning: In the tywrap repository, bridges currently use implicit ready detection: the first successful response from the Python subprocess proves the bridge is ready to handle requests.

Applied to files:

  • docs/public/llms-full.txt
📚 Learning: 2026-01-20T16:01:39.136Z
Learnt from: bbopen
Repo: bbopen/tywrap PR: 152
File: docs/adr/002-bridge-protocol.md:826-830
Timestamp: 2026-01-20T16:01:39.136Z
Learning: In the tywrap BridgeProtocol architecture (ADR-002), `HttpIO` (and other Transport implementations like `ProcessIO`, `PyodideIO`) implements only the `Transport` interface (methods: `send`, `isReady`, `dispose`). The `RuntimeExecution` interface methods (`call`, `instantiate`, `callMethod`, `disposeInstance`) are implemented by `BridgeProtocol`, which delegates to `Transport` instances. Transport implementations should not include RuntimeExecution methods.

Applied to files:

  • docs/public/llms-full.txt

Comment thread docs/.vitepress/theme/components/Hero3D.vue
Comment thread docs/.vitepress/theme/components/Hero3D.vue
Comment thread scripts/generate-llms-full.mjs Outdated
@bbopen bbopen merged commit 7875db3 into main Mar 22, 2026
20 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci Area: CI and automation area:docs Area: documentation documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants