From 512e0473dfac04d2aeb8c01ef064ea2f5fd3ab71 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 6 Feb 2026 01:16:44 +0000 Subject: [PATCH] Address PR feedback: use fetchAll, simplify UI, use history.push Co-authored-by: tommoor <380914+tommoor@users.noreply.github.com> --- .../Settings/components/GroupDialogs.tsx | 23 ++++++------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/app/scenes/Settings/components/GroupDialogs.tsx b/app/scenes/Settings/components/GroupDialogs.tsx index 13e079f1e2..412f345ea7 100644 --- a/app/scenes/Settings/components/GroupDialogs.tsx +++ b/app/scenes/Settings/components/GroupDialogs.tsx @@ -2,7 +2,8 @@ import debounce from "lodash/debounce"; import { observer } from "mobx-react"; import { PlusIcon } from "outline-icons"; import * as React from "react"; -import { Trans, useTranslation } from "react-i18next"; +import { useTranslation } from "react-i18next"; +import { useHistory } from "react-router-dom"; import { toast } from "sonner"; import styled from "styled-components"; import type { NavigationNode } from "@shared/types"; @@ -336,6 +337,7 @@ export const ViewGroupAccessDialog = observer(function ({ }: Pick) { const { collections, documents, groupMemberships } = useStores(); const { t } = useTranslation(); + const history = useHistory(); const [selectedNode, setSelectedNode] = React.useState( null ); @@ -346,11 +348,8 @@ export const ViewGroupAccessDialog = observer(function ({ const fetchMemberships = async () => { try { setIsLoading(true); - // Fetch with a high limit to get all memberships - // TODO: Implement proper pagination if groups commonly have >1000 access items - await groupMemberships.fetchPage({ + await groupMemberships.fetchAll({ groupId: group.id, - limit: 1000, }); } catch (_err) { toast.error(t("Failed to load group access")); @@ -436,9 +435,9 @@ export const ViewGroupAccessDialog = observer(function ({ const handleOpen = React.useCallback(() => { if (selectedNode) { - window.open(selectedNode.url, "_blank"); + history.push(selectedNode.url); } - }, [selectedNode]); + }, [selectedNode, history]); if (isLoading) { return ( @@ -465,15 +464,7 @@ export const ViewGroupAccessDialog = observer(function ({ />