Skip to content

Commit 5f11e1a

Browse files
karngyanclaude
andcommitted
Fix the build, and the review's findings
The gate caught a real dash, just not one of mine: main released 0.4.0 while this branch was open, and the audit-log entry it wrote into both CHANGELOG.md files carries an em-dash. CI builds the merge commit, so it saw a changelog my local build did not. Rebased onto main and spelled that entry's pause with a comma. From the review: Nested main landmarks. The docs layout opened a <main> around the column and another around the outlet. The inner one is an <article> now. Internal links reloaded the document. Everything on the site routes through md's A, and it rendered a plain anchor for every href, so moving between pages threw away the router and started again. App-relative hrefs go through TanStack's Link; mailto and off-site stay anchors. The command reference built a scroll box per usage line, forty of them down the page, each one hiding its tail from anyone not using a pointer. The usage wraps instead, indented under the command. "Every command takes --tab, --browser and --json" was not true: status, doctor, kill and help take none of them. Scoped to the commands that act on a page or a tab, in the README, on the homepage, in the getting started page, in the command reference, and in llms.txt. A blank line in a transcript is a space so the row keeps its height, and it is now aria-hidden rather than announced as spoken content. Not taken: the suggestion to rename browserId to --browser in the daemon's error messages. It is a fair point about naming, but those strings are CLI behaviour that tests assert on, and this branch only touched them to remove dashes. It belongs in its own change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 8fe9208 commit 5f11e1a

9 files changed

Lines changed: 50 additions & 21 deletions

File tree

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ reins click --ref e5 # act: by ref
5555
reins text # check: or reins screenshot, which prints an image path
5656
```
5757

58-
Every command takes `--tab <id>` (default: active tab), `--browser <id>` (only
59-
when several are connected), and `--json`. `reins help` is self-describing, and
58+
Shared flags, on the commands that act on a page or a tab: `--tab <id>`
59+
(default: active tab), `--browser <id>` (only when several are connected), and
60+
`--json` for raw output. `reins help` is self-describing, and
6061
`reins cdp` reaches the full Chrome DevTools Protocol when the curated commands
6162
are not enough.
6263

packages/cli/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
### Minor Changes
66

7-
- 65ce7f3: `reins audit` a per-action audit trail. The extension stamps each response with the resolved host, permission tier, and tab; the daemon writes one redacted JSONL line per action (policy denials included) to `~/.reins/logs/audit-YYYY-MM-DD.jsonl`, pruned after 30 days. Value-bearing params (typed text, fill values, eval code, CDP payloads) are redacted before anything reaches disk.
7+
- 65ce7f3: `reins audit`, a per-action audit trail. The extension stamps each response with the resolved host, permission tier, and tab; the daemon writes one redacted JSONL line per action (policy denials included) to `~/.reins/logs/audit-YYYY-MM-DD.jsonl`, pruned after 30 days. Value-bearing params (typed text, fill values, eval code, CDP payloads) are redacted before anything reaches disk.
88

99
## 0.3.0
1010

packages/extension/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
### Minor Changes
66

7-
- 65ce7f3: `reins audit` a per-action audit trail. The extension stamps each response with the resolved host, permission tier, and tab; the daemon writes one redacted JSONL line per action (policy denials included) to `~/.reins/logs/audit-YYYY-MM-DD.jsonl`, pruned after 30 days. Value-bearing params (typed text, fill values, eval code, CDP payloads) are redacted before anything reaches disk.
7+
- 65ce7f3: `reins audit`, a per-action audit trail. The extension stamps each response with the resolved host, permission tier, and tab; the daemon writes one redacted JSONL line per action (policy denials included) to `~/.reins/logs/audit-YYYY-MM-DD.jsonl`, pruned after 30 days. Value-bearing params (typed text, fill values, eval code, CDP payloads) are redacted before anything reaches disk.
88

99
## 0.3.0
1010

packages/web/public/llms.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Key facts:
99
- Core loop, in three beats. Look: `reins snapshot` lists interactive elements with refs. Act: `reins click --ref e7` or `reins type --ref e3 --text "…"`. Check: `reins text` or `reins screenshot`.
1010
- Site permissions: every site resolves to a tier, one of deny, read, or full. The extension enforces it. Grants happen only through a click in the extension popup, and the CLI can tighten the policy but never loosen it.
1111
- Security: the daemon binds 127.0.0.1 and validates the Host header. Only allowlisted chrome-extension:// origins may connect. Chrome shows its native debugging banner the whole time the extension is attached.
12-
- Limits: Chromium only, so no Firefox and no WebKit. No headless mode. Not built for CI. With two browsers connected, commands need `--browser <id>`, because reins never guesses which one you meant.
12+
- Limits: Chromium only, so no Firefox and no WebKit. No headless mode. Not built for CI. With two browsers connected, the commands that act on a page or a tab need `--browser <id>`, because reins never guesses which one you meant.
1313

1414
## Docs
1515

packages/web/src/components/md.tsx

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Link } from "@tanstack/react-router";
12
import type { ReactNode } from "react";
23
import { cn } from "@/lib/utils";
34

@@ -107,13 +108,30 @@ export function Ol({ children }: { children: ReactNode }) {
107108
);
108109
}
109110

111+
const LINK_CLASS = "underline underline-offset-4 hover:text-primary";
112+
113+
/**
114+
* Every link on the site.
115+
*
116+
* An app-relative href routes through TanStack's `Link`, so moving between
117+
* pages does not reload the document and lose the router. Everything else
118+
* (http, mailto, and any other scheme) is a plain anchor, and anything
119+
* off-site opens in its own tab.
120+
*/
110121
export function A({ href, children }: { href: string; children: ReactNode }) {
122+
if (href.startsWith("/")) {
123+
return (
124+
<Link to={href} className={LINK_CLASS}>
125+
{children}
126+
</Link>
127+
);
128+
}
111129
const external = href.startsWith("http");
112130
return (
113131
<a
114132
href={href}
115133
{...(external ? { target: "_blank", rel: "noreferrer" } : {})}
116-
className="underline underline-offset-4 hover:text-primary"
134+
className={LINK_CLASS}
117135
>
118136
{children}
119137
</a>
@@ -167,10 +185,12 @@ export function Shell({ lines }: { lines: string[] }) {
167185
// Lines repeat in a transcript (blank ones, at least), so the index
168186
// is the only key that is honest.
169187
// biome-ignore lint/suspicious/noArrayIndexKey: transcript lines are not unique
170-
<span key={i} className="block">
188+
<span key={i} className="block" {...(line === "" ? { "aria-hidden": true } : {})}>
171189
{line === "" ? (
172190
// An empty block has no height, so a blank line in the transcript
173-
// would vanish. A space under `whitespace-pre` keeps the line.
191+
// would vanish. A space under `whitespace-pre` keeps the line, and
192+
// the row is hidden from assistive tech so it is not announced as
193+
// a spoken space.
174194
" "
175195
) : line.startsWith("$") ? (
176196
<>

packages/web/src/routes/docs/commands.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,10 @@ const GROUPS: Array<{ id: string; title: string; intro?: string; rows: [string,
161161
function Command({ usage, summary }: { usage: string; summary: string }) {
162162
return (
163163
<div className={cn(TEXT, "mt-5 max-w-[68ch]")}>
164-
<p className="overflow-x-auto whitespace-pre">{usage}</p>
164+
{/* Wraps rather than scrolls. A scroll box per command would be forty
165+
keyboard stops down the page, and a long flag list is still legible
166+
broken across lines when the wrap is indented under the command. */}
167+
<p className="whitespace-pre-wrap [text-indent:-2ch] pl-[2ch]">{usage}</p>
165168
<p className="text-pretty text-muted-foreground">{summary}</p>
166169
</div>
167170
);
@@ -172,10 +175,12 @@ function CommandsPage() {
172175
<>
173176
<H1>Commands</H1>
174177
<P>
175-
The CLI is the whole interface: agents shell out to it, and so can you. Every command
176-
accepts <Code>--tab &lt;id&gt;</Code> (the active tab by default),{" "}
177-
<Code>--browser &lt;id&gt;</Code> (only needed when several browsers are connected, and the
178-
ids come from <Code>reins tabs</Code>) and <Code>--json</Code> for raw results.
178+
The CLI is the whole interface: agents shell out to it, and so can you. The commands that
179+
act on a page or a tab share three flags: <Code>--tab &lt;id&gt;</Code> (the active tab by
180+
default), <Code>--browser &lt;id&gt;</Code> (only needed when several browsers are
181+
connected, and the ids come from <Code>reins tabs</Code>) and <Code>--json</Code> for raw
182+
results. The management commands (<Code>status</Code>, <Code>doctor</Code>,{" "}
183+
<Code>kill</Code>, <Code>help</Code>) take none of them.
179184
</P>
180185
{GROUPS.map((group) => (
181186
<Fragment key={group.id}>

packages/web/src/routes/docs/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ function GettingStarted() {
7979
]}
8080
/>
8181
<P>
82-
Every command accepts <Code>--tab &lt;id&gt;</Code> (the active tab by default),{" "}
83-
<Code>--browser &lt;id&gt;</Code> (only needed when several browsers are connected) and{" "}
84-
<Code>--json</Code> for raw output.
82+
The commands that act on a page or a tab share three flags: <Code>--tab &lt;id&gt;</Code>{" "}
83+
(the active tab by default), <Code>--browser &lt;id&gt;</Code> (only needed when several
84+
browsers are connected) and <Code>--json</Code> for raw output.
8585
</P>
8686
<Arrow href="/docs/commands">Full command reference</Arrow>
8787
<Arrow href="/docs/architecture">How the pieces fit together</Arrow>

packages/web/src/routes/docs/route.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,11 @@ function DocsLayout() {
4343
<CopyMarkdown contentRef={contentRef} className="ml-auto" />
4444
</p>
4545

46-
<main ref={contentRef} data-pagefind-body className="mt-10">
46+
{/* An article, not a second <main>: the layout above already opens
47+
one, and two main landmarks on a page is one too many. */}
48+
<article ref={contentRef} data-pagefind-body className="mt-10">
4749
<Outlet />
48-
</main>
50+
</article>
4951

5052
<Rule />
5153
<p className={cn(TEXT, "mt-5 text-muted-foreground")}>Other pages</p>

packages/web/src/routes/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,10 @@ function Loop() {
179179
<>
180180
<H2 id="loop">The loop</H2>
181181
<P>
182-
Every page interaction is the same three beats: look, act, check. Every command takes{" "}
183-
<Code>--tab &lt;id&gt;</Code> (the active tab by default), <Code>--browser &lt;id&gt;</Code>{" "}
184-
(only when more than one browser is connected) and <Code>--json</Code>.
182+
Every page interaction is the same three beats: look, act, check. The commands that act on a
183+
page or a tab share three flags: <Code>--tab &lt;id&gt;</Code> (the active tab by default),{" "}
184+
<Code>--browser &lt;id&gt;</Code> (only when more than one browser is connected) and{" "}
185+
<Code>--json</Code> for raw output.
185186
</P>
186187
<Shell lines={LOOP_LINES} />
187188
<Arrow href="/docs/commands">Full command reference</Arrow>

0 commit comments

Comments
 (0)