Skip to content
Open
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
2 changes: 2 additions & 0 deletions packages/meteor-lib/src/triggers/RundownViewEventBus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export enum RundownViewEvents {

TOGGLE_SHELF_DROPZONE = 'toggleShelfDropzone',
ITEM_DROPPED = 'itemDropped',
CLOSE_NOTIFICATIONS = 'closeNotifications',
}

export interface IEventContext {
Expand Down Expand Up @@ -162,6 +163,7 @@ export interface RundownViewEventBusEvents {
[RundownViewEvents.CREATE_SNAPSHOT_FOR_DEBUG]: [e: BaseEvent]
[RundownViewEvents.TOGGLE_SHELF_DROPZONE]: [e: ToggleShelfDropzoneEvent]
[RundownViewEvents.ITEM_DROPPED]: [e: ItemDroppedEvent]
[RundownViewEvents.CLOSE_NOTIFICATIONS]: []
}

class RundownViewEventBus0 extends EventEmitter<RundownViewEventBusEvents> {}
Expand Down
85 changes: 14 additions & 71 deletions packages/webui/src/client/styles/propertiesPanel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
background: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.15) 100%);
}

.propertiespanel-pop-up__label-with-icon {
margin-left: 0.5em;
}

.propertiespanel-pop-up {
background: #2e2e2e;
border-radius: 1px;
Expand Down Expand Up @@ -64,8 +68,6 @@
letter-spacing: 0.5px;

> .svg {
width: 1em;
height: 1.2em;
flex-shrink: 0;
}
> .title {
Expand All @@ -87,13 +89,16 @@
flex-shrink: 0;
}
> .propertiespanel-pop-up_close {
height: 1em;
margin-left: 1em;
background-color: unset;
border: none;
}
}

.propertiespanel-pop-up__buttons-container {
display: flex;
gap: 0.5em;
}

> .propertiespanel-pop-up__footer {
flex: 1;
flex: 0 0 0;
Expand All @@ -109,7 +114,9 @@

> .propertiespanel-pop-up__button,
.propertiespanel-pop-up__button-group .propertiespanel-pop-up__button {
display: block;
display: flex;
gap: 0.5em;
align-items: center;

border-radius: 5px;
border: 1px solid #7f7f7f;
Expand Down Expand Up @@ -227,14 +234,14 @@
}

.propertiespanel-pop-up__button {
// margin-top: 10px;
background: #636363;
padding: 10px;
gap: 10px;
border-radius: 5px;
border: 1px solid #7f7f7f;
color: #dfdfdf;

gap: 0.5em;

Comment on lines 236 to +244
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cat -n packages/webui/src/client/styles/propertiesPanel.scss | sed -n '230,250p'

Repository: Sofie-Automation/sofie-core

Length of output: 564


🏁 Script executed:

cat -n packages/webui/src/client/styles/propertiesPanel.scss | sed -n '220,260p'

Repository: Sofie-Automation/sofie-core

Length of output: 985


🏁 Script executed:

cat -n packages/webui/src/client/styles/propertiesPanel.scss | sed -n '200,270p'

Repository: Sofie-Automation/sofie-core

Length of output: 1897


🏁 Script executed:

rg -n "propertiespanel-pop-up__button" packages/webui/src/client/styles/propertiesPanel.scss

Repository: Sofie-Automation/sofie-core

Length of output: 331


🏁 Script executed:

cat -n packages/webui/src/client/styles/propertiesPanel.scss | sed -n '110,130p'

Repository: Sofie-Automation/sofie-core

Length of output: 664


🏁 Script executed:

cat -n packages/webui/src/client/styles/propertiesPanel.scss | sed -n '95,125p'

Repository: Sofie-Automation/sofie-core

Length of output: 894


🏁 Script executed:

cat -n packages/webui/src/client/styles/propertiesPanel.scss | sed -n '170,240p'

Repository: Sofie-Automation/sofie-core

Length of output: 1826


🏁 Script executed:

cat -n packages/webui/src/client/styles/propertiesPanel.scss | sed -n '1,50p'

Repository: Sofie-Automation/sofie-core

Length of output: 1379


Add display: flex and remove blank line before gap.

The .propertiespanel-pop-up__button selector nested inside .propertiespanel-pop-up__contents (line 236) is missing the display: flex property that exists in the earlier declaration under .propertiespanel-pop-up__footer (line 115). Without flex display, the gap: 0.5em; property has no effect. The blank line before gap is also a Stylelint error.

Suggested change
 			.propertiespanel-pop-up__button {
+				display: flex;
+				align-items: center;
 				background: `#636363`;
 				padding: 10px;
 				border-radius: 5px;
 				border: 1px solid `#7f7f7f`;
 				color: `#dfdfdf`;
-
 				gap: 0.5em;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
.propertiespanel-pop-up__button {
// margin-top: 10px;
background: #636363;
padding: 10px;
gap: 10px;
border-radius: 5px;
border: 1px solid #7f7f7f;
color: #dfdfdf;
gap: 0.5em;
.propertiespanel-pop-up__button {
display: flex;
align-items: center;
background: `#636363`;
padding: 10px;
border-radius: 5px;
border: 1px solid `#7f7f7f`;
color: `#dfdfdf`;
gap: 0.5em;
🧰 Tools
🪛 Stylelint (17.4.0)

[error] 243-243: Unexpected empty line before declaration (declaration-empty-line-before)

(declaration-empty-line-before)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/webui/src/client/styles/propertiesPanel.scss` around lines 236 -
244, The .propertiespanel-pop-up__button rule inside
.propertiespanel-pop-up__contents is missing display:flex so its gap: 0.5em has
no effect and Stylelint flags the blank line; update the
.propertiespanel-pop-up__button selector (same block shown) to include display:
flex and remove the empty line before gap so the styles match the
.propertiespanel-pop-up__footer pattern and gap takes effect.

font-size: 0.875em;
font-weight: 500;

Expand Down Expand Up @@ -266,63 +273,6 @@
width: 100%;
}

// // Force the base input-l class
// .input-l {
// width: 100% !important;
// max-width: none !important;
// margin-left: 0px;
// border: none;
// }

// // Force the select/text-input defaults
// .select,
// .inline-select,
// .text-input {
// display: block !important;
// position: relative;
// width: 100% !important;
// }

// .input {
// border: 1px solid #e5e7eb;
// border-radius: 0.375rem;
// padding: 0.5rem 0.75rem;
// width: 100%;

// &:focus {
// outline: none;
// border-color: #3b82f6;
// box-shadow: 0 0 0 1px #3b82f6;
// background-color: unset !important; // origo >.>
// }
// }

// .label-text {
// &:before {
// content: none !important;
// }
// }

// .dropdown {
// background: white;
// border: 1px solid #e5e7eb;
// border-radius: 0.375rem;
// width: 100%;
// max-width: 100%;

// .input,
// .input-l {
// border: none;
// outline: none;
// box-shadow: none;
// }

// &:focus-within {
// border-color: #3b82f6;
// box-shadow: 0 0 0 1px #3b82f6;
// }
// }

.form-switch {
margin: 0.5rem 0;

Expand All @@ -337,13 +287,6 @@
margin-bottom: 0.5rem; // Increased spacing between label and selector
margin-top: 0.5rem; // Clearance from the previous
}

// .label {
// font-size: 0.875rem;
// font-weight: 500;
// color: #374151;
// display: block;
// }
}
}
}
Expand Down
20 changes: 11 additions & 9 deletions packages/webui/src/client/styles/rundownView.scss
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ $break-width: 35rem;
}

&.properties-panel-open {
padding-right: $properties-panel-width;
padding-right: calc(#{$properties-panel-width} - 3.5em);
transition: 0s padding-right 1s;

> .rundown-header .rundown-overview {
Expand Down Expand Up @@ -209,8 +209,13 @@ body.no-overflow {
bottom: 0;
right: 0;

background:
linear-gradient(-45deg, $color-status-fatal 33%, transparent 33%, transparent 66%, $color-status-fatal 66%),
background: linear-gradient(
-45deg,
$color-status-fatal 33%,
transparent 33%,
transparent 66%,
$color-status-fatal 66%
),
linear-gradient(-45deg, $color-status-fatal 33%, transparent 33%, transparent 66%, $color-status-fatal 66%),
linear-gradient(-45deg, $color-status-fatal 33%, transparent 33%, transparent 66%, $color-status-fatal 66%),
linear-gradient(-45deg, $color-status-fatal 33%, transparent 33%, transparent 66%, $color-status-fatal 66%);
Comment on lines +212 to 221
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Remove the extra blank line before background.

Stylelint is still flagging this hunk with declaration-empty-line-before, so the stylesheet check will stay red until the newline is removed.

Suggested change
 	right: 0;
-
 	background: linear-gradient(
 			-45deg,
 			$color-status-fatal 33%,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
background: linear-gradient(
-45deg,
$color-status-fatal 33%,
transparent 33%,
transparent 66%,
$color-status-fatal 66%
),
linear-gradient(-45deg, $color-status-fatal 33%, transparent 33%, transparent 66%, $color-status-fatal 66%),
linear-gradient(-45deg, $color-status-fatal 33%, transparent 33%, transparent 66%, $color-status-fatal 66%),
linear-gradient(-45deg, $color-status-fatal 33%, transparent 33%, transparent 66%, $color-status-fatal 66%);
right: 0;
background: linear-gradient(
-45deg,
$color-status-fatal 33%,
transparent 33%,
transparent 66%,
$color-status-fatal 66%
),
linear-gradient(-45deg, $color-status-fatal 33%, transparent 33%, transparent 66%, $color-status-fatal 66%),
linear-gradient(-45deg, $color-status-fatal 33%, transparent 33%, transparent 66%, $color-status-fatal 66%),
linear-gradient(-45deg, $color-status-fatal 33%, transparent 33%, transparent 66%, $color-status-fatal 66%);
🧰 Tools
🪛 Stylelint (17.4.0)

[error] 212-221: Unexpected empty line before declaration (declaration-empty-line-before)

(declaration-empty-line-before)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/webui/src/client/styles/rundownView.scss` around lines 212 - 221,
Remove the extra blank line immediately before the background declaration so the
CSS/Sass rule has no empty line before the "background:" property; locate the
block containing the "background: linear-gradient(...)" lines (the repeated
linear-gradient entries using $color-status-fatal) and delete the blank line
above it to satisfy stylelint's declaration-empty-line-before rule.

Expand Down Expand Up @@ -1100,8 +1105,7 @@ svg.icon {
}
.segment-timeline__part {
.segment-timeline__part__invalid-cover {
background-image:
repeating-linear-gradient(
background-image: repeating-linear-gradient(
45deg,
var(--invalid-reason-color-transparent) 0%,
var(--invalid-reason-color-transparent) 4px,
Expand Down Expand Up @@ -1383,8 +1387,7 @@ svg.icon {
left: 2px;
right: 2px;
z-index: 3;
background:
repeating-linear-gradient(
background: repeating-linear-gradient(
45deg,
var(--invalid-reason-color-opaque) 0,
var(--invalid-reason-color-opaque) 5px,
Expand Down Expand Up @@ -1566,8 +1569,7 @@ svg.icon {
right: 1px;
z-index: 10;
pointer-events: all;
background-image:
repeating-linear-gradient(
background-image: repeating-linear-gradient(
45deg,
var(--invalid-reason-color-transparent) 0%,
var(--invalid-reason-color-transparent) 5px,
Expand Down
20 changes: 17 additions & 3 deletions packages/webui/src/client/ui/RundownView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ const RundownViewContent = translateWithTracker<IPropsWithReady & ITrackedProps,

RundownViewEventBus.on(RundownViewEvents.GO_TO_LIVE_SEGMENT, this.onGoToLiveSegment)
RundownViewEventBus.on(RundownViewEvents.GO_TO_TOP, this.onGoToTop)
RundownViewEventBus.on(RundownViewEvents.CLOSE_NOTIFICATIONS, this.onCloseNotifications)

if (this.props.playlist) {
documentTitle.set(this.props.playlist.name)
Expand Down Expand Up @@ -623,6 +624,7 @@ const RundownViewContent = translateWithTracker<IPropsWithReady & ITrackedProps,

RundownViewEventBus.off(RundownViewEvents.GO_TO_LIVE_SEGMENT, this.onGoToLiveSegment)
RundownViewEventBus.off(RundownViewEvents.GO_TO_TOP, this.onGoToTop)
RundownViewEventBus.off(RundownViewEvents.CLOSE_NOTIFICATIONS, this.onCloseNotifications)
}

private onBeforeUnload = (e: any) => {
Expand Down Expand Up @@ -906,6 +908,12 @@ const RundownViewContent = translateWithTracker<IPropsWithReady & ITrackedProps,
)
}

private onCloseNotifications = () => {
this.setState({
isNotificationsCenterOpen: undefined,
})
}
Comment on lines +911 to +915
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Sync the global notification-center flag when these paths auto-close it.

Lines 1200-1204 keep NotificationCenter.isOpen aligned with React state, but these new branches only clear isNotificationsCenterOpen. After opening properties through the event bus or the context menu, the singleton can still think the center is open, which makes later pop-up/toggle behavior drift out of sync.

Suggested change
 		private onCloseNotifications = () => {
+			NotificationCenter.isOpen = false
 			this.setState({
 				isNotificationsCenterOpen: undefined,
 			})
 		}
@@
 												onEditProps={(selection) => {
+													NotificationCenter.isOpen = false
 													this.setState({ isNotificationsCenterOpen: undefined })
 													selectionContext.clearAndSetSelection(selection)
 												}}

Also applies to: 1536-1539

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/webui/src/client/ui/RundownView.tsx` around lines 911 - 915, The
onCloseNotifications handler currently only clears component state
(isNotificationsCenterOpen) which leaves the global singleton flag
NotificationCenter.isOpen out of sync; update onCloseNotifications to also set
NotificationCenter.isOpen = false when closing, and apply the same change to any
other auto-close paths (the handlers that open properties via the event bus /
context menu that currently only clear isNotificationsCenterOpen) so the global
NotificationCenter.isOpen and the React state remain consistent.


private onToggleSupportPanel = () => {
this.setState({
isSupportPanelOpen: !this.state.isSupportPanelOpen,
Expand Down Expand Up @@ -1372,6 +1380,8 @@ const RundownViewContent = translateWithTracker<IPropsWithReady & ITrackedProps,
<DragContextProvider t={t}>
<SelectedElementsContext.Consumer>
{(selectionContext) => {
const isPropertiesPanelOpen = selectionContext.listSelectedElements().length > 0

return (
<div
className={classNames('rundown-view', {
Expand Down Expand Up @@ -1464,13 +1474,14 @@ const RundownViewContent = translateWithTracker<IPropsWithReady & ITrackedProps,
</ErrorBoundary>
<ErrorBoundary>
<AnimatePresence>
{this.state.isNotificationsCenterOpen && (
{!isPropertiesPanelOpen && this.state.isNotificationsCenterOpen && (
<NotificationCenterPanel
filter={this.state.isNotificationsCenterOpen}
hideRundownHeader={this.props.hideRundownHeader}
/>
)}
{!this.state.isNotificationsCenterOpen &&
{isPropertiesPanelOpen &&
!this.state.isNotificationsCenterOpen &&
selectionContext.listSelectedElements().length > 0 && (
<div>
<PropertiesPanel />
Expand Down Expand Up @@ -1522,7 +1533,10 @@ const RundownViewContent = translateWithTracker<IPropsWithReady & ITrackedProps,
onQueueNextSegment={this.onQueueNextSegment}
onSetQuickLoopStart={this.onSetQuickLoopStart}
onSetQuickLoopEnd={this.onSetQuickLoopEnd}
onEditProps={(selection) => selectionContext.clearAndSetSelection(selection)}
onEditProps={(selection) => {
this.setState({ isNotificationsCenterOpen: undefined })
selectionContext.clearAndSetSelection(selection)
}}
studioMode={this.props.userPermissions.studio}
enablePlayFromAnywhere={!!studio.settings.enablePlayFromAnywhere}
enableQuickLoop={!!studio.settings.enableQuickLoop}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { CoreUserEditingDefinition } from '@sofie-automation/corelib/dist/dataMo
import * as RundownResolver from '../../lib/RundownResolver.js'
import { SelectedElement } from '../RundownView/SelectedElementsContext.js'
import { DBPartInstance } from '@sofie-automation/corelib/dist/dataModel/PartInstance.js'
import { hasUserEditableContent } from '../UserEditOperations/PropertiesPanel.js'

interface IProps {
onSetNext: (partInstance: DBPartInstance | DBPart | undefined, e: any, offset?: number, take?: boolean) => void
Expand Down Expand Up @@ -120,6 +121,10 @@ export function SegmentContextMenu({
part?.instance._id !== playlist.nextPartInfo?.partInstanceId &&
part?.instance._id !== playlist.previousPartInfo?.partInstanceId

const segmentHasEditableContent = hasUserEditableContent(segment)
const partHasEditableContent = hasUserEditableContent(part?.instance.part)
const pieceHasEditableContent = hasUserEditableContent(piece?.instance.piece)

const isPartOrphaned: boolean | undefined = part ? part.instance.orphaned !== undefined : undefined

const isPartNext: boolean | undefined = part ? playlist.nextPartInfo?.partInstanceId === part.instance._id : undefined
Expand Down Expand Up @@ -159,7 +164,7 @@ export function SegmentContextMenu({
isFormEditable={isSegmentEditAble}
/>
)}
{enableUserEdits && (
{enableUserEdits && segmentHasEditableContent && (
<>
<hr />
<MenuItem onClick={() => onEditProps({ type: 'segment', elementId: part.instance.segmentId })}>
Expand Down Expand Up @@ -286,16 +291,20 @@ export function SegmentContextMenu({
/>
)}

{enableUserEdits && (
{enableUserEdits && (segmentHasEditableContent || partHasEditableContent || pieceHasEditableContent) && (
<>
<hr />
<MenuItem onClick={() => onEditProps({ type: 'segment', elementId: part.instance.segmentId })}>
<span>{t('Edit Segment Properties')}</span>
</MenuItem>
<MenuItem onClick={() => onEditProps({ type: 'part', elementId: part.instance.part._id })}>
<span>{t('Edit Part Properties')}</span>
</MenuItem>
{piece && piece.instance.piece.userEditProperties && (
{segmentHasEditableContent && (
<MenuItem onClick={() => onEditProps({ type: 'segment', elementId: part.instance.segmentId })}>
<span>{t('Edit Segment Properties')}</span>
</MenuItem>
)}
{partHasEditableContent && (
<MenuItem onClick={() => onEditProps({ type: 'part', elementId: part.instance.part._id })}>
<span>{t('Edit Part Properties')}</span>
</MenuItem>
)}
{pieceHasEditableContent && piece && (
<MenuItem onClick={() => onEditProps({ type: 'piece', elementId: piece.instance.piece._id })}>
<span>{t('Edit Piece Properties')}</span>
</MenuItem>
Expand Down
10 changes: 8 additions & 2 deletions packages/webui/src/client/ui/SegmentTimeline/SegmentTimeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ import * as RundownResolver from '../../lib/RundownResolver.js'
import { DBSegment } from '@sofie-automation/corelib/dist/dataModel/Segment'
import { SelectedElementsContext } from '../RundownView/SelectedElementsContext.js'
import { BlueprintAssetIcon } from '../../lib/Components/BlueprintAssetIcon.js'
import { hasUserEditableContent } from '../UserEditOperations/PropertiesPanel.js'

interface IProps {
id: string
Expand Down Expand Up @@ -1015,8 +1016,13 @@ export class SegmentTimelineClass extends React.Component<Translated<WithTiming<
<div
onDoubleClick={() => {
if (this.props.studio.settings.enableUserEdits) {
if (!selectElementContext.isSelected(this.props.segment._id)) {
selectElementContext.clearAndSetSelection({ type: 'segment', elementId: this.props.segment._id })
const segment = this.props.segment

const hasEditableContent = hasUserEditableContent(segment)
if (!hasEditableContent) return

if (!selectElementContext.isSelected(segment._id)) {
selectElementContext.clearAndSetSelection({ type: 'segment', elementId: segment._id })
Comment on lines 1017 to +1025
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Close notifications before selecting a segment.

When the notification center is already open, this only changes the selection. RundownView.tsx now suppresses both side panels until notifications are closed (Lines 1477-1485 there), so a segment double-click can leave the right side blank instead of opening properties. SourceLayerItem.tsx already emits CLOSE_NOTIFICATIONS before piece selection; this path should do the same.

Suggested change
 									if (this.props.studio.settings.enableUserEdits) {
 										const segment = this.props.segment

 										const hasEditableContent = hasUserEditableContent(segment)
 										if (!hasEditableContent) return

 										if (!selectElementContext.isSelected(segment._id)) {
+											RundownViewEventBus.emit(RundownViewEvents.CLOSE_NOTIFICATIONS)
 											selectElementContext.clearAndSetSelection({ type: 'segment', elementId: segment._id })
 										} else {
 											selectElementContext.clearSelections()
 										}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
onDoubleClick={() => {
if (this.props.studio.settings.enableUserEdits) {
if (!selectElementContext.isSelected(this.props.segment._id)) {
selectElementContext.clearAndSetSelection({ type: 'segment', elementId: this.props.segment._id })
const segment = this.props.segment
const hasEditableContent = hasUserEditableContent(segment)
if (!hasEditableContent) return
if (!selectElementContext.isSelected(segment._id)) {
selectElementContext.clearAndSetSelection({ type: 'segment', elementId: segment._id })
onDoubleClick={() => {
if (this.props.studio.settings.enableUserEdits) {
const segment = this.props.segment
const hasEditableContent = hasUserEditableContent(segment)
if (!hasEditableContent) return
if (!selectElementContext.isSelected(segment._id)) {
RundownViewEventBus.emit(RundownViewEvents.CLOSE_NOTIFICATIONS)
selectElementContext.clearAndSetSelection({ type: 'segment', elementId: segment._id })
} else {
selectElementContext.clearSelections()
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/webui/src/client/ui/SegmentTimeline/SegmentTimeline.tsx` around
lines 1017 - 1025, Double-click handler in SegmentTimeline should close
notifications before changing selection: when enableUserEdits is true and
hasUserEditableContent(segment) passes, emit the same CLOSE_NOTIFICATIONS event
used in SourceLayerItem.tsx (using the app's notification/event emitter or
context) prior to calling selectElementContext.clearAndSetSelection({ type:
'segment', elementId: segment._id }), and only then proceed to set selection (or
clearAndSetSelection) so the right-hand panel isn't suppressed; update the
onDoubleClick branch around hasUserEditableContent, referencing the existing
symbols hasUserEditableContent, selectElementContext.clearAndSetSelection,
segment._id, and CLOSE_NOTIFICATIONS.

} else {
selectElementContext.clearSelections()
}
Expand Down
14 changes: 12 additions & 2 deletions packages/webui/src/client/ui/SegmentTimeline/SourceLayerItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ import { LocalLayerItemRenderer } from './Renderers/LocalLayerItemRenderer.js'
import { DEBUG_MODE } from './SegmentTimelineDebugMode.js'
import { getElementDocumentOffset, OffsetPosition } from '../../utils/positions.js'
import { unprotectString } from '@sofie-automation/shared-lib/dist/lib/protectedString'
import { RundownViewEvents, HighlightEvent } from '@sofie-automation/meteor-lib/dist/triggers/RundownViewEventBus'
import RundownViewEventBus, {
RundownViewEvents,
HighlightEvent,
} from '@sofie-automation/meteor-lib/dist/triggers/RundownViewEventBus'
import { pieceUiClassNames } from '../../lib/ui/pieceUiClassNames.js'
import { TransitionSourceRenderer } from './Renderers/TransitionSourceRenderer.js'
import { UIStudio } from '@sofie-automation/meteor-lib/dist/api/studios'
Expand All @@ -33,6 +36,7 @@ import {
PreviewPopUpContext,
} from '../PreviewPopUp/PreviewPopUpContext.js'
import { useRundownViewEventBusListener } from '../../lib/lib.js'
import { hasUserEditableContent } from '../UserEditOperations/PropertiesPanel.js'
const LEFT_RIGHT_ANCHOR_SPACER = 15
const MARGINAL_ANCHORED_WIDTH = 5

Expand Down Expand Up @@ -180,8 +184,14 @@ export const SourceLayerItem = (props: Readonly<ISourceLayerItemProps>): JSX.Ele
e.stopPropagation()

if (studio?.settings.enableUserEdits && !studio?.settings.allowPieceDirectPlay) {
const pieceId = piece.instance.piece._id
const innerPiece = piece.instance.piece

const hasEditableContent = hasUserEditableContent(innerPiece)
if (!hasEditableContent) return

const pieceId = innerPiece._id
if (!selectElementContext.isSelected(pieceId)) {
RundownViewEventBus.emit(RundownViewEvents.CLOSE_NOTIFICATIONS)
selectElementContext.clearAndSetSelection({ type: 'piece', elementId: pieceId })
} else {
selectElementContext.clearSelections()
Expand Down
Loading
Loading