-
Notifications
You must be signed in to change notification settings - Fork 39
docs: add a setup-path selector to the getting-started guides #743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rashadism
wants to merge
1
commit into
openchoreo:main
Choose a base branch
from
rashadism:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| import React, { createContext, useContext, useEffect, useRef, useState } from "react"; | ||
| import styles from "./styles.module.css"; | ||
|
|
||
| // Split switch for the install pages. Both panels stay in the DOM and toggle | ||
| // via `hidden` (not unmounted) so the manual guide stays crawlable. | ||
|
|
||
| type Choice = "agent" | "manual"; | ||
|
|
||
| const SwitchCtx = createContext<{ sel: Choice; setSel: (s: Choice) => void }>({ | ||
| sel: "agent", | ||
| setSel: () => {}, | ||
| }); | ||
|
|
||
| export function SetupSwitch({ children }: { children: React.ReactNode }) { | ||
| const [sel, setSel] = useState<Choice>("agent"); | ||
|
|
||
| // Expose the active pane on <html> so the page TOC (rendered outside this | ||
| // component) can hide the manual headings while the agent panel is showing. | ||
| useEffect(() => { | ||
| const root = document.documentElement; | ||
| root.setAttribute("data-setup-pane", sel); | ||
| return () => root.removeAttribute("data-setup-pane"); | ||
| }, [sel]); | ||
|
|
||
| return ( | ||
| <SwitchCtx.Provider value={{ sel, setSel }}> | ||
| <div className={styles.band} role="tablist"> | ||
| <button | ||
| type="button" | ||
| className={styles.half} | ||
| role="tab" | ||
| aria-selected={sel === "agent"} | ||
| onClick={() => setSel("agent")} | ||
| > | ||
| <span className={styles.title}>Set this up with your agent</span> | ||
| <span className={styles.desc}>Install the skill and paste one prompt into Claude Code, Codex, Cursor, or any coding agent.</span> | ||
| </button> | ||
| <button | ||
| type="button" | ||
| className={styles.half} | ||
| role="tab" | ||
| aria-selected={sel === "manual"} | ||
| onClick={() => setSel("manual")} | ||
| > | ||
| <span className={styles.title}>Set this up manually</span> | ||
| <span className={styles.desc}>Install each plane yourself, step by step, and learn what every piece does and how it fits together.</span> | ||
| </button> | ||
| </div> | ||
| {children} | ||
| </SwitchCtx.Provider> | ||
| ); | ||
| } | ||
|
|
||
| export function SetupAgent({ children }: { children: React.ReactNode }) { | ||
| const { sel } = useContext(SwitchCtx); | ||
| return <div hidden={sel !== "agent"}>{children}</div>; | ||
| } | ||
|
|
||
| export function SetupManual({ children }: { children: React.ReactNode }) { | ||
| const { sel, setSel } = useContext(SwitchCtx); | ||
| const ref = useRef<HTMLDivElement>(null); | ||
| const pendingId = useRef<string | null>(null); | ||
|
|
||
| // A deep link or TOC click to a manual heading should reveal this panel. | ||
| useEffect(() => { | ||
| const reveal = () => { | ||
| const id = decodeURIComponent(window.location.hash.slice(1)); | ||
| if (!id || !ref.current) return; | ||
| const target = document.getElementById(id); | ||
| if (target && ref.current.hidden && ref.current.contains(target)) { | ||
| pendingId.current = id; | ||
| setSel("manual"); | ||
| } | ||
| }; | ||
| reveal(); | ||
| window.addEventListener("hashchange", reveal); | ||
| return () => window.removeEventListener("hashchange", reveal); | ||
| }, [setSel]); | ||
|
|
||
| useEffect(() => { | ||
| if (sel === "manual" && pendingId.current) { | ||
| const target = document.getElementById(pendingId.current); | ||
| pendingId.current = null; | ||
| if (target) target.scrollIntoView(); | ||
| } | ||
| }, [sel]); | ||
|
|
||
| return ( | ||
| <div ref={ref} hidden={sel !== "manual"}> | ||
| {children} | ||
| </div> | ||
| ); | ||
| } | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: openchoreo/openchoreo.github.io
Length of output: 5213
🏁 Script executed:
Repository: openchoreo/openchoreo.github.io
Length of output: 4447
Finish the tab semantics or use plain buttons. The controls are marked as
tabs, but the panels aren’t wired witharia-controls/id,role="tabpanel", or rovingtabIndex, so this reads as an incomplete tabs pattern to assistive tech. Either implement the full contract or drop the tab roles and keep it as a simple toggle.🤖 Prompt for AI Agents