Skip to content

feat(website): ask before setting up the company on a register link - #38

Merged
kubiknyc merged 4 commits into
mainfrom
feat/welcome-consent
Sep 9, 2026
Merged

feat(website): ask before setting up the company on a register link#38
kubiknyc merged 4 commits into
mainfrom
feat/welcome-consent

Conversation

@kubiknyc

@kubiknyc kubiknyc commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Summary

WorkLog website half of jobsight-backend #35 stage A: ask before claiming a company.

Register confirm links now carry the company name (…&flow=register&company=<name>, from worklog-register-company once jobsight-backend's stage-A PR deploys). After the tap-driven confirm, /welcome shows the name as text and asks:

  • Yes, set it upclaim_pending_company({ expected_name }). The server refuses any other name (400 → "This link is out of date for that company…", skip-to-password kept, no retry).
  • No, that's not my companydiscard_pending_company (clears the parked name, mints nothing) → password form. The final card then says the password is saved and the company can be registered from the app later, never "your company is ready".
  • Links without a name (older mails) keep phase-1 behaviour (zero-arg claim).

Nothing fires on mount or in an effect; no server text is rendered; the name is a JSX text child only. Site classes only.

Order

Deploy after jobsight-backend's stage-A PR (migration 20260909000201 + both register functions). Until then no link carries company and this page behaves as today. Worklog-site is not GitHub-linked on Vercel: deploy with vercel deploy --prod from website/.

Verification

  • npm run typecheck, npm test (42), npm run build — green. WorkLog CI runs nothing on website/**.
  • santa loop: 2 rounds (Reviewer A ecc:code-reviewer on Opus — the repo's worklog-reviewer is not registered in this session; Reviewer B Gemini), both PASS in round 2. Round-1 HIGH: the done card promised a company to a reader who declined; fixed and pinned in welcome-copy.test.ts. Round-2 MEDIUM (skip after a failed decline) fixed in the third commit.

A register confirm link now carries the parked company name, so /welcome
shows it back to the reader before anything is created. "Yes, set it up"
claims with expected_name, so a link naming a company that is no longer
parked is refused (400) with plain copy and a way on to the password
rather than a silent claim of something else. "No, that's not my
company" discards the parked marker, mints nothing, and says they can
register their own company from the app later.

Older mails still in flight carry flow=register with no name; those keep
the zero-argument claim and skip the consent card entirely.

Nothing fires on mount or in an effect — both RPCs are tap-driven, the
fragment is still read once, and the company name is React text.
@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 35e8cc40-93a0-4df7-a24d-74c873b49f5c


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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f9b59735bd

ℹ️ 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".

Authorization: `Bearer ${phase.accessToken}`,
"Content-Type": "application/json",
},
body: "{}",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Bind the discard to the company shown

When a previously issued link remains valid after the parked company changes—the stale-link case already handled by expected_name on the claim path—the consent card shows the old company, but choosing “No” sends an unqualified discard. The RPC therefore cannot distinguish the rejected company from the newer parked one and can clear the user's current registration, causing its confirmation link to fail as stale too. Pass the displayed company to the discard RPC and clear the marker only when it still matches.

Useful? React with 👍 / 👎.

@kubiknyc
kubiknyc merged commit 8d5b2cd into main Sep 9, 2026
5 checks passed
@kubiknyc
kubiknyc deleted the feat/welcome-consent branch September 9, 2026 10:12
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