On the Inspection Details screen in the Attik mobile app, add a "View in Attik" dropdown button next to the existing Start Inspection button. The dropdown provides two discrete sections: (1) open the client portal as one of the job contacts, and (2) open the work order in Attik (tools web app).
app/(app)/inspection/[id].tsxBlurView footer, ~lines 520–530)1. Client portal (discrete section)
WorkorderActionsDropdown.tsx:_roleId._id + _contactId._id, and use role name + optional contact name for labels (see uniquePeople, roleCount in reference file).NEXT_PUBLIC_CLIENT_URL equivalent / env for client app URL).{clientPortalBaseUrl}/job/{inspection.slug}?access_token={token}{clientPortalBaseUrl}/job/{inspection.slug} (no token).2. Work order in Attik (discrete section)
{toolsBaseUrl}/tools/inspections/{inspection._id}Use the access route in attik-backend:
attik-backend/src/routes/access.tsPOST /access (or whatever base path the backend exposes for this router, e.g. POST /api/access).{ companyId, contactId?, expiresIn?, type? }companyId (required): from AuthContext (companyId) or inspection (inspection._companyId).contactId: required when opening portal as a specific contact; omit for view-only/no-contact.expiresIn: optional (default e.g. '2d').type: optional; use 'portal-access' (default) for client portal.{ token: string }.If the access route is behind auth middleware, ensure the mobile app’s requests include the inspector’s auth so the backend can validate and issue the token.
toolsv2/src/app/tools/inspections/[id]/components/WorkorderActionsDropdown.tsxuniquePeople deduplication (by role + contact).roleCount for deciding when to show contact name.handleOpenClientPortal(personIndex?): if no people or no index, open without token; else POST for token with companyId + contactId, then open URL with ?access_token=....Do not call a tools server action from mobile; implement the same behavior in the app by calling attik-backend POST /access and then opening the client portal URL.
useInspectionDetails(id) → inspection (type InspectionPopulatedWithServices).people is already requested (useInspectionDetails populates people).inspection.slug — client portal path: /job/{slug}.inspection._id — work order URL: /tools/inspections/{_id}.inspection.people — each has _roleId (name, icon), _contactId (_id, firstName, lastName).inspection._companyId or AuthContext companyId for the access request.POST /access with companyId and (when applicable) contactId, then opens client portal URL with token; no contact → open without token.Please authenticate to join the conversation.
Completed
Main App
4 months ago
Linear
Get notified by email when there are changes.
Completed
Main App
4 months ago
Linear
Get notified by email when there are changes.