Skip to content

feat(personal): cut Mode 3 over to the collab auth + files contract#102

Merged
schnsrw merged 1 commit into
mainfrom
feat/personal-mode3-collab
Jun 24, 2026
Merged

feat(personal): cut Mode 3 over to the collab auth + files contract#102
schnsrw merged 1 commit into
mainfrom
feat/personal-mode3-collab

Conversation

@schnsrw

@schnsrw schnsrw commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

What

Repoints Mode 3 (Personal / Standalone) from the legacy Go gateway to the collab server's auth + files contract (CasualOffice/collab src/auth/* + src/files/*) — the Sheets-proven shapes. This is the second half of the Go→collab editor cutover (WOPI shipped in #100).

Contract changes

  • Envelopes: { user }, { files }, { file }, { profile } (were bare); errors are { error } (were { code, message }).
  • File fields: id / name / etag / modifiedAt (were docId / fileName / version / savedAt).
  • Files: multipart POST /files create; POST /files/:id replace with If-Match (was PUT /files/:id/contents); PATCH { name } rename → 204.
  • Profile: PATCH /auth/profile (was PUT); { user, profile } read shape; language preference moves into preferences.locale (collab has no locale column).

User-visible change

Authentication is now by username, not email — collab authenticates by username (email is an optional profile field). The login/signup modal now shows a Username field; AuthCredentials is { username, password } and PersonalFileSourceOptions.user is { id, username }.

Verification

typecheck, format, lint (0 errors), build, 58 file-source unit tests, and the personal-auth-gate (13) + autosave-indicator (3) e2e specs all pass locally. Login modal visually confirmed (Username field). Grounded in collab source, not memory.

Remaining for the cutover: PR2 (prod Dockerfile + compose → collab) and PR3 (delete backend/ + CI Go job).

Repoint PersonalFileSource, AuthClient, and the personal-auth UI from the
legacy Go gateway to the collab server (CasualOffice/collab):

- wire.ts: UserWire {id,username,isAdmin,createdAt}, FileSummaryWire
  {id,name,etag,createdAt,modifiedAt}, ErrorWire {error}, ProfileWire
  {displayName,email,timezone,hasAvatar,preferences}.
- PersonalFileSource: unwrap { files }/{ file }/{ profile }; multipart
  POST /files create; POST /files/:id replace with If-Match; PATCH
  { name } rename (204); PATCH /auth/profile; decode CD filename.
- AuthClient: username login/signup, { user } unwrap, 503 -> null,
  PATCH profile, { error } envelope.
- select.ts: unwrap { user } from /auth/me.
- PersonalAuthGate: email field -> username; drop signup displayName;
  collab error-code copy. ProfileSettingsDialog: locale <-> preferences.
  UserMenu: username identity + @handle secondary line.
- Tests + e2e (personal-auth-gate, autosave-indicator) updated to the
  collab contract.

Authentication is now by username (collab has no email login).
@schnsrw schnsrw merged commit 247e8e1 into main Jun 24, 2026
4 of 7 checks passed
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