Skip to content

feat(translation-review): invite-token auth for collector saves#2913

Merged
ctwoodwa merged 3 commits into
mainfrom
codex/translation-review-invite-tokens
Jul 20, 2026
Merged

feat(translation-review): invite-token auth for collector saves#2913
ctwoodwa merged 3 commits into
mainfrom
codex/translation-review-invite-tokens

Conversation

@ctwoodwa

Copy link
Copy Markdown
Contributor

Why

The translation collector requires a per-reviewer Bearer invite token for /submit and /suggest (there's an issue/revoke invite model; submissions are attributed to a reviewer with a trust level). The ui-react rebuild (#2710) shipped no token flow, so saving against a live collector 401'd. This wires the invite flow into the app so shared dogfooding works.

What

  • Consume a #token=… invite fragment on load: store it locally, then strip it from the URL so the secret isn't left in history or shared by copy-paste.
  • Send Authorization: Bearer <token> on /submit and /suggest when a token is present.
  • On 401: clear the stored token and prompt the reviewer to open their invite link; edits stay local meanwhile.
  • Hint when the collector is reachable but no invite token is present.

Reads (/status, progress) stay anonymous; only writes need the token.

Verified end-to-end

Stood up the collector on winhub (tailnet-only, CORS-scoped, scheduled-task persistence) and confirmed against the live preview:

  • Invite link → token stored + URL stripped; collector chip → connected, no hint.
  • Mark good → Save → "✓ Saved" (not 401); collector persisted the record attributed to the token's reviewer (reviewer: CIC, trust: untrusted).
  • Submit without a token → 401; CORS preflight returns the correct Access-Control-Allow-Origin.

Gates: pnpm typecheck clean, pnpm test 21/21.

🤖 Generated with Claude Code

The shared collector requires a per-reviewer Bearer invite token for /submit
and /suggest; the ui-react rebuild sent none, so saves 401'd. This wires the
invite flow into the app.

- Consume a #token=... invite fragment on load: store it locally, then strip it
  from the URL so the secret is not left in history or shared by copy-paste.
- Send Authorization: Bearer on submit and suggest when a token is present.
- On a 401, clear the stored token and prompt the reviewer to open their invite
  link; edits stay local meanwhile.
- Show a hint when the collector is reachable but no invite token is present.
- Tests: token sent + stripped, 401 prompt, connected-without-token hint.

Reads (status/progress) stay anonymous; only writes need the token.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LfG2AV7RQC3ncBLB9ApLAE
@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@ctwoodwa, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 4 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 5fdce893-05f8-40c4-9412-4e86264e7e2f

📥 Commits

Reviewing files that changed from the base of the PR and between 2f6104c and f0e6c07.

📒 Files selected for processing (3)
  • tooling/translation-review/src/App.test.tsx
  • tooling/translation-review/src/App.tsx
  • tooling/translation-review/src/styles.css
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/translation-review-invite-tokens

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.

ctwoodwa and others added 2 commits July 19, 2026 08:12
…oken

With the collector now live, saving/suggesting from a device that has no invite
token 401'd — handled gracefully in the UI, but the browser still logged the 401
as a console error. Short-circuit both paths: when no token is present, show the
"open your invite link" prompt (save) or reset the button (suggest) without
hitting the server. Only a genuinely invalid/revoked token can now log a single
401, which self-corrects (the handler clears it).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LfG2AV7RQC3ncBLB9ApLAE
The bottom (utility) panel had grown to four stacked rows (~120-168px) with a
lot of blank space. Redesign it as a one-row status bar and pin the panel to
that height so toggling it open shows exactly one row.

- Collapse the header/row/session/keys stack into a single flex row inside a
  .status-strip__bar child (avoids fighting the shell region's column layout):
  collector state · last saved · today's session · progress waterline — then a
  spacer — keyboard hints · build. Dot separators between left-cluster items.
- Progressive disclosure by width: drop keyboard hints (≤64rem), build (≤48rem),
  session (≤30rem); collector state + saved + waterline always stay.
- The shell enforces a ~120px utility floor; override it (scoped to this status
  strip) so the panel hugs the ~34px bar in both overlay and docked layouts.
  panelSizes.utility set to match.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LfG2AV7RQC3ncBLB9ApLAE
@ctwoodwa
ctwoodwa merged commit 7235bdf into main Jul 20, 2026
19 checks passed
@ctwoodwa
ctwoodwa deleted the codex/translation-review-invite-tokens branch July 20, 2026 10:45
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