Skip to content

Organization selection, support-session banner, README no longer documents a nonexistent option - #1

Merged
sylvesterdamgaard merged 4 commits into
mainfrom
feat/organization-selection
Sep 24, 2026
Merged

sylvesterdamgaard merged 4 commits into
mainfrom
feat/organization-selection

Conversation

@sylvesterdamgaard

Copy link
Copy Markdown
Contributor

Part of the Cbox ID UX/DX program (https://claude.ai/artifact/W9TnQg4o9tGKgqPPAUppTy), matching laravel-id 1.19 (cboxdk/laravel-id#8). Will be released once the cbox-id server side is live. Details in CHANGELOG.

…inds

useOrganization() is the headless half of the switcher: the organization
the session is bound to, the person's membership tier in it (org_role, taken
from the token over the possibly older organizations list), their
organizations, and switchOrganization(id) through urls.switchOrganization.

The switcher no longer names the first listed organization as current when
the session is bound to none. Showing one organization's name over a session
not bound to it is the exact mistake organization binding exists to prevent.
Without the `organizations` scope there is no list, so urls.selectOrganization
(a prompt=select_organization route) makes it a link to the hosted picker; it
also sits at the foot of the menu.

<SupportSessionBanner> and useSupportSession() show while a member of staff
is signed in as the user (RFC 8693 `act`, exposed by id-js 0.17 as
user.actor). Fail-closed: the provider keeps an unreadable actor as
{ sub: null } so the banner still draws, and narrows a readable one to its
subject alone. The banner tints over transparent rather than Canvas, which
follows the OS and came out near-black on a light page viewed on a dark OS.

@cboxdk/id-js ^0.17.0 is an optional peer: nothing imports it, but the fields
drawn here are produced by it, and the range resolves once 0.17.0 ships.
The README told users to call createAuthorizationRequest({ organizationId }).
id-js has no such option, and the server parameter is `organization`. The
section now uses id-js's switchOrganization(id), shows the select and create
routes, explains that the list needs the `organizations` scope, and documents
useOrganization(), the support-session banner, and the id-js 0.17 requirement.
CHANGELOG.md starts here with an Unreleased entry.
The switcher shares .cbox-id-menu with the user button, which is anchored
right: 0 because the avatar sits at the end of a header. The switcher sits at
the start, so the same rule grew its menu leftwards past the viewport edge.
It now opens from its own left edge (.cbox-id-anchor--start), the same fix as
id-vue. Checked rendered at 375 and 1280 px in both themes: the menu spans
16-308 px with no horizontal scroll.
@sylvesterdamgaard
sylvesterdamgaard merged commit b899df5 into main Sep 24, 2026
3 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