Feat v0.7.0 shell contract + surface audit + rebrand
Two-slot shell topbar (home, left, center, bell, user menu) with SDK API (setLeft/setSlot/setTitle/hide/show). All 4 primary surfaces migrated: Settings and Team Admin to Pattern B (flat tabs), Admin to Pattern C (category tabs + sidebar), Docs to Pattern A (default). Backend WS events: package.changed (broadcast), auth.changed (targeted), notification.all_read. User menu re-fetches on package/auth changes. Bell syncs read state across tabs. Error handling pass with .sw-inline-error CSS primitive. Empty state guidance for Admin Workflows/Groups. Announcement global dismiss via localStorage. Rebrand assets deployed (both b/e icon variants, wordmarks, full icon library). Docs outline scroll-to-heading fix. Bug fixes: ICD security assertion tightened, workflow-demo error surfacing, signoff display names, hello-dashboard + team-admin/groups.js deleted. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -236,3 +236,29 @@ func TestToolResultRouteBoth(t *testing.T) {
|
||||
t.Error("tool.result.* should route DirBoth (filtered by WS subscriber, not routing table)")
|
||||
}
|
||||
}
|
||||
|
||||
func TestShellContractEventRoutes(t *testing.T) {
|
||||
// package.changed — broadcast to all clients
|
||||
if !ShouldSendToClient("package.changed") {
|
||||
t.Error("package.changed should be sent to client")
|
||||
}
|
||||
if ShouldAcceptFromClient("package.changed") {
|
||||
t.Error("package.changed should NOT be accepted from client")
|
||||
}
|
||||
|
||||
// auth.changed — targeted to specific user
|
||||
if !ShouldSendToClient("auth.changed") {
|
||||
t.Error("auth.changed should be sent to client")
|
||||
}
|
||||
if ShouldAcceptFromClient("auth.changed") {
|
||||
t.Error("auth.changed should NOT be accepted from client")
|
||||
}
|
||||
|
||||
// notification.all_read — targeted to specific user
|
||||
if !ShouldSendToClient("notification.all_read") {
|
||||
t.Error("notification.all_read should be sent to client")
|
||||
}
|
||||
if ShouldAcceptFromClient("notification.all_read") {
|
||||
t.Error("notification.all_read should NOT be accepted from client")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,8 +51,15 @@ var routeTable = map[string]Direction{
|
||||
"role.fallback": DirToClient,
|
||||
|
||||
// Notifications
|
||||
"notification.new": DirToClient, // targeted via Hub.PublishToUser, not room-based
|
||||
"notification.read": DirToClient, // badge sync across tabs
|
||||
"notification.new": DirToClient, // targeted via Hub.PublishToUser, not room-based
|
||||
"notification.read": DirToClient, // badge sync across tabs
|
||||
"notification.all_read": DirToClient, // mark-all-read badge sync
|
||||
|
||||
// Package lifecycle (broadcast to all clients)
|
||||
"package.changed": DirToClient, // install/uninstall/enable/disable
|
||||
|
||||
// Auth changes (targeted to affected user)
|
||||
"auth.changed": DirToClient, // role/membership change → menu refresh
|
||||
|
||||
// Workspace
|
||||
|
||||
|
||||
@@ -173,6 +173,12 @@ func (h *Hub) IsConnected(userID string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// Broadcast sends an event to all connected clients via the bus.
|
||||
// No TargetUserID — every WS subscriber receives it.
|
||||
func (h *Hub) Broadcast(event Event) {
|
||||
h.bus.Publish(event)
|
||||
}
|
||||
|
||||
// PublishToUser sends an event to a specific user via the bus.
|
||||
// All replicas receive the event; only the one with the user's connection delivers it.
|
||||
func (h *Hub) PublishToUser(userID string, event Event) {
|
||||
|
||||
Reference in New Issue
Block a user