Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can toggle selected folder #7639

Merged
merged 1 commit into from
Jul 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 16 additions & 18 deletions packages/insomnia/src/ui/routes/debug.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,6 @@ export const Debug: FC = () => {
className="px-1 flex-1"
onSingleClick={() => {
if (item && isRequestGroup(item.doc)) {
groupMetaPatcher(item.doc._id, { collapsed: !item.collapsed });
navigate(`/organization/${organizationId}/project/${projectId}/workspace/${workspaceId}/debug/request-group/${item.doc._id}?${searchParams.toString()}`);
} else {
navigate(
Expand Down Expand Up @@ -1019,20 +1018,15 @@ export const Debug: FC = () => {
selectedKeys={requestId && [requestId] || requestGroupId && [requestGroupId]}
selectionMode="single"
onSelectionChange={keys => {
if (keys !== 'all') {
const value = keys.values().next().value;

const item = collection.find(
item => item.doc._id === value
);
if (item && isRequestGroup(item.doc)) {
groupMetaPatcher(value, { collapsed: !item.collapsed });
} else {
navigate(
`/organization/${organizationId}/project/${projectId}/workspace/${workspaceId}/debug/request/${value}?${searchParams.toString()}`
);
}
if (keys === 'all') {
return;
}
const value = keys.values().next().value;
if (isRequestGroupId(value)) {
navigate(`/organization/${organizationId}/project/${projectId}/workspace/${workspaceId}/debug/request-group/${value}?${searchParams.toString()}`);
return;
}
navigate(`/organization/${organizationId}/project/${projectId}/workspace/${workspaceId}/debug/request/${value}?${searchParams.toString()}`);
}}
>
{virtualItem => {
Expand Down Expand Up @@ -1095,10 +1089,14 @@ export const Debug: FC = () => {
</span>
)}
{isRequestGroup(item.doc) && (
<Icon
className="w-6 flex-shrink-0"
icon={item.collapsed ? 'folder' : 'folder-open'}
/>
<Button
onPress={() => groupMetaPatcher(item.doc._id, { collapsed: !item.collapsed })}
>
<Icon
className="w-6 flex-shrink-0"
icon={item.collapsed ? 'folder' : 'folder-open'}
/>
</Button>
)}
<EditableInput
value={getRequestNameOrFallback(item.doc)}
Expand Down
Loading