fix: revert ALL new browser changes
This commit is contained in:
@@ -140,8 +140,8 @@ const Canvas = ({ width, height, onCreateRef }: CanvasProps) => {
|
|||||||
<canvas
|
<canvas
|
||||||
tabIndex={0}
|
tabIndex={0}
|
||||||
ref={canvasRef}
|
ref={canvasRef}
|
||||||
height={300}
|
height={720}
|
||||||
width={900}
|
width={1280}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -360,15 +360,15 @@ export const BrowserWindow = () => {
|
|||||||
<Highlighter
|
<Highlighter
|
||||||
unmodifiedRect={highlighterData?.rect}
|
unmodifiedRect={highlighterData?.rect}
|
||||||
displayedSelector={highlighterData?.selector}
|
displayedSelector={highlighterData?.selector}
|
||||||
width={900}
|
width={width}
|
||||||
height={300}
|
height={height}
|
||||||
canvasRect={canvasRef.current.getBoundingClientRect()}
|
canvasRect={canvasRef.current.getBoundingClientRect()}
|
||||||
/>
|
/>
|
||||||
: null}
|
: null}
|
||||||
<Canvas
|
<Canvas
|
||||||
onCreateRef={setCanvasReference}
|
onCreateRef={setCanvasReference}
|
||||||
width={900}
|
width={width}
|
||||||
height={300}
|
height={height}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@@ -383,7 +383,7 @@ const drawImage = (image: string, canvas: HTMLCanvasElement): void => {
|
|||||||
img.src = image;
|
img.src = image;
|
||||||
img.onload = () => {
|
img.onload = () => {
|
||||||
URL.revokeObjectURL(img.src);
|
URL.revokeObjectURL(img.src);
|
||||||
ctx?.drawImage(img, 0, 0, 900, 300);
|
ctx?.drawImage(img, 0, 0, 1280, 720);
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
export const VIEWPORT_W = 900;
|
export const VIEWPORT_W = 1280;
|
||||||
export const VIEWPORT_H = 300;
|
export const VIEWPORT_H = 720;
|
||||||
|
|
||||||
export const ONE_PERCENT_OF_VIEWPORT_W = VIEWPORT_W / 100;
|
export const ONE_PERCENT_OF_VIEWPORT_W = VIEWPORT_W / 100;
|
||||||
export const ONE_PERCENT_OF_VIEWPORT_H = VIEWPORT_H / 100;
|
export const ONE_PERCENT_OF_VIEWPORT_H = VIEWPORT_H / 100;
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ interface BrowserDimensions {
|
|||||||
};
|
};
|
||||||
|
|
||||||
class BrowserDimensionsStore implements Partial<BrowserDimensions>{
|
class BrowserDimensionsStore implements Partial<BrowserDimensions>{
|
||||||
width: number = 900;
|
width: number = 1280;
|
||||||
height: number = 300;
|
height: number = 720;
|
||||||
};
|
};
|
||||||
|
|
||||||
const browserDimensionsStore = new BrowserDimensionsStore();
|
const browserDimensionsStore = new BrowserDimensionsStore();
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import React, { useCallback, useEffect, useState } from 'react';
|
import React, { useCallback, useEffect, useState } from 'react';
|
||||||
import { Grid, Box } from '@mui/material';
|
import { Grid } from '@mui/material';
|
||||||
import { BrowserContent } from "../components/organisms/BrowserContent";
|
import { BrowserContent } from "../components/organisms/BrowserContent";
|
||||||
import { InterpretationLog } from "../components/molecules/InterpretationLog";
|
import { InterpretationLog } from "../components/molecules/InterpretationLog";
|
||||||
import { startRecording, getActiveBrowserId } from "../api/recording";
|
import { startRecording, getActiveBrowserId } from "../api/recording";
|
||||||
|
import { LeftSidePanel } from "../components/organisms/LeftSidePanel";
|
||||||
import { RightSidePanel } from "../components/organisms/RightSidePanel";
|
import { RightSidePanel } from "../components/organisms/RightSidePanel";
|
||||||
import { Loader } from "../components/atoms/Loader";
|
import { Loader } from "../components/atoms/Loader";
|
||||||
import { useSocketStore } from "../context/socket";
|
import { useSocketStore } from "../context/socket";
|
||||||
@@ -34,6 +35,7 @@ export const RecordingPage = ({ recordingName }: RecordingPageProps) => {
|
|||||||
const [showOutputData, setShowOutputData] = useState(false);
|
const [showOutputData, setShowOutputData] = useState(false);
|
||||||
|
|
||||||
const browserContentRef = React.useRef<HTMLDivElement>(null);
|
const browserContentRef = React.useRef<HTMLDivElement>(null);
|
||||||
|
const workflowListRef = React.useRef<HTMLDivElement>(null);
|
||||||
|
|
||||||
const { setId, socket } = useSocketStore();
|
const { setId, socket } = useSocketStore();
|
||||||
const { setWidth } = useBrowserDimensionsStore();
|
const { setWidth } = useBrowserDimensionsStore();
|
||||||
@@ -50,7 +52,7 @@ export const RecordingPage = ({ recordingName }: RecordingPageProps) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// useEffect(() => changeBrowserDimensions(), [isLoaded])
|
useEffect(() => changeBrowserDimensions(), [isLoaded])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let isCancelled = false;
|
let isCancelled = false;
|
||||||
@@ -111,19 +113,27 @@ export const RecordingPage = ({ recordingName }: RecordingPageProps) => {
|
|||||||
return (
|
return (
|
||||||
<ActionProvider>
|
<ActionProvider>
|
||||||
<BrowserStepsProvider>
|
<BrowserStepsProvider>
|
||||||
<Box sx={{ flexGrow: 1 }}>
|
<div>
|
||||||
{isLoaded ? (
|
{isLoaded ?
|
||||||
<Grid container spacing={1}>
|
<Grid container direction="row" spacing={0}>
|
||||||
<Grid id="browser-content" ref={browserContentRef} item xs={9}>
|
<Grid item xs={2} ref={workflowListRef} style={{ display: "flex", flexDirection: "row" }}>
|
||||||
|
<LeftSidePanel
|
||||||
|
sidePanelRef={workflowListRef.current}
|
||||||
|
alreadyHasScrollbar={hasScrollbar}
|
||||||
|
recordingName={recordingName ? recordingName : ''}
|
||||||
|
handleSelectPairForEdit={handleSelectPairForEdit}
|
||||||
|
/>
|
||||||
|
</Grid>
|
||||||
|
<Grid id="browser-content" ref={browserContentRef} item xs>
|
||||||
<BrowserContent />
|
<BrowserContent />
|
||||||
<InterpretationLog isOpen={showOutputData} setIsOpen={setShowOutputData} />
|
<InterpretationLog isOpen={showOutputData} setIsOpen={setShowOutputData} />
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={3}>
|
<Grid item xs={2}>
|
||||||
<RightSidePanel onFinishCapture={handleShowOutputData} />
|
<RightSidePanel onFinishCapture={handleShowOutputData} />
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
) : <Loader />}
|
: <Loader />}
|
||||||
</Box>
|
</div>
|
||||||
</BrowserStepsProvider>
|
</BrowserStepsProvider>
|
||||||
</ActionProvider>
|
</ActionProvider>
|
||||||
);
|
);
|
||||||
@@ -135,23 +145,3 @@ const RecordingPageWrapper = styled.div`
|
|||||||
height: 100vh;
|
height: 100vh;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
// Fixed grid container to ensure elements stay next to each other
|
|
||||||
const FixedGridContainer = styled(Grid)`
|
|
||||||
display: flex;
|
|
||||||
height: 100vh;
|
|
||||||
overflow: hidden;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: stretch;
|
|
||||||
|
|
||||||
#browser-content {
|
|
||||||
flex: 1;
|
|
||||||
position: relative;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.MuiGrid-item {
|
|
||||||
position: relative;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|||||||
Reference in New Issue
Block a user