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

fix: Updated highlight styling and tool selection to match spec [PT-188319491] #70

Merged
merged 1 commit into from
Sep 27, 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
3 changes: 2 additions & 1 deletion src/components/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,10 @@
}
}
.sequences {
padding: 5px;
padding: 5px 0;

.sequence {
padding: 0 5px;
cursor: pointer;

&.highlighted {
Expand Down
3 changes: 3 additions & 0 deletions src/components/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,8 @@ export const App = () => {
}
}, [highlightOutput, setHighlightOutput, setSelectedNodeId]);

const handleClearHighlightOutput = () => setHighlightOutput(undefined);

const uiForGenerate = () => {
const playLabel = generationMode === "playing" ? "Pause" : (generationMode === "paused" ? "Resume" : "Play");
const PlayOrPauseIcon = generationMode === "playing" ? PauseIcon : PlayIcon;
Expand Down Expand Up @@ -624,6 +626,7 @@ export const App = () => {
fitViewAt={fitViewAt}
recenterViewAt={recenterViewAt}
onDimensions={handleDimensionChange}
onClearHighlightOutput={handleClearHighlightOutput}
/>
:
<Dataset
Expand Down
4 changes: 3 additions & 1 deletion src/components/drawing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ interface Props {
onFitView: () => void;
onRecenterView: () => void;
onDimensions?: (dimensions: {width: number, height: number}) => void;
onClearHighlightOutput?: () => void;
}

const keepPunctuationRegex = /[.,?!:;]/g;
Expand All @@ -41,7 +42,7 @@ const removePunctuationRegex = /["(){}[\]_+=|\\/><]/g;
export const Drawing = (props: Props) => {
const {highlightNode, highlightLoopOnNode, highlightEdge, highlightAllNextNodes, highlightOutputNodes,
graph, setGraph, setHighlightNode, setSelectedNodeId: _setSelectedNodeId,
fitViewAt, recenterViewAt,
fitViewAt, recenterViewAt, onClearHighlightOutput,
selectedNodeId, animating, onReset, onReturnToMainMenu, onFitView, onRecenterView} = props;
const [drawingMode, setDrawingMode] = useState<DrawingMode>("select");
const [firstEdgeNode, setFirstEdgeNode] = useState<Node|undefined>(undefined);
Expand Down Expand Up @@ -120,6 +121,7 @@ export const Drawing = (props: Props) => {
}, [drawingMode, textAreaRef]);

const handleToolSelected = (tool: Tool) => {
onClearHighlightOutput?.();
if (drawingTools.includes(tool)) {
setDrawingMode(tool as DrawingMode);
setAutoArrange(tool === "addText");
Expand Down
Loading