Skip to content

feat(pit): tab Yours and Theirs instead of stacking them - #128

Merged
ralyodio merged 1 commit into
mainfrom
feat/pit-tabs
Jul 31, 2026
Merged

ralyodio merged 1 commit into
mainfrom
feat/pit-tabs

Conversation

@ralyodio

@ralyodio ralyodio commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Yours and Theirs are now tabs, directly under the .whatever claim form.

Previously reaching the market meant scrolling past every ending you hold — and that gets worse with each one you claim.

Folded into the existing strip

#124 landed a tab strip while this was in flight (Namespace / Use it (DNS)). Rather than nesting tabs inside tabs, this makes it one strip of three — they're three views of the same namespace:

Yours 13   Theirs 4 · 2 for sale   Use it (DNS)

Namespace is gone as a label; it was the thing that now splits into Yours and Theirs. Counts are omitted on /pit/dns, which doesn't load the registry.

Approach

Server-rendered anchors, not client-side toggling. The page has no other JavaScript, and ?tab= gives each panel a real URL that survives a reload and can be linked. An unrecognised ?tab= falls back to Yours rather than rendering an empty page.

Two things that came with it

  • Form posts keep their tab. back() now takes one, so buying a name in Theirs no longer bounces you to Yours to read the result. The three checkout redirects return to Theirs; everything else to Yours.
  • Only the visible panel is queried. Yours needs a names lookup and an exemptions lookup per ending; Theirs is one row each. Rendering the market was doing 2N queries for endings it never drew.

Verification

npm test → 199 pass, 0 fail (includes #124's).

Booted the real server — one strip on every route, correct tab lit:

request highlighted panel
/pit Yours Yours
/pit?tab=theirs Theirs Theirs
/pit?tab=bogus Yours Yours
/pit/dns Use it (DNS) DNS

🤖 Generated with Claude Code

The two sections ran one after the other, so reaching the market meant
scrolling past every ending you hold -- and that gets worse with each one
you claim. They are now tabs, directly under the claim form.

Server-rendered anchors rather than client-side toggling: the page has no
other JavaScript, and ?tab= gives each panel a URL that survives a reload
and can be linked to. An unrecognised value falls back to Yours rather
than rendering nothing.

Form posts carry the tab through the redirect, so buying a name in Theirs
no longer bounces you to Yours to read the result.

Only the visible panel's detail is queried. Yours needs a names lookup and
an exemptions lookup per ending; Theirs is one row each. Viewing the
market was doing 2N queries for endings it never drew.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

@ralyodio
ralyodio merged commit f935b7e into main Jul 31, 2026
3 checks passed
@ralyodio
ralyodio deleted the feat/pit-tabs branch July 31, 2026 04:49
ralyodio added a commit that referenced this pull request Sep 6, 2026
The cost table is where you notice a session that cost $300, and the next
thing you want is the thing it produced — which is on GitHub, not on this
machine. Claude Code already writes a `pr-link` record when a session opens
a pull request; nothing was reading it.

Adds a `pr` column to both `moshcode cost` and `moshcode cost --all`,
rendered as an OSC 8 hyperlink: the label reads "view #128" at four columns
wide while the click target is the full URL, so the column costs almost
nothing to carry. `--json` carries `pr` and `prs` in full.

OSC 8 is not universal and cannot be feature-detected, so piped output falls
back to the raw URL and `MOSHCODE_HYPERLINKS=0` forces that same plain form
in a terminal that would otherwise paint a "view" nobody can click.

ui.mjs had to learn about hyperlinks to make this line up: `strip` only
matched SGR, so a cell measured with a URL inside it would have sized its
column to sixty characters and pushed the table apart. `clip` now copies an
OSC 8 wrapper whole and closes one it cut into, the same care it already
took with colour.

`ps` deliberately does not get this column. It runs in 0.22s; the transcript
scan the PR comes from takes 1.75s, and that is a bad trade for a column
that is empty while the work is still in progress.

Only github.com-shaped https URLs are accepted — the string ends up in an
escape sequence handed to the user's browser, and a transcript is a file on
disk that other tools write to.


Claude-Session: https://claude.ai/code/session_01Cbtunz1LzTra3EEJNK1cHN

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant