diff --git a/frontend/src/components/SearchData.jsx b/frontend/src/components/SearchData.jsx index 01f619bf..de209b4b 100644 --- a/frontend/src/components/SearchData.jsx +++ b/frontend/src/components/SearchData.jsx @@ -1,7 +1,7 @@ import React, { useState, useEffect, useRef, useContext } from 'react'; import {getTheme} from '../theme.jsx'; -import { useNavigate, Link, useParams } from "react-router-dom"; +import { useNavigate, Link, useParams, useLocation } from "react-router-dom"; import { toast } from "react-toastify" import { @@ -102,7 +102,8 @@ const SearchData = props => { // setModalOpen(false); const trimmedValue = inputValue.trim(); if (trimmedValue !== '') { - navigate(`/search?q=${trimmedValue}`, { state: trimmedValue, replace: true }); + // Navigate to the search page (keep modal open by passing state) + navigate(`/search`, { state: trimmedValue, replace: true }); setSearchBarModalOpen(false); } } @@ -916,7 +917,7 @@ const SearchData = props => { - + diff --git a/frontend/src/views/AngularWorkflow.jsx b/frontend/src/views/AngularWorkflow.jsx index b39f22dd..f1a87e7f 100755 --- a/frontend/src/views/AngularWorkflow.jsx +++ b/frontend/src/views/AngularWorkflow.jsx @@ -25249,7 +25249,7 @@ const AngularWorkflow = (defaultprops) => { elements={elements} minZoom={0.35} maxZoom={2.0} - wheelSensitivity={0.25} + userZoomingEnabled={false} style={{ width: workflow?.public && !isLoggedIn ? cytoscapeWidth + 50 : cytoscapeWidth, height: workflow?.public && !isLoggedIn ? (bodyHeight - 50) : bodyHeight - 2, @@ -25264,6 +25264,33 @@ const AngularWorkflow = (defaultprops) => { // FIXME: There's something specific loading when // you do the first hover of a node. Why is this different? + // Custom wheel handler for sensitivity for same zoom in and zoom out effect with mouse and touch pad + const container = incy.container(); + if (container && !container._customWheelHandler) { + container._customWheelHandler = true; + container.addEventListener('wheel', (e) => { + e.preventDefault(); + const sensitivity = 0.25; + + const zoomFactor = Math.pow(10, -e.deltaY * sensitivity / 500); + const currentZoom = incy.zoom(); + let newZoom = currentZoom * zoomFactor; + + newZoom = Math.max(0.35, Math.min(2.0, newZoom)); + + // Zoom towards cursor position + const rect = container.getBoundingClientRect(); + const position = { + x: e.clientX - rect.left, + y: e.clientY - rect.top + }; + + incy.zoom({ + level: newZoom, + renderedPosition: position + }); + }, { passive: false }); + } setCy(incy); }} diff --git a/frontend/src/views/AppExplorer.jsx b/frontend/src/views/AppExplorer.jsx index 21a1d24e..1a169020 100644 --- a/frontend/src/views/AppExplorer.jsx +++ b/frontend/src/views/AppExplorer.jsx @@ -65,6 +65,7 @@ import { Context } from "../context/ContextApi.jsx"; import { SearchBox, + StaticRefinementList, RefinementList, InstantSearch, connectSearchBox, @@ -1452,11 +1453,12 @@ const buttonBackground = "linear-gradient(to right, #f86a3e, #f34079)"; const index = searchClient.initIndex("appsearch"); console.log("Running appsearch for: ", appname); - if (appname === "integration") { + if (appname === "integration" || appname == "singul") { // Redirect to https://singul.io window.location.href = "https://singul.io" - } else if (appname === "shuffle_agent") { + } else if (appname === "shuffle_agent" || appname === "agent" || appname === "agents" || appname == "shuffle-agent") { navigate("/agents") + return } index diff --git a/frontend/src/views/UpdateAuthentication.jsx b/frontend/src/views/UpdateAuthentication.jsx index 9f4702ea..18d9369b 100644 --- a/frontend/src/views/UpdateAuthentication.jsx +++ b/frontend/src/views/UpdateAuthentication.jsx @@ -107,7 +107,7 @@ const SetAuthentication = (props) => { // Set the orgsession to be a cookie for __session cookie setTimeout(() => { - document.cookie = "__session=" + orgsession + "; path=/; max-age=1800"; // Cookie expires in 30 min + document.cookie = "__session=" + orgsession + "; path=/; max-age=1800; SameSite=Lax"; // Cookie expires in 30 min }, 1000) }