Skip to content

feat(clients): split name into internal label and public title - #1108

Merged
Ardnived merged 5 commits into
mainfrom
feat/clients-label-title
Nov 11, 2026
Merged

Ardnived merged 5 commits into
mainfrom
feat/clients-label-title

Conversation

@Ardnived

Copy link
Copy Markdown
Contributor

Summary

A service's name was an internal name that also became the sender name on registrant emails. It is now two fields, matching Meditations:

  • label — "Internal Name", required, on the Config tab. Renamed in place from name.
  • title — "Public Title", optional, on the Atlas tab above the logo.

Registrant emails (confirmation, reminder, follow-up) name a service by clientPublicTitle (src/lib/clients/site.ts): its title, else its site.domain, else the Sahaj Atlas brand as before. The domain is read when the email is built, not copied into title, so a later domain change is picked up. Mail to managers — contact subjects, usage alerts, the admin dashboard's open items — keeps the internal label.

Admin

  • List columns: Internal Name, Domain, Active. domain is a read-only virtual field off site.domain, which is admin.disabled and can't be a column itself. A false condition keeps it off the edit form, since the install summary already shows the domain.
  • Atlas tab: Embed location, Public Title, Logo, the three colours, Reply-To, then the Mailing List group. The "Brand Colors" and "Registrant Emails" groups were unnamed, so removing them moves no column.
  • title is on the Atlas tab, so lockTabs gives it that tab's write rule: an admin, or a manager of a service with the atlas role. Same as the logo.

Migration

20261110_234836_clients_label_title is hand-edited from drizzle's output. Drizzle generated ADD COLUMN "label" varchar NOT NULL + DROP COLUMN "name", which fails on a non-empty table and would discard every name. The edit is RENAME COLUMN "name" TO "label" + ADD COLUMN "title". Checked on a scratch database: all migrations apply from empty, and a row inserted under name came back as label after down → up.

⚠ Brief deploy window. The rename runs when the new build boots. Until traffic switches, the old container's clients reads fail, and API-key auth reads that table. If that's not acceptable, this can be split into add-and-copy now, drop name in a later deploy.

Cross-repo impact

  • SahajAtlasWeb selects name from GET /api/clients/me and publishes it as the schema.org organizer. An unknown select key is ignored, so the read still answers 200, but organizer is omitted until the widget selects title (falling back to allowedDomains). Follow-up PR to come there, after this merges and pnpm types:cms picks up the new types.
  • WeMeditateWeb reads no client name.

Testing

  • pnpm lint, pnpm format:check, pnpm typecheck, pnpm typecheck:tests, pnpm test:unit (254 files)
  • Integration: client-hooks (new case for the domain column, including a narrow select), clients-access, client-canonical, region-canonical-url, atlas-seo, atlas-sitemap, collections-smoke, user-submissions-create
  • registration-confirmation-email.spec.ts covers the title → domain → brand fallback

🤖 Generated with Claude Code

Ardnived and others added 2 commits November 10, 2026 16:51
`name` was an internal name doing double duty as the sender name on
registrant emails. It is now `label` ("Internal Name", required) beside
an optional `title` ("Public Title"), matching Meditations.

Registrant emails name a service by `clientPublicTitle`: its title, else
its site's domain, resolved at read time so a later domain change is
never frozen behind a copied title. Manager-facing mail (contact
subjects, usage alerts, the admin dashboard) keeps the internal label.

The list view gains a `domain` column: a read-only virtual field off
`site.domain`, which is `admin.disabled` and cannot be a column itself.

The migration renames the column in place rather than drizzle's
drop + add, so every service keeps its name.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…list

The Atlas tab now reads Public Title, Logo, the three colours, Reply-To,
then the Mailing List group — the "Brand Colors" and "Registrant Emails"
groups were unnamed, so dropping them moves no column.

`domain` is a list column alone: the install summary already shows it
on the form, so a false `condition` hides the field without dropping
the column, which `admin.hidden` would. A stray copy of it inside
`mailingList`, added by the previous commit, is removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@railway-app

railway-app Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

🚅 Deployed to the SahajCloud-pr-1108 environment in sahajcloud

Service Status Web Updated
SahajCloud ✅ Success (View Logs) Web Nov 11, 2026 at 12:48 am UTC
1 service not affected by this PR
  • mailpit

@Ardnived

Copy link
Copy Markdown
Contributor Author

@sydevs-bot review

@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 11, 2026
@sydevs-bot

sydevs-bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

🤖 no session running

recent dispatches
  • 00:28Z address-review · attempt 1 · session · done
  • 00:28Z address-review · attempt 1 · session
  • 00:18Z review-pr · attempt 1 · session · done
  • 00:18Z review-pr · attempt 1 · session

Written by the sydevs dispatcher. Sessions never edit this comment.

@sydevs-bot sydevs-bot moved this from Awaiting to Working in SYDevelopers Technical Roadmap Nov 11, 2026

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧐 Adversarial review

The diff is no larger than its own body. A rename, one new field, one admin-tab reshuffle, and the reshuffle earns its own commit. The consumer side holds: the select gate only requires a non-empty object (hooks.ts:247), so the widget's stale name key is ignored and organizer drops out instead of 400ing.

Both open questions are about existing rows at boot, not about shape. The rename has no copy step; title has no backfill. Neither is hidden — the body raises the first — but each changes behaviour for every service at deploy, and one two-step migration answers both.

Findings

  • should-fix — the rename gives the old container a window of failing clients reads, auth included (migration).
  • should-fix — title is null everywhere, so every registrant email's sender name becomes a bare domain (migration).
  • should-fix — src/components/admin/InstallGuide/InstallView.tsx:69 still says useAsTitle="name" (Clients.ts).
  • consider — siteOf's docblock undercounts its readers (domain field).

What was checked

Read whole: Clients.ts, lib/clients/site.ts, plugins/email/brand.ts, the migration, plugins/usage/hooks.ts. Ladder on both new pieces: clientPublicTitle joins primaryPageUrl and ownedHost in the module that owns SiteFields; the domain twin is forced — site is admin.disabled, allowedDomains a disabled textarea. Consumer side followed into SahajAtlasWeb: fetch.ts:736, types/client.ts, EventMetadata.tsx:72. Swept the branch for a stale name across every collection: 'clients' read and every useAsTitle; one hit, above. The hand edit is what src/migrations/AGENTS.md prescribes for a rename. The preview boots (200), but push: !isProduction means it never replays the chain, so the body's scratch-database run is the only evidence for the migration.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

// service keeps its internal name.
export async function up({ db }: MigrateUpArgs): Promise<void> {
await db.execute(sql`
ALTER TABLE "clients" RENAME COLUMN "name" TO "label";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should-fix — The rename lands when the new container boots, so the old one's clients reads fail until traffic switches, and API-key auth reads that table. Every widget read 500s in that window, on someone else's page.

Take the split the body offers: add label, copy name into it, drop name in a later deploy. A dead column for one deploy is cheaper than a 500 a host sees.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Keep the in-place rename, or split it?

  • A — keep the rename (built). One window at deploy where the old container's clients reads fail, API-key auth included.
  • B — add label, copy, drop name in a later deploy. No window, but name must also lose its NOT NULL or new inserts fail, and this preview has applied the migration, so a rewritten one never runs there.

Reply with a letter.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

export async function up({ db }: MigrateUpArgs): Promise<void> {
await db.execute(sql`
ALTER TABLE "clients" RENAME COLUMN "name" TO "label";
ALTER TABLE "clients" ADD COLUMN "title" varchar;`)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should-fix — title is null on every existing row, so clientPublicTitle falls through to site.domain for all of them. Every service's registrant emails switch sender name from a human name to a bare domain the moment this deploys.

20261107_213230_transcript_segment_count.ts carries a backfill for this exact shape, at the owner's request (#1087). Backfilling from label re-leaks the internal name, so this is a trade-off to decide, not an edit to make.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What should a null title send as?

  • A — leave it null (built). Every service's registrant mail sends as its bare domain until someone fills Public Title.
  • B — backfill title from label. Sender names stay as today, and every internal name becomes public.
  • C — fall through to the brand, not the domain. Every service sends as Sahaj Atlas until Public Title is set.

Reply with a letter.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

Comment thread src/collections/Clients/Clients.ts Resolved
Comment thread src/collections/Clients/Clients.ts Resolved
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Nov 11, 2026
sydevs-bot and others added 3 commits November 11, 2026 00:32
The Install view kept its own `useAsTitle="name"`, which the rename to
`label` left naming a field that no longer exists. `SetDocumentStepNav`
only tests the prop for presence and `!== 'id'` — the label itself comes
from `useDocumentTitle()` — so the breadcrumb never visibly broke, and
the next rename could break it for real.

`grantSummary.ts` already reads `config.admin?.useAsTitle` rather than
keeping a copy. Doing the same here leaves one spelling.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVtTLK7Y1mm5YssZfw
The new `domain` column reads `site` too, so the docblock's "the two
compatibility fields below" undercounted its callers.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVtTLK7Y1mm5YssZfw
@sydevs-bot

Copy link
Copy Markdown
Contributor

Built

  • useAsTitle — InstallView reads it off the config (540acaf). The breadcrumb was never visibly broken: the prop is only tested for presence.
  • siteOf's docblock — it counts the domain column now (7c4524e).

Open, waiting on you

origin/main merged in clean (one commit, chore(mcp)). Lean gate green, plus client-hooks. Clients.ts matched the security-review trigger; that pass found nothing.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 11, 2026
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-1108 November 11, 2026 00:44 Destroyed
@sydevs-bot sydevs-bot moved this from Working to Awaiting in SYDevelopers Technical Roadmap Nov 11, 2026
@sydevs-bot
sydevs-bot enabled auto-merge November 11, 2026 01:03
@Ardnived
Ardnived disabled auto-merge November 11, 2026 15:17
@Ardnived
Ardnived merged commit 87fea98 into main Nov 11, 2026
9 checks passed
@Ardnived
Ardnived deleted the feat/clients-label-title branch November 11, 2026 15:17
@sydevs-bot sydevs-bot moved this from Awaiting to Done in SYDevelopers Technical Roadmap Nov 11, 2026
sydevs-bot added a commit to sydevs/WeMeditateWeb that referenced this pull request Nov 11, 2026
sydevs-bot added a commit to sydevs/SahajAtlasWeb that referenced this pull request Nov 11, 2026
sydevs-bot pushed a commit that referenced this pull request Nov 11, 2026
Both sides appended their own last entry to the migration list, so the
conflict is positional only: #1108's clients label/title migration and
this branch's snapshot heal are independent, and both are kept, ordered
by timestamp.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjWBjeqwkAh17i3wvun
sydevs-bot pushed a commit that referenced this pull request Nov 11, 2026
#1108's `20261110_234836_clients_label_title` snapshot was generated on
main, so it carries `intro_audio_id` and `intro_subtitles` on `lessons`.
Being newest by filename it is what `migrate:create` diffs against, and a
run on the merged tree re-emitted all eight statements the localize
migration already ships. Keep that run's `.json`, empty its bodies, and
carry no copy of the backfill. A probe `migrate:create` after it writes
no files.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjWBjeqwkAh17i3wvun
sydevs-bot pushed a commit that referenced this pull request Nov 11, 2026
…er-contacts

One conflict, in src/migrations/index.ts: main's #1108 and this branch each
append a migration, so both sides claim the last array entry. Both are kept,
ordered by timestamp — 20261110_220603_manager_last_login before main's
20261110_234836_clients_label_title. Neither touches the other's table.

Everything else merged clean. main's rename of the clients `name` field to
`label` plus a new `title` reaches seeds/atlas/import.ts in a region this
branch does not touch, and src/payload-types.ts regenerates byte-identical
to the merged file.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjUvzMXoQtMoVVQaYYp
sydevs-bot pushed a commit that referenced this pull request Nov 11, 2026
#1108 renamed Clients.name to label; #1106 landed after it with two new
scripts still reading name. The two touch different files, so GitHub merged
#1106 without a conflict and main has not typechecked since: tsc --noEmit on
e543e6a reports the same three errors this branch inherited on merging it.

Both scripts are operator audits printing an internal identifier, so label is
the right half of the split rather than the public title.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjWo4RQkAJtqPe72vrB
sydevs-bot pushed a commit that referenced this pull request Nov 11, 2026
…udit

`main` does not typecheck. #1106 added `audit-challenge-parents.ts` and
`challenge-mounts.ts` reading `Client.name`; #1108 split that field into
a required internal `label` and an optional public `title`. Each was
green against its own base, and #1106 merged second, so `tsc` fails on
`main` itself at three sites — not at any conflict between the two
branches. Merging `main` brought the break here, which is why it is
fixed here.

`label` is the field the split kept for operator-facing output: required,
never shown to the public, and what manager-facing mail already uses.
`title` is optional and would print nothing for most services.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZTnsrufohceG18CSK
sydevs-bot pushed a commit that referenced this pull request Nov 11, 2026
#1106's audit picks `Client['name']`, which #1108 had already renamed to
`label` — it branched before that rename and merged after it, so `main`
itself does not typecheck. Nothing caught it: neither lint nor Vitest runs
`tsc`, and CI's test step does not either, so the Railway build is the
first place it fails. The audit prints the service's internal name, which
is what `label` holds.

Found by the lean gate on this merge, and fixed here because that gate is
what the merge had to pass.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZ93GJSxZ1zH4BGeHT
sydevs-bot pushed a commit that referenced this pull request Nov 11, 2026
#1106's challenge audit selects and prints `Client.name`, which #1108
renamed to `label` in the same release. Both merged, so `main` itself
fails `pnpm typecheck` — nothing in either PR's own gate crossed the
other, and the type error reaches no test lane.

`label` is the internal name, which is what this operator audit wants:
every row it prints names a service for somebody to go and configure.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjXtaL1Gdc9Fuxxn6Sz
sydevs-bot pushed a commit that referenced this pull request Nov 11, 2026
#1108 split the clients `name` field into `label` and `title`, and #1106
landed afterwards still reading `name`. Each was green on its own branch,
so main carries a tsc failure neither PR could see: `name` is not a key of
Client.

The audit is operator-facing, so it takes `label`, the internal name, not
`title`, which is the name registrants see.

This is main's break, not this branch's, and it reddens this PR's gate and
CI all the same.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjXy3iaPMgPWWDuicC8
Ardnived added a commit that referenced this pull request Nov 11, 2026
…#1047) (#1105)

* fix(access): lock every Managers field read to the row's holder or an admin

Ports the first half of #1045 (commits 1f5c3fb..4e71879) onto main, without
its region widening or its activity-log address projection.

`atlas-region-manager` holds a collection-wide `managers: read` so the
`Events.manager` and `Regions.managers` pickers can list other managers
(#821). Nothing narrowed it, so every region manager read every manager's
email, contact methods, notification preferences and imported legacy row.

- `lockManagerFieldReads` gives every field but `name` a self-or-admin `read`
  lock. `email` and `_verified` are redeclared at the top level so the lock
  has a base field to merge onto, keeping Payload's i18n labels.
- `loginPlugin`'s three machine columns carry the same lock.
- `stripLockedFieldsOnSelfRead` stands down off the caller's own row, so an
  internal `overrideAccess` read of a colleague keeps its fields.
- `UserSubmissions.previewEvent` selects only the assigned manager's name.

Refs #908

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(managers): record when a manager last signed in

Nothing recorded it: `sessions` loses its row on sign-out and prunes expired
ones, and `updatedAt` moves on every write, the digest job's included. The
manager contacts table needs it to tell an active colleague from one who
never accepted.

- `loginPlugin` appends `lastLoginAt`, read-only and `update: () => false`,
  with its own self-or-admin read lock like the other appended columns.
- `createSession`, the one place a session is minted, stamps it in the same
  write as the session row.
- The migration adds the column and fills it from `legacyData.lastLoginAt`,
  which the Atlas import kept for 448 of 516 managers. A hand edit, asked for
  on this PR, on the #1087 precedent: a projection of the same row.
- The Atlas import maps it from now on, keeping the later of the stored and
  the legacy date, so an `--update` never rewinds a real sign-in.

Refs #908

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(atlas): show a region's and an event's managers to the managers above

With every field but `name` locked on another manager's row, a region
manager had no way to reach the people their region names. The details come
back the way an event's registrants do: through a surface that checks its own
gate and then reads past the locks, rather than a field lock widened per
reader.

- `mayReadManagerContacts` is the gate: an admin, the event's own manager, or
  an active manager whose owned subtree holds the region. That is a region's
  co-managers and the managers of every region above it, downward only.
- `managerContactsField` puts one shared table under `Regions.managers` and
  `Events.manager`: Payload's condensed `Table` with the name, a `mailto:`
  email and the last sign-in. It reads the stored row by id, never the form
  data, and for an event the published row.
- `Events.activityLog` reads behind the same gate (`eventContactsFieldAccess`,
  through a new `read` option on `logField`), since its reminder entries
  record where each one went. With no row in hand it answers for admins only.
- `previewEvent` loads its target without the log: a proposal reaches the
  managers of the region it proposes, who need not be the event's.
- Region-manager reminders already carry the event manager's email. A case
  now pins it against the new locks.

Refs #908, #1047

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(seeds): keep firstDomain's doc block on firstDomain

`laterDate` landed between the block and the function it documents, so a
reader got the legacy-domain explanation above a date comparison.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVvfniXDQu4ThbSqXV

* fix(admin): declare the contacts row type beside its loader

`import type` is erased, so the client table taking the row type from
`data.ts` pulls no server module into the browser bundle — the shape
`EventRegistrations` already has, where `RegistrationRow` is declared in its
own `data.ts`.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVvfniXDQu4ThbSqXV

* refactor(atlas): render the manager contacts table under the field description

The table is now the `Description` of `Regions.managers` and `Events.manager`
rather than a `ui` field of its own: it renders the field's own description,
then the table, as `PermissionsTable` sits under `Managers.roles`. Both fields
also declare an empty `afterInput`, because Payload otherwise renders a
`Description` once and keeps it through a save, and the table would go on
listing the managers the page loaded with.

The last sign-in is one line, `2026/11/10 - 3 weeks ago`, in three states:
normal, red past six months, and a muted "Never".

Refs #908

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(admin): spell the contacts table's sign-in day with formatShortDate

The table's own helper gave `2026/11/10`, under a reason — one unambiguous
spelling in every locale — that the module's existing `formatShortDate` already
satisfies. It also spells a UTC day, returns `''` for an unparseable value, and
is what the Registrations table beside this one shows a date with, so both
tables now read the same.

The spec spells the expected day out rather than calling the formatter, so the
day the table shows stays pinned against it.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZ3Mx2LJUWEV8VFdtU

* fix(admin): take the contacts component's props from Payload's own types

`path` arrives through `renderField`'s `clientProps`, which Payload types as
`FieldPaths`, so `Pick<FieldPaths, 'path'>` says what `{ path?: string }` was
restating — and it is always set, so the `''` fallback is gone with it.

`admin.description` needed no structural cast either, only a narrower field
type: `ServerComponentProps['field']` is the whole `Field` union, whose `row`
and `tabs` members omit `description`, while both registrations are on a
relationship picker.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZ3Mx2LJUWEV8VFdtU

* fix(admin): put the contacts table in Payload's afterInput slot

`RelationshipInput` renders `AfterInput` and then the `Description` slot, so
the table reaches the same place from the slot Payload already provides for it
— and a `beforeInput`/`afterInput` key is what `renderField` tests to re-render
a field's components on every form-state request, so the save-follows behaviour
now comes from the registration itself rather than from an empty array beside a
`Description` override.

That override existed only to put the table below the description. Paying for
it were four pieces: re-rendering `FieldDescription` by hand, the `path` prop
it needs, the `RelationshipField` narrowing for `admin.description`, and the
empty-array trap with a ⚠ on each field and in the component. The table now
sits above the description instead.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjYYtgW8B9ehUL2Ek4h

* docs(access): cut what the field-lock JSDoc already carries

Three ⚠ blocks restated, near-verbatim, the JSDoc on `selfOrAdminFieldAccess`
and `stripLockedFieldsOnSelfRead` — and this file loads whenever either is
edited, so every reader paid for both copies.

Each keeps its rule, its #NNN breadcrumb and the one line a reader cannot
re-derive, and hands the mechanism back to the JSDoc beside the code that
implements it.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjYYtgW8B9ehUL2Ek4h

* fix(admin): drop the contacts table's unreachable name fallback

`Managers.name` is `required: true`, so `name || email` never took its second
arm — and had it ever fired, the Name column would have printed an email.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjYYtgW8B9ehUL2Ek4h

* chore(migrations): snapshot resync after the seventh main merge

main's 20261110_234836_clients_label_title snapshot was generated on main,
so it knows nothing of the last_login_at column this branch adds — and its
timestamp is the higher of the two. migrate:create diffed against it and
re-emitted ALTER TABLE "managers" ADD COLUMN "last_login_at", which
20261110_220603_manager_last_login already ships. Replaying one statement
aborts the boot migration (#566).

So the generated file keeps only its .json snapshot, taken on the merged
tree, which carries both sides and heals the chain. A probe run afterwards
writes no files.

CI cannot see any of this: push: !isProduction syncs the schema with Drizzle
push and never replays the chain. Only a Railway boot does.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjUvzMXoQtMoVVQaYYp

* fix(clients): read the audit's service name from label, not name

#1108 split the clients `name` field into `label` and `title`, and #1106
landed afterwards still reading `name`. Each was green on its own branch,
so main carries a tsc failure neither PR could see: `name` is not a key of
Client.

The audit is operator-facing, so it takes `label`, the internal name, not
`title`, which is the name registrants see.

This is main's break, not this branch's, and it reddens this PR's gate and
CI all the same.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjXy3iaPMgPWWDuicC8

* refactor(access): trim the manager contact locks to what they need

The new comments were 44% of the PR's added source; cut to the why, keeping
every warning. The unit sweep over the Managers field locks repeated the
integration sweep, which reads the booted config and so already sees the
login plugin's columns and the base auth fields: the integration spec now
carries the non-vacuity check, and the unit spec keeps the
`selfOrAdminFieldAccess` cases. `stripLockedFieldsOnSelfRead` drops its
unselected-field skip, a shortcut that saved nothing once the hook ran on
the caller's own row alone. `MANAGER_PUBLIC_FIELDS` is no longer exported.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(admin): put the contacts table back under the field description

f0f14eb moved the table into `afterInput`, which `Relationship/Input`
renders above the description. Under the description is where the owner
asked for it, as `roles` sits on Managers, so both fields register the
component as their `Description` again, with the empty `afterInput` that
re-renders it after a save. The component's docblock now says why the slot
is `Description`, so the next review can see the placement was chosen.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

This branch was successfully deployed

No deployments
sahajcloud / SahajCloud-pr-1108 — 7c4524ee Deployed Nov 11, 2026 by railway-app[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants