feat(docs): redesign hero with llm copy block and extracted features#213
feat(docs): redesign hero with llm copy block and extracted features#213
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR enhances the documentation's hero component with a "Copy prompt" feature that fetches from Changes
Sequence DiagramsequenceDiagram
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
💡 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".
| let threeScene: ThreeSceneReturn | null = null | ||
| let scrollTicking = false | ||
| let scrollRafId: number | null = null | ||
|
|
There was a problem hiding this comment.
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 👍 / 👎.
| let text = await readFile(file, 'utf8'); | ||
| text = text.replaceAll('](/', '](https://bbopen.github.io/tywrap/'); |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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
📒 Files selected for processing (4)
docs/.vitepress/theme/components/Hero3D.vuedocs/index.mddocs/public/llms-full.txtscripts/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
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.