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

feat(resizable-sidebar): replace custom sidebar with resizable-panels #7274

Merged
merged 6 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
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
11 changes: 11 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ test.describe('Environment Editor', async () => {

// Add number variable to request body
await page.getByRole('tab', { name: 'Plain' }).click();
await page.locator('pre').filter({ hasText: '_.exampleObject.anotherNumber' }).click();
await page.locator('pre').filter({ hasText: '_.exampleObject.anotherNumber' }).press('Enter');

await page.getByTestId('CodeEditor').getByRole('textbox').press('Enter');
await page.getByTestId('CodeEditor').getByRole('textbox').press('Control+ ');
await page.getByText('_.testNumber').click();
Expand Down
1 change: 1 addition & 0 deletions packages/insomnia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@
"react-aria": "3.32.1",
"react-aria-components": "^1.1.1",
"react-dom": "^18.2.0",
"react-resizable-panels": "^2.0.17",
"react-router-dom": "^6.22.3",
"react-stately": "3.30.1",
"react-use": "^17.5.0",
Expand Down
11 changes: 0 additions & 11 deletions packages/insomnia/src/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,17 +143,6 @@ export const PLUGIN_HUB_BASE = 'https://insomnia.rest/plugins';
export const NPM_PACKAGE_BASE = 'https://www.npmjs.com/package';

// UI Stuf
export const MAX_SIDEBAR_REMS = 45;
export const MIN_SIDEBAR_REMS = 0.75;
export const COLLAPSE_SIDEBAR_REMS = 3;
export const SIDEBAR_SKINNY_REMS = 10;
export const MAX_PANE_WIDTH = 0.99;
export const MIN_PANE_WIDTH = 0.01;
export const MAX_PANE_HEIGHT = 0.99;
export const MIN_PANE_HEIGHT = 0.01;
export const DEFAULT_PANE_WIDTH = 0.5;
export const DEFAULT_PANE_HEIGHT = 0.5;
export const DEFAULT_SIDEBAR_WIDTH = 19;
export const MIN_INTERFACE_FONT_SIZE = 8;
export const MAX_INTERFACE_FONT_SIZE = 24;
export const MIN_EDITOR_FONT_SIZE = 8;
Expand Down
17 changes: 0 additions & 17 deletions packages/insomnia/src/models/workspace-meta.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
import {
DEFAULT_PANE_HEIGHT,
DEFAULT_PANE_WIDTH,
DEFAULT_SIDEBAR_WIDTH,
} from '../common/constants';
import { database as db } from '../common/database';
import type { BaseModel } from './index';

Expand All @@ -21,13 +16,7 @@ export interface BaseWorkspaceMeta {
cachedGitLastCommitTime: number | null;
cachedGitRepositoryBranch: string | null;
gitRepositoryId: string | null;
hasSeen: boolean;
paneHeight: number;
paneWidth: number;
parentId: string | null;
sidebarFilter: string;
sidebarHidden: boolean;
sidebarWidth: number;
pushSnapshotOnInitialize: boolean;
}

Expand All @@ -47,13 +36,7 @@ export function init(): BaseWorkspaceMeta {
cachedGitLastCommitTime: null,
cachedGitRepositoryBranch: null,
gitRepositoryId: null,
hasSeen: true,
paneHeight: DEFAULT_PANE_HEIGHT,
paneWidth: DEFAULT_PANE_WIDTH,
parentId: null,
sidebarFilter: '',
sidebarHidden: false,
sidebarWidth: DEFAULT_SIDEBAR_WIDTH,
pushSnapshotOnInitialize: false,
};
}
Expand Down
2 changes: 1 addition & 1 deletion packages/insomnia/src/ui/components/settings/general.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const General: FC = () => {
<BooleanSetting
label="Use vertical layout"
setting="forceVerticalLayout"
help="If checked, stack request and response panels vertically. Otherwise they will be side-by-side above 1200px."
help="If checked, stack request and response panels vertically. Otherwise they will be side-by-side above 880px."
/>
<BooleanSetting
label={<RestartTooltip message="Show variable source and value" />}
Expand Down
Loading
Loading