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

hack structured feedback #2748

Closed
wants to merge 16 commits into from
Prev Previous commit
Next Next commit
cleaning
  • Loading branch information
gtarpenning committed Oct 25, 2024
commit 615270b6bf0f97bd529656f8cfc0f0d9a49cfa8a
4 changes: 2 additions & 2 deletions weave-js/src/components/Icon/Icon.tsx
Original file line number Diff line number Diff line change
@@ -125,6 +125,7 @@ import {ReactComponent as ImportLogoColab} from '../../assets/icons/icon-logo-co
import {ReactComponent as ImportMagicWandStar} from '../../assets/icons/icon-magic-wand-star.svg';
import {ReactComponent as ImportMagicWandStick} from '../../assets/icons/icon-magic-wand-stick.svg';
import {ReactComponent as ImportMarkdown} from '../../assets/icons/icon-markdown.svg';
import {ReactComponent as ImportMarker} from '../../assets/icons/icon-marker.svg';
import {ReactComponent as ImportMenu} from '../../assets/icons/icon-menu.svg';
import {ReactComponent as ImportMicrophoneAudio} from '../../assets/icons/icon-microphone-audio.svg';
import {ReactComponent as ImportMillerColumns} from '../../assets/icons/icon-miller-columns.svg';
@@ -170,6 +171,7 @@ import {ReactComponent as ImportRedditSocial} from '../../assets/icons/icon-redd
import {ReactComponent as ImportRedo} from '../../assets/icons/icon-redo.svg';
import {ReactComponent as ImportRegex} from '../../assets/icons/icon-regex.svg';
import {ReactComponent as ImportRegistries} from '../../assets/icons/icon-registries.svg';
import {ReactComponent as ImportReloadRefresh} from '../../assets/icons/icon-reload-refresh.svg';
import {ReactComponent as ImportRemove} from '../../assets/icons/icon-remove.svg';
import {ReactComponent as ImportRemoveAlt} from '../../assets/icons/icon-remove-alt.svg';
import {ReactComponent as ImportReport} from '../../assets/icons/icon-report.svg';
@@ -249,8 +251,6 @@ import {ReactComponent as ImportXAxiAlt} from '../../assets/icons/icon-x-axi-alt
import {ReactComponent as ImportXAxis} from '../../assets/icons/icon-x-axis.svg';
import {ReactComponent as ImportYoutubeSocial} from '../../assets/icons/icon-youtube-social.svg';
import {ReactComponent as ImportZoomInTool} from '../../assets/icons/icon-zoom-in-tool.svg';
import {ReactComponent as ImportMarker} from '../../assets/icons/icon-marker.svg';
import {ReactComponent as ImportReloadRefresh} from '../../assets/icons/icon-reload-refresh.svg';
import {IconName} from './types';

type SVGIconProps = SVGProps<SVGElement>;
Original file line number Diff line number Diff line change
@@ -18,7 +18,6 @@ import {
ObjectVersionKey,
OpVersionKey,
} from '../Browse3/pages/wfReactInterface/wfDataModelHooksInterface';
import { useApolloClient } from '@apollo/client';

const getRootType = (t: Type): Type => {
if (
176 changes: 85 additions & 91 deletions weave-js/src/components/PagePanelComponents/Home/Browse3.tsx
Original file line number Diff line number Diff line change
@@ -30,7 +30,6 @@ import React, {
useMemo,
useRef,
useState,
useContext,
} from 'react';
import useMousetrap from 'react-hook-mousetrap';
import {
@@ -183,7 +182,10 @@ const CallIdProvider: FC<{children: React.ReactNode}> = ({children}) => {
const getNextCallId = useCallback(
(currentId: string) => {
const currentIndex = callIds.indexOf(currentId);
if (currentIndex === callIds.length - 1 && callIds.length === DEFAULT_PAGE_SIZE) {
if (
currentIndex === callIds.length - 1 &&
callIds.length === DEFAULT_PAGE_SIZE
) {
setNextPageNeeded(true);
} else if (currentIndex !== -1) {
return callIds[currentIndex + 1];
@@ -193,7 +195,7 @@ const CallIdProvider: FC<{children: React.ReactNode}> = ({children}) => {
}
return null;
},
[callIds]
[callIds, nextPageNeeded]
);

const getPreviousCallId = useCallback(
@@ -205,7 +207,8 @@ const CallIdProvider: FC<{children: React.ReactNode}> = ({children}) => {
);

return (
<CallIdContext.Provider value={{setCallIds, getNextCallId, getPreviousCallId, nextPageNeeded}}>
<CallIdContext.Provider
value={{setCallIds, getNextCallId, getPreviousCallId, nextPageNeeded}}>
{children}
</CallIdContext.Provider>
);
@@ -390,88 +393,88 @@ const MainPeekingLayout: FC = () => {
<CallIdProvider>
<Box
sx={{
flex: '1 1 auto',
width: '100%',
height: '100%',
display: 'flex',
overflow: 'hidden',
flexDirection: 'row',
alignContent: 'stretch',
}}>
<Box
sx={{
flex: '1 1 40%',
overflow: 'hidden',
flex: '1 1 auto',
width: '100%',
height: '100%',
display: 'flex',
marginRight: !isDrawerOpen ? 0 : `${drawerWidthPx}px`,
overflow: 'hidden',
flexDirection: 'row',
alignContent: 'stretch',
}}>
<Browse3ProjectRoot projectRoot={baseRouterProjectRoot} />
</Box>

<Drawer
variant="persistent"
anchor="right"
open={isDrawerOpen}
onClose={closePeek}
PaperProps={{
ref: drawerRef,
style: {
<Box
sx={{
flex: '1 1 40%',
overflow: 'hidden',
display: isDrawerOpen ? 'flex' : 'none',
zIndex: 1,
width: isDrawerOpen ? `${drawerWidthPx}px` : 0,
height: '100%',
borderLeft: '1px solid #e0e0e0',
position: 'absolute',
pointerEvents: isDragging ? 'none' : 'auto',
},
}}
ModalProps={{
keepMounted: true,
}}>
<div
id="dragger"
onMouseDown={handleDragStart}
style={{
position: 'absolute',
top: 0,
bottom: 0,
left: 0,
width: '5px',
cursor: 'col-resize',
zIndex: 2,
display: 'flex',
marginRight: !isDrawerOpen ? 0 : `${drawerWidthPx}px`,
}}>
<Browse3ProjectRoot projectRoot={baseRouterProjectRoot} />
</Box>

<Drawer
variant="persistent"
anchor="right"
open={isDrawerOpen}
onClose={closePeek}
PaperProps={{
ref: drawerRef,
style: {
overflow: 'hidden',
display: isDrawerOpen ? 'flex' : 'none',
zIndex: 1,
width: isDrawerOpen ? `${drawerWidthPx}px` : 0,
height: '100%',
borderLeft: '1px solid #e0e0e0',
position: 'absolute',
pointerEvents: isDragging ? 'none' : 'auto',
},
}}
/>
{peekLocation && (
<WeaveflowPeekContext.Provider value={{isPeeking: true}}>
<SimplePageLayoutContext.Provider
value={{
headerSuffix: (
<Box sx={{flex: '0 0 auto'}}>
<FullPageButton
query={query}
generalBase={generalBase}
targetBase={targetBase}
/>
<Button
tooltip="Close drawer"
icon="close"
variant="ghost"
className="ml-4"
onClick={closePeek}
/>
</Box>
),
}}>
<Browse3ProjectRoot
customLocation={peekLocation}
projectRoot={generalProjectRoot}
/>
</SimplePageLayoutContext.Provider>
</WeaveflowPeekContext.Provider>
)}
</Drawer>
</Box>
ModalProps={{
keepMounted: true,
}}>
<div
id="dragger"
onMouseDown={handleDragStart}
style={{
position: 'absolute',
top: 0,
bottom: 0,
left: 0,
width: '5px',
cursor: 'col-resize',
zIndex: 2,
}}
/>
{peekLocation && (
<WeaveflowPeekContext.Provider value={{isPeeking: true}}>
<SimplePageLayoutContext.Provider
value={{
headerSuffix: (
<Box sx={{flex: '0 0 auto'}}>
<FullPageButton
query={query}
generalBase={generalBase}
targetBase={targetBase}
/>
<Button
tooltip="Close drawer"
icon="close"
variant="ghost"
className="ml-4"
onClick={closePeek}
/>
</Box>
),
}}>
<Browse3ProjectRoot
customLocation={peekLocation}
projectRoot={generalProjectRoot}
/>
</SimplePageLayoutContext.Provider>
</WeaveflowPeekContext.Provider>
)}
</Drawer>
</Box>
</CallIdProvider>
</WFDataModelAutoProvider>
);
@@ -832,14 +835,6 @@ const CallsPageBinding = () => {
history.push({search: newQuery.toString()});
};

// const {setCallIds} = useContext(CallIdContext);

// useEffect(() => {
// // Assume fetchCallIds is a function that fetches the list of call IDs
// const callIds = fetchCallIds();
// setCallIds(callIds);
// }, [setCallIds]);

return (
<CallsPage
entity={entity}
@@ -1139,4 +1134,3 @@ const Browse3Breadcrumbs: FC = props => {
</Breadcrumbs>
);
};

Loading
Loading