fix(workspace): include caller_role in workspace response and migrate to Svelte 5 runes#83
Merged
Conversation
…te WorkspaceSettings to Svelte 5 runes canManage was derived from the members endpoint, causing the danger zone to be hidden on first visit when the members call returned empty. The backend now returns caller_role directly in the workspace response so the frontend can determine permissions without depending on a separate request. Also migrates WorkspaceSettings.svelte from legacy Svelte 4 syntax to Svelte 5 runes ($state, $derived, $props, event handler attributes).
Deploying archipulse with
|
| Latest commit: |
145c707
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://951ca958.archipulse.pages.dev |
| Branch Preview URL: | https://fix-normalize-relationship-e.archipulse.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GET /workspaces/{id}now includescaller_rolein the response. The frontend can use this to determine permissions immediately after loading the workspace, without depending on the members endpoint.WorkspaceSettings.sveltemigrated from legacy Svelte 4 syntax to Svelte 5 runes ($state,$derived,$props, event handler attributes).canManageandisOwnernow derive fromws.caller_roleinstead of the members list.Root cause
canManagewas computed frommembers.find(m => m.user_id === currentUserId)?.role. On first visit to a freshly MCP-created workspace, the members endpoint could return empty before the membership was fully propagated, leavingcanManage = falseand the danger zone hidden. A second visit would work because the timing was no longer an issue.Test plan