Signing UI edge-case cleanup (#6849)

This commit is contained in:
EthanHealy01
2026-06-30 23:04:10 +01:00
committed by GitHub
parent bb92ecc143
commit 54042c8e5e
3 changed files with 28 additions and 2 deletions
@@ -130,7 +130,12 @@ const ShareManagementModal: React.FC<ShareManagementModalProps> = ({
}, [config?.frontendUrl]);
const loadShareLinks = useCallback(async () => {
if (!file.remoteStorageId) return;
if (!file.remoteStorageId) {
// No remote file yet — clear any leftover state from a previously opened file.
setShareLinks([]);
setSharedUsers([]);
return;
}
setIsLoading(true);
setErrorMessage(null);
try {
@@ -161,6 +166,10 @@ const ShareManagementModal: React.FC<ShareManagementModalProps> = ({
useEffect(() => {
if (opened) {
// Clear the previous file's data before loading so a stale list is never
// shown (and never targeted by a Remove click) while the new file resolves.
setShareLinks([]);
setSharedUsers([]);
loadShareLinks();
setActivityMap({});
setShareRole("editor");
@@ -331,6 +331,12 @@ export const SignaturePreviewLayer = memo(function SignaturePreviewLayer({
newY = startTop + (startHeight - newHeight);
}
// Keep the box on-page (mirrors the placement clamp).
newWidth = Math.min(newWidth, 1);
newHeight = Math.min(newHeight, 1);
newX = Math.max(0, Math.min(newX, 1 - newWidth));
newY = Math.max(0, Math.min(newY, 1 - newHeight));
onChange(
previews.map((p) =>
p.id === preview.id