mirror of
https://github.com/OFFIS-ESC/constellation-analyzer
synced 2026-01-27 15:53:42 +00:00
refactor: remove edit properties from context menus
Removed the "Edit Properties" option from both node and edge context menus, leaving only the "Delete" option. Users can simply click on nodes/edges to select them and edit properties in the right panel, making the context menu option redundant. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
ae334efd34
commit
d6f5938c9c
1 changed files with 0 additions and 39 deletions
|
|
@ -31,7 +31,6 @@ import CustomEdge from "../Edges/CustomEdge";
|
||||||
import ContextMenu from "./ContextMenu";
|
import ContextMenu from "./ContextMenu";
|
||||||
import EmptyState from "../Common/EmptyState";
|
import EmptyState from "../Common/EmptyState";
|
||||||
import { createNode } from "../../utils/nodeUtils";
|
import { createNode } from "../../utils/nodeUtils";
|
||||||
import EditIcon from "@mui/icons-material/Edit";
|
|
||||||
import DeleteIcon from "@mui/icons-material/Delete";
|
import DeleteIcon from "@mui/icons-material/Delete";
|
||||||
import { useConfirm } from "../../hooks/useConfirm";
|
import { useConfirm } from "../../hooks/useConfirm";
|
||||||
|
|
||||||
|
|
@ -621,25 +620,6 @@ const GraphEditor = ({ onNodeSelect, onEdgeSelect, onAddNodeRequest }: GraphEdit
|
||||||
sections={[
|
sections={[
|
||||||
{
|
{
|
||||||
actions: [
|
actions: [
|
||||||
{
|
|
||||||
label: "Edit Properties",
|
|
||||||
icon: <EditIcon fontSize="small" />,
|
|
||||||
onClick: () => {
|
|
||||||
// Select the node in ReactFlow (which will trigger the right panel)
|
|
||||||
const nodeId = contextMenu.target!.id;
|
|
||||||
const updatedNodes = nodes.map((n) => ({
|
|
||||||
...n,
|
|
||||||
selected: n.id === nodeId,
|
|
||||||
}));
|
|
||||||
const updatedEdges = edges.map((e) => ({
|
|
||||||
...e,
|
|
||||||
selected: false,
|
|
||||||
}));
|
|
||||||
setNodesState(updatedNodes as Node[]);
|
|
||||||
setEdgesState(updatedEdges as Edge[]);
|
|
||||||
setContextMenu(null);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
label: "Delete",
|
label: "Delete",
|
||||||
icon: <DeleteIcon fontSize="small" />,
|
icon: <DeleteIcon fontSize="small" />,
|
||||||
|
|
@ -672,25 +652,6 @@ const GraphEditor = ({ onNodeSelect, onEdgeSelect, onAddNodeRequest }: GraphEdit
|
||||||
sections={[
|
sections={[
|
||||||
{
|
{
|
||||||
actions: [
|
actions: [
|
||||||
{
|
|
||||||
label: "Edit Properties",
|
|
||||||
icon: <EditIcon fontSize="small" />,
|
|
||||||
onClick: () => {
|
|
||||||
// Select the edge in ReactFlow (which will trigger the right panel)
|
|
||||||
const edgeId = contextMenu.target!.id;
|
|
||||||
const updatedEdges = edges.map((e) => ({
|
|
||||||
...e,
|
|
||||||
selected: e.id === edgeId,
|
|
||||||
}));
|
|
||||||
const updatedNodes = nodes.map((n) => ({
|
|
||||||
...n,
|
|
||||||
selected: false,
|
|
||||||
}));
|
|
||||||
setEdgesState(updatedEdges as Edge[]);
|
|
||||||
setNodesState(updatedNodes as Node[]);
|
|
||||||
setContextMenu(null);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
label: "Delete",
|
label: "Delete",
|
||||||
icon: <DeleteIcon fontSize="small" />,
|
icon: <DeleteIcon fontSize="small" />,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue