Problem
Changing ShareModeSelect triggers a refetch whose closure still holds the previous default 'view' (client/src/hooks/useShareLink.ts:15), racing the effect refetch (share-button.tsx:55-59). The displayed/copied URL can be a view token while the select shows Edit.
Fix
Derive the fetch from the current selection state synchronously (or cache links per-permission) so copied URLs always match the selected mode.
Problem
Changing ShareModeSelect triggers a refetch whose closure still holds the previous default
'view'(client/src/hooks/useShareLink.ts:15), racing the effect refetch (share-button.tsx:55-59). The displayed/copied URL can be a view token while the select shows Edit.Fix
Derive the fetch from the current selection state synchronously (or cache links per-permission) so copied URLs always match the selected mode.