Compare commits

...

3 Commits

Author SHA1 Message Date
copilot-swe-agent[bot] 69ed96413d Optimize scopeLimitNotice variable usage
Remove redundant variable and use translation directly in JSX

Co-authored-by: tommoor <380914+tommoor@users.noreply.github.com>
2026-02-06 00:06:00 +00:00
copilot-swe-agent[bot] e7375a09e5 Refine public sharing visibility logic in Share popover
- Show public sharing section when collection.sharing is false (disabled state)
- Display explanatory message when collection-level restrictions apply
- Only hide section entirely when team.sharing is false
- Add limitedByScope prop to communicate restriction level
- Maintain accessibility with properly disabled controls

Co-authored-by: tommoor <380914+tommoor@users.noreply.github.com>
2026-02-06 00:04:38 +00:00
copilot-swe-agent[bot] 9a3a04eb4f Initial plan 2026-02-05 23:55:03 +00:00
2 changed files with 13 additions and 4 deletions
@@ -211,7 +211,7 @@ export const AccessControlList = observer(
</>
)}
</ScrollableContainer>
{team.sharing && can.share && !collectionSharingDisabled && visible && (
{team.sharing && can.share && visible && (
<Sticky>
{document.members.length ? <Separator /> : null}
<PublicAccess
@@ -220,6 +220,7 @@ export const AccessControlList = observer(
share={share}
sharedParent={sharedParent}
onRequestClose={onRequestClose}
limitedByScope={collectionSharingDisabled ? "collection" : undefined}
/>
</Sticky>
)}
@@ -38,10 +38,12 @@ type Props = {
/** Ref to the Copy Link button */
copyButtonRef?: React.RefObject<HTMLButtonElement>;
onRequestClose?: () => void;
/** Hierarchy level at which web sharing capability has been disabled */
limitedByScope?: "collection";
};
function PublicAccess(
{ document, share, sharedParent }: Props,
{ document, share, sharedParent, limitedByScope }: Props,
ref: React.RefObject<HTMLDivElement>
) {
const { t } = useTranslation();
@@ -51,7 +53,9 @@ function PublicAccess(
const inputRef = React.useRef<HTMLInputElement>(null);
const can = usePolicy(share);
const documentAbilities = usePolicy(document);
const canPublish = can.update && documentAbilities.share;
const hasActiveScopeLimit = limitedByScope === "collection";
const canPublish = can.update && documentAbilities.share && !hasActiveScopeLimit;
React.useEffect(() => {
setUrlId(share?.urlId);
@@ -165,7 +169,11 @@ function PublicAccess(
title={t("Web")}
subtitle={
<>
{sharedParent && !document.isDraft ? (
{hasActiveScopeLimit ? (
<Text type="secondary" size="small">
{t("Public sharing is disabled in collection")}
</Text>
) : sharedParent && !document.isDraft ? (
sharedParent.collectionId ? (
<Trans>
Anyone with the link can access because the containing