-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/UI useredit panel #22
Conversation
…plit or DVE backgrounds)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a disagreement with how this is done, which is simply that I don't think the properties panel should be using the same list of userEditOperations
that we added for the context menu.
I think that the properties panel should be using its own dedicated property, which provides the expected schemas for the panel.
Something like:
interface Part {
...
propertiesPanel?: PropertiesPanelSchema
...
}
interface PropertiesPanelSchema {
/** Common properties to show at the top **/
headerSchema?: JSONBlob<JSONSchema>
/** Common properties to show at the bottom **/
footerSchema?: JSONBlob<JSONSchema>
/** The json schemas describing the form to display */
schemas: Record<string, UserEditingSourceLayer>
/** Current values to populate the form with */
currentValues: {
type: string
value: Record<string, any>
}
headerValues?: Record<string, any>
footerValues?: Record<string, any>
}
As I have said in the comments, I think that reusing the userEditOperations
is both making the properties panel ui very complex to handle the displaying and queueing of operations, and will easily result in unexpected behaviour when saving changes in the panel.
There are two key cases I am concerned about, which is that the user triggering the 'ACTION' type of operations in a sequence of A, B, A is not guaranteed to be the same as A, B or even B, A and so we can't reliably condense down the sequence of operations.
And even just executing A, B may not be ok as executing A could remove the ability to execute B.
I don't see a reason that these need to be using the same operations, and while them being separate will likely mean more work for the blueprints dev, it means that the properties panel content will be tailored specifically for the panel.
If they want to have a 'lock part' option in both places, they will have to define it for both, but then they can get better behaviour in both places. If there is an option which affects what other options should be shown/allowed, the json schema for the properties panel could (once we add support for these things to the SchemaForm component) show/hide the appropriate options which are dependent on the others.
} satisfies Complete<UserEditingDefinitionAction> | ||
case UserEditingType.FORM: | ||
return { | ||
type: UserEditingType.FORM, | ||
id: userEdit.id, | ||
label: omit(userEdit.label, 'namespaces'), | ||
schema: clone(userEdit.schema), | ||
grouping: clone(userEdit.grouping) as UserEditingGroupingType[] | undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
grouping: clone(userEdit.grouping) as UserEditingGroupingType[] | undefined, | |
grouping: clone<UserEditingGroupingType[] | undefined>(userEdit.grouping), |
hopefully that satisfies the type error?
The casting you had would ignore some other real type errors
packages/webui/src/client/lib/forms/SchemaFormWithOverrides.tsx
Outdated
Show resolved
Hide resolved
packages/webui/src/client/ui/UserEditOperations/PropertiesPanel.tsx
Outdated
Show resolved
Hide resolved
packages/webui/src/client/ui/UserEditOperations/PropertiesPanel.tsx
Outdated
Show resolved
Hide resolved
packages/webui/src/client/ui/UserEditOperations/PropertiesPanel.tsx
Outdated
Show resolved
Hide resolved
packages/webui/src/client/ui/UserEditOperations/PropertiesPanel.tsx
Outdated
Show resolved
Hide resolved
Refactor Segment/Part properties to be a property instead of an operation
* wip: initial draft implementation of userEditPanel * wip: userEditPanel grouping * wip: userEditPanel cleanup remove schema as it's replaces by schemas * wip: userEditPanel styling and use <select> for list * wip: userEditPanel - make groupType optional to allow empty slots * wip: userEditPanel - convert to FC * wip: userEditPanel - uncomment context menu * wip: UserEditPanel - Add DefaultUserOperationsTypes for revert buttons in panel * wip: UserEditPanel - Default revert button on panel * wip: UserEditPanel - tracker on part and segment * wip: UserEditPanel - only render Segment or Part in panel * wip: UserEditPanel - initial header for part and segment * wip: UserEditPanel - comment for the usage of getTimePosition * wip: UserEditPanel - add Icons in header * wip: UserEditPanel - add button type in UserEditingDefinitions * wip: UserEditPanel - rename revert button to "Revert Changes" * wip: UserEditPanel - add support for SVG icons in grouping (e.g for split or DVE backgrounds) * wip: UserEditPanel - center revert button * wip: Renaming UserEditPanel to PropertiesPanel * wip: UI selection - Context for SelectedElements * wip: UI selection - refactor from useState() to useReducer() * wip: UI selection - use type for SelectedElement * wip: UI selection -Segment not updating upon selection * feat: unit tests for SelectedElementsContext * wip: UI selection - add isSelected to withSegmentTiming * wip: fix props withSelection * wip: fix props withSelection * wip: remove componentDidUpdate - leftover from previous debugging * fix: added listSelectedElements() instead of exposing the selectedElements * fix: add assertNever() to selectionReducer * fix: remove id and use ElementId as reference in context provider * fix: clean up isSelected should parse boolean not function as props * chore: update package with @testing-library/react * fix: tests for SelecedElementsContext updated and type fixed * fix: listSelectedElements is af function not an array * wip: implement useSelection in PropertiesPanel * wip: useSelection on Parts * fix: missing rundown id in propertiespanel actions * feat: add enabling of userediting in settings * feat: doubleclick on part selection for properties panel * fix: properties panel crash when no selection was made * feat: segment selection * feat: dbl click anywhere in segment header to select properties * feat: select part by double clicking a piece * feat: properties panel commit button for pending changes * feat: select/deselect an element - fix flickering upen commit changes * fix: render all userEditOperations when part is selected * feat: move Properties panel out of notification center logic * feat: use context.consumer instead of wrapping * feat: refactor userEditing structure * feat: properties panel with refactored data structure. * feat: Schema selection implemented in commit button logic * feat: implement Layer colors in group selectors * feat: only parse the selected source on useraction commit * feat: simplify structure for userEditing source * fix: rerender group selection when selecting new part * fix: read the SourceLayerType into UserEditingDefinition * feat: selected element indicator * feat: properties panel styling - is edited indication * wip: add close propterties icon (sketch) * wip: properties panel css dim commit+revert when not active * wip: properties panel clean up first iteration selector * wip: properties panel add close upper right * fix: crash UI - remove transiongroup * feat: properties panel animate in and shrink rundown view * fix: cleanup using notificationpanel for properties panel * wip: properties panel, rightbar icon color * fix: re-run only if part.segmentId has changed * wip: tests for properties panel * wip: properties panel tests - useFaketimers and implement mock useTracker() * wip: properties panel - element selection styling * wip: properties panel styling edit pencil icon * wip: properties panel close when notification is open * wip: properties panel selection glow on segment header * feat: StyledSchemaFormInPlace schema component * fix: Properties panel - StyledSchemaFormInPlace schema for normal form * feat: Properties panel is edited pencil styling * feat: Properties header styling * wip: Properties tests - more mocking to get correct rendering in test to work * chore: fix unit tests * feat: refactor form action to properties field * chore: update styles * chore: add actions back into property panel * chore: support translations for properties panel * chore: fix some build issues * feat: allow editing piece properties * chore: various review comments * chore: fix tests * chore: remove unused parameter * chore: removed commented styles --------- Co-authored-by: Olzzon <gh@olzzon.dk> Co-authored-by: Mint de Wit <mint@superfly.tv>
This is an internal BBC WIP PR for discussion of concepts for the PropertiesPanel and Useredits.
Be aware:
The corresponding Blueprints is in this branch:
https://github.com/bbc/eng-ga-sofie-blueprints/tree/feat/user-edits-properties-panel