Skip to content
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
4 changes: 2 additions & 2 deletions client-v3/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client-v3/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "client-v3",
"version": "0.30.6",
"version": "0.30.7",
"description": "DigiScript front end (Vue 3)",
"author": "DreamTeamProd",
"private": true,
Expand Down
24 changes: 19 additions & 5 deletions client-v3/src/components/show/config/script/RevisionGraph.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="revision-graph-container">
<div ref="containerRef" class="revision-graph-container">
<div v-if="!hasRevisions" class="text-center py-5 text-muted">No revisions to display</div>
<div v-else class="graph-wrapper">
<svg ref="svgRef" :width="width" :height="height" class="revision-graph">
Expand Down Expand Up @@ -74,6 +74,7 @@ const props = defineProps<{

defineEmits<{ 'node-click': [revision: ScriptRevision] }>();

const containerRef = ref<HTMLElement | null>(null);
const svgRef = ref<SVGSVGElement | null>(null);
const zoomGroupRef = ref<SVGGElement | null>(null);
const width = ref(800);
Expand All @@ -83,6 +84,7 @@ const nodeRadius = 8;

// D3 state — NOT in Vue reactive state (would cause infinite loops)
let zoomBehavior: ReturnType<typeof d3zoom> | null = null;
let resizeObserver: ResizeObserver | null = null;

const hasRevisions = computed(() => props.revisions.length > 0);

Expand Down Expand Up @@ -136,7 +138,7 @@ function linkPath(link: any): string {
}

function updateWidth(): void {
const container = svgRef.value?.parentElement as HTMLElement | null;
const container = containerRef.value;
if (container) width.value = container.clientWidth || 800;
}

Expand Down Expand Up @@ -201,15 +203,24 @@ function resetZoom(): void {

onMounted(() => {
updateWidth();
window.addEventListener('resize', updateWidth);
nextTick(() => {
initZoom();
fitToContent();
});
if (containerRef.value) {
resizeObserver = new ResizeObserver(() => {
updateWidth();
nextTick(() => {
if (zoomBehavior) fitToContent();
});
});
resizeObserver.observe(containerRef.value);
}
});

onBeforeUnmount(() => {
window.removeEventListener('resize', updateWidth);
resizeObserver?.disconnect();
resizeObserver = null;
if (zoomBehavior && svgRef.value) {
select(svgRef.value as Element).on('.zoom', null);
}
Expand All @@ -218,7 +229,10 @@ onBeforeUnmount(() => {
watch(
() => props.revisions,
() => {
nextTick(() => fitToContent());
nextTick(() => {
initZoom();
fitToContent();
});
},
{ deep: true }
);
Expand Down
2 changes: 1 addition & 1 deletion client-v3/src/js/platform/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @returns {string} Base URL (e.g., "http://localhost:8080")
*/
export function baseURL(): string {
return `${window.location.protocol}//${window.location.hostname}:${window.location.port}`;
return `${window.location.protocol}//${window.location.hostname}${window.location.port ? ':' + window.location.port : ''}`;

Check warning on line 13 in client-v3/src/js/platform/browser.ts

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Prefer `globalThis` over `window`.

See more on https://sonarcloud.io/project/issues?id=dreamteamprod_DigiScript&issues=AZ6cyzbMiIVtV7kfv5Pl&open=AZ6cyzbMiIVtV7kfv5Pl&pullRequest=1148
}

export function makeURL(path: string): string {
Expand Down
4 changes: 2 additions & 2 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "client",
"version": "0.30.6",
"version": "0.30.7",
"description": "DigiScript front end",
"author": "DreamTeamProd",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion client/src/js/platform/browser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('browser.js', () => {
window.location.port = '';

const result = baseURL();
expect(result).toBe('http://localhost:');
expect(result).toBe('http://localhost');
});
});

Expand Down
2 changes: 1 addition & 1 deletion client/src/js/platform/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @returns {string} Base URL (e.g., "http://localhost:8080")
*/
export function baseURL(): string {
return `${window.location.protocol}//${window.location.hostname}:${window.location.port}`;
return `${window.location.protocol}//${window.location.hostname}${window.location.port ? ':' + window.location.port : ''}`;

Check warning on line 13 in client/src/js/platform/browser.ts

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Prefer `globalThis` over `window`.

See more on https://sonarcloud.io/project/issues?id=dreamteamprod_DigiScript&issues=AZ6cyzcViIVtV7kfv5Pm&open=AZ6cyzcViIVtV7kfv5Pm&pullRequest=1148
}

export function makeURL(path: string): string {
Expand Down
4 changes: 2 additions & 2 deletions electron/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion electron/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "digiscript-electron",
"version": "0.30.6",
"version": "0.30.7",
"description": "DigiScript Electron Desktop Application",
"author": "DreamTeamProd",
"license": "GPL-3.0",
Expand Down
2 changes: 1 addition & 1 deletion server/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "digiscript-server"
version = "0.30.6"
version = "0.30.7"
description = "DigiScript server - Digital script management for theatrical shows"
readme = "../README.md"
requires-python = ">=3.13"
Expand Down
Loading