feat: функционал скрытия подписей + fix: build output в корневой dist/
All checks were successful
continuous-integration/drone/push Build is passing

- Свитч «Подписи» в тулбаре теперь скрывает/показывает подписи
  на линиях и портах через visibility toggle
- vite outDir перенесён в ../dist для совместимости с react.Dockerfile

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Alina
2026-02-17 22:58:28 +03:00
parent fd6373bcb0
commit b877750ecf
2 changed files with 42 additions and 1 deletions

View File

@ -189,7 +189,7 @@ export function SchemaCanvas() {
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
}, []); }, []);
// Sync display settings // Sync display settings: grid
useEffect(() => { useEffect(() => {
const graph = useSchemaStore.getState().graph; const graph = useSchemaStore.getState().graph;
if (!graph) return; if (!graph) return;
@ -201,6 +201,45 @@ export function SchemaCanvas() {
} }
}, [displaySettings.showGrid]); }, [displaySettings.showGrid]);
// Sync display settings: labels
useEffect(() => {
const graph = useSchemaStore.getState().graph;
if (!graph) return;
const show = displaySettings.showLabels;
// Toggle edge labels
for (const edge of graph.getEdges()) {
const labels = edge.getLabels();
if (labels.length > 0) {
edge.setLabels(
labels.map((label) => ({
...label,
attrs: {
...label.attrs,
label: {
...(label.attrs?.label as Record<string, unknown>),
visibility: show ? 'visible' : 'hidden',
},
rect: {
...(label.attrs?.rect as Record<string, unknown>),
visibility: show ? 'visible' : 'hidden',
},
},
})),
);
}
}
// Toggle port labels
for (const node of graph.getNodes()) {
const ports = node.getPorts();
for (const port of ports) {
node.setPortProp(port.id!, 'attrs/text/visibility', show ? 'visible' : 'hidden');
}
}
}, [displaySettings.showLabels]);
return ( return (
<div style={{ position: 'relative', width: '100%', height: '100%' }}> <div style={{ position: 'relative', width: '100%', height: '100%' }}>
<div <div

View File

@ -4,6 +4,8 @@ import react from '@vitejs/plugin-react'
export default defineConfig({ export default defineConfig({
plugins: [react()], plugins: [react()],
build: { build: {
outDir: '../dist',
emptyOutDir: true,
rollupOptions: { rollupOptions: {
output: { output: {
manualChunks: { manualChunks: {