-
Notifications
You must be signed in to change notification settings - Fork 103
feat: recreate GE layout and add resizing with mouse and keyboard #3531
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
Closed
Closed
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
0e6930c
feat: Introduce Layout component and refactor App structure
musale 4bee68b
feat: Enhance Layout component with sample query handling and add Lay…
musale 04d798f
feat: Add resize functionality to Layout component with new resize ha…
musale f213121
feat: Refactor Layout and Sidebar components for improved styling and…
musale df538fe
feat: Update Layout and LayoutResizeHandler components for improved s…
musale a4123db
feat: Update layout styles and structure for improved responsiveness …
musale 5e95f9a
feat: Refactor Layout component structure and enhance notification ha…
musale 3ef0331
feat: Update layout and sidebar styles for improved visual consistenc…
musale 4ab3a3a
feat: Enhance Layout and LayoutResizeHandler components with improved…
musale 5921c64
feat: Update background color in index.html and modify hover styles i…
musale 83c0417
feat: Enhance layout styles and notification handling for improved us…
musale abf4096
feat: Remove background color from responseArea for improved design c…
musale d9a9fb2
feat: Update sidebar size to 460px for improved layout consistency
musale 85e2c40
feat: Refactor layout styles and clean up unused CSS classes for impr…
musale 4378202
feat: Remove unused Monaco styles and refactor RequestBody and Monaco…
musale 06422c9
feat: Add convertPercentToPx function and update layout resizing logi…
musale 21b896b
feat: Refactor HeadersList component to use Fluent UI Table and impro…
musale 09b9359
feat: Remove background color from RequestHeadersV9 component for imp…
musale 7e83d8a
feat: Enhance header styling in HeadersList component by making colum…
musale 8dc18b1
feat: Update HeadersList component to use index as key for TableRow m…
musale 366636a
feat: Remove unused useId import from HeadersList component
musale 1c80f69
Merge branch 'feat/fluent-v9-upgrade' into feat/ui-resize-v9
musale 9ec53d3
fix: enhance request permissions tab (#3543)
musale 49e4330
fix: improve the request body tab layout (#3540)
musale 45ebdd3
fix: improve request auth tab (#3544)
musale File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import { createContext } from 'react'; | ||
|
|
||
| interface ResizeContext { | ||
| sidebarSize: number; | ||
| responseAreaSize: number; | ||
| dragValue: number; | ||
| parentHeight: number; | ||
| initiator: string; | ||
| } | ||
|
|
||
| export const ResizeContext = createContext<ResizeContext>({} as ResizeContext); |
53 changes: 53 additions & 0 deletions
53
src/app/services/context/resize-context/ResizeProvider.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| import { ReactNode, useEffect, useMemo, useState } from 'react'; | ||
| import { ResizeContext } from './ResizeContext'; | ||
|
|
||
| interface ResizeProviderProps { | ||
| children: ReactNode; | ||
| } | ||
| export const ResizeProvider = (props: ResizeProviderProps) => { | ||
| const { children } = props; | ||
| const [sidebarSize, setSidebarSize] = useState(0); | ||
| const [responseSize, setResponseSize] = useState(0); | ||
| const [parentHeight, setParentHeight] = useState(0); | ||
| const [initiatorValue, setInitiatorValue] = useState(''); | ||
| const [dragValue, setDragValue] = useState(-1); | ||
|
|
||
| useEffect(() => { | ||
| const handleResize = (e: Event) => { | ||
| const layout = document.getElementById('layout'); | ||
| if (layout) { | ||
| const parentOffset = layout.parentElement?.offsetHeight ?? 0; | ||
| setParentHeight(parentOffset); | ||
| const customEvent = e as CustomEvent; | ||
| const { initiator, value } = customEvent.detail as { | ||
| initiator: string; | ||
| value: number; | ||
| }; | ||
| if (initiator === 'responseSize') { | ||
| setResponseSize(value); | ||
| } else if (initiator === 'sidebar') { | ||
| setSidebarSize(value); | ||
| } | ||
| setInitiatorValue(initiator); | ||
| setDragValue(value); | ||
| } | ||
| }; | ||
| window.addEventListener('onResizeDragEnd', handleResize); | ||
| return () => window.removeEventListener('resize', handleResize); | ||
| }, []); | ||
|
|
||
| const contextValue = useMemo(() => { | ||
| return { | ||
| sidebarSize, | ||
| responseAreaSize: responseSize, | ||
| parentHeight, | ||
| initiator: initiatorValue, | ||
| dragValue | ||
| }; | ||
| }, [sidebarSize, responseSize, parentHeight, initiatorValue, dragValue]); | ||
| return ( | ||
| <ResizeContext.Provider value={contextValue}> | ||
| {children} | ||
| </ResizeContext.Provider> | ||
| ); | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,93 +1,94 @@ | ||
| import { FontSizes, ITheme } from '@fluentui/react'; | ||
|
|
||
| export const appStyles = (theme: ITheme) => { | ||
| return { | ||
| app: { | ||
| background: theme.semanticColors.bodyBackground, | ||
| color: theme.semanticColors.bodyText, | ||
| paddingTop: theme.spacing.s1, | ||
| height: '100%', | ||
| paddingRight: '15px', | ||
| paddingLeft: '4px', | ||
| paddingBottom: '5px', | ||
| marginLeft: 'auto', | ||
| marginRight: 'auto' | ||
| }, | ||
| appRow: { | ||
| display: 'flex', | ||
| flexWrap: 'no-wrap', | ||
| alignItems: 'stretch' | ||
| }, | ||
| tryItMessage: { | ||
| marginBottom: theme.spacing.s1 | ||
| }, | ||
| sidebar: { | ||
| background: theme.palette.neutralLighter, | ||
| paddingRight: 10, | ||
| paddingLeft: 10, | ||
| marginRight: 10, | ||
| marginBottom: 9 | ||
| }, | ||
| sidebarMini: { | ||
| background: theme.palette.neutralLighter, | ||
| maxWidth: '65px', | ||
| minWidth: '55px', | ||
| padding: 10, | ||
| marginBottom: 9 | ||
| }, | ||
| layoutExtra: { | ||
| minWidth: '95%', | ||
| maxWidth: '96%' | ||
| }, | ||
| separator: { | ||
| borderBottom: '1px solid ' + theme.palette.neutralLight | ||
| }, | ||
| sidebarToggle: { | ||
| marginBottom: theme.spacing.s1, | ||
| marginTop: theme.spacing.s1 | ||
| }, | ||
| previewButton: { | ||
| marginTop: theme.spacing.s1 | ||
| }, | ||
| graphExplorerLabel: { | ||
| fontSize: FontSizes.xLarge, | ||
| fontWeight: 600 | ||
| }, | ||
| graphExplorerLabelContainer: { | ||
| display: 'flex', | ||
| alignItems: 'center', | ||
| justifyContent: 'space-between', | ||
| width: 500 | ||
| }, | ||
| versionLabel: { | ||
| color: theme.palette.neutralSecondary, | ||
| fontSize: '10px', | ||
| paddingLeft: 3, | ||
| paddingTop: 5 | ||
| }, | ||
| statusAreaMobileScreen: { | ||
| marginTop: 5 | ||
| }, | ||
| statusAreaFullScreen: { | ||
| marginTop: 6, | ||
| position: 'relative', | ||
| bottom: 0 | ||
| }, | ||
| vResizeHandle: { | ||
| zIndex: 1, | ||
| borderRight: '1px solid silver', | ||
| '&:hover': { | ||
| borderRight: '3px solid silver' | ||
| } | ||
| }, | ||
| feedbackButtonFullScreenDisplay: { | ||
| position: 'relative', | ||
| top: '5px' | ||
| }, | ||
| feedbackButtonMobileDisplay: { | ||
| position: 'absolute', | ||
| top: '13px', | ||
| right: '10px' | ||
| } | ||
| }; | ||
| // return { | ||
| // app: { | ||
| // background: theme.semanticColors.bodyBackground, | ||
| // color: theme.semanticColors.bodyText, | ||
| // paddingTop: theme.spacing.s1, | ||
| // height: '100%', | ||
| // paddingRight: '15px', | ||
| // paddingLeft: '4px', | ||
| // paddingBottom: '5px', | ||
| // marginLeft: 'auto', | ||
| // marginRight: 'auto' | ||
| // }, | ||
| // appRow: { | ||
| // display: 'flex', | ||
| // flexWrap: 'no-wrap', | ||
| // alignItems: 'stretch' | ||
| // }, | ||
| // tryItMessage: { | ||
| // marginBottom: theme.spacing.s1 | ||
| // }, | ||
| // sidebar: { | ||
| // background: theme.palette.neutralLighter, | ||
| // paddingRight: 10, | ||
| // paddingLeft: 10, | ||
| // marginRight: 10, | ||
| // marginBottom: 9 | ||
| // }, | ||
| // sidebarMini: { | ||
| // background: theme.palette.neutralLighter, | ||
| // maxWidth: '65px', | ||
| // minWidth: '55px', | ||
| // padding: 10, | ||
| // marginBottom: 9 | ||
| // }, | ||
| // layoutExtra: { | ||
| // minWidth: '95%', | ||
| // maxWidth: '96%' | ||
| // }, | ||
| // separator: { | ||
| // borderBottom: '1px solid ' + theme.palette.neutralLight | ||
| // }, | ||
| // sidebarToggle: { | ||
| // marginBottom: theme.spacing.s1, | ||
| // marginTop: theme.spacing.s1 | ||
| // }, | ||
| // previewButton: { | ||
| // marginTop: theme.spacing.s1 | ||
| // }, | ||
| // graphExplorerLabel: { | ||
| // fontSize: FontSizes.xLarge, | ||
| // fontWeight: 600 | ||
| // }, | ||
| // graphExplorerLabelContainer: { | ||
| // display: 'flex', | ||
| // alignItems: 'center', | ||
| // justifyContent: 'space-between', | ||
| // width: 500 | ||
| // }, | ||
| // versionLabel: { | ||
| // color: theme.palette.neutralSecondary, | ||
| // fontSize: '10px', | ||
| // paddingLeft: 3, | ||
| // paddingTop: 5 | ||
| // }, | ||
| // statusAreaMobileScreen: { | ||
| // marginTop: 5 | ||
| // }, | ||
| // statusAreaFullScreen: { | ||
| // marginTop: 6, | ||
| // position: 'relative', | ||
| // bottom: 0 | ||
| // }, | ||
| // vResizeHandle: { | ||
| // zIndex: 1, | ||
| // borderRight: '1px solid silver', | ||
| // '&:hover': { | ||
| // borderRight: '3px solid silver' | ||
| // } | ||
| // }, | ||
| // feedbackButtonFullScreenDisplay: { | ||
| // position: 'relative', | ||
| // top: '5px' | ||
| // }, | ||
| // feedbackButtonMobileDisplay: { | ||
| // position: 'absolute', | ||
| // top: '13px', | ||
| // right: '10px' | ||
| // } | ||
| // }; | ||
| return {} | ||
| }; | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need to keep this since most of it is commented out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nah, we don't need it. All commented out code is to be removed. On it.