-
Notifications
You must be signed in to change notification settings - Fork 55
Feat: additional Layer info on hover previews #1523
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
base: release53
Are you sure you want to change the base?
Feat: additional Layer info on hover previews #1523
Conversation
Co-authored-by: Jonas Hummelstrand <[email protected]>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
export type PreviewContent = | ||
| { | ||
type: 'iframe' | ||
href: string | ||
postMessage?: any | ||
dimensions?: { width: number; height: number } | ||
} | ||
| { | ||
type: 'image' | ||
src: string | ||
} | ||
| { | ||
type: 'video' | ||
src: string | ||
} | ||
| { | ||
type: 'script' | ||
script?: string | ||
firstWords?: string | ||
lastWords?: string | ||
comment?: string | ||
lastModified?: number | ||
} | ||
| { | ||
type: 'title' | ||
content: string | ||
} | ||
| { | ||
type: 'inOutWords' | ||
in?: string | ||
out: string | ||
} | ||
| { | ||
type: 'layerInfo' | ||
layerType: SourceLayerType | ||
text: Array<string> | ||
inTime?: number | string | ||
outTime?: number | string | ||
duration?: number | string | ||
} | ||
| { | ||
type: 'separationLine' | ||
} | ||
| { | ||
type: 'data' | ||
content: { key: string; value: string }[] | ||
} | ||
|
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 think with this now becoming a public interface this needs to be described more in terms what the Blueprint Developer should expect to get.
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.
Agree, as this is an add on to the existing popupPreview implementation, are there any place where this is already documented, so I can add it there, or du you prefer it as comments in the interface definition?
inTime?: number | string | ||
outTime?: number | string | ||
duration?: number | string |
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.
What do these properties mean? What's the difference between outTime
vs inTime + duration
? I'm also somewhat unsure about making this interface this loose & bound to a particular implementation of the hoverscrub preview component/any other component using this infromation - say Presenters' Screen. Any change there would effectively require a change to blueprints integration, which we expect to be at least reasonably stable.
I'm also not a big fan of introducing terms inTime
and duration
- I think they somewhat overlap with expectedStart
and expectedDuration
? Are they the same? If that's the case, I think it would make sense to use the same names.
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.
These are optional values for the "in", "out", "duration" labels, and used for the LayerInfo content, not necessary an expectedStart or expectedDuration calculation.
So either we should add a comment in here that explains what it is, or add it to some documentation, what do you prefer?
out: string | ||
} | ||
| { | ||
type: 'layerInfo' |
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.
Is this a layerInfo
or more of an "auxiliary Piece info" on a layer of given type?
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 do think that calling it layerInfo makes sense, based on what it's used for.
| { | ||
type: 'data' | ||
content: { key: string; value: string }[] | ||
} |
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.
This interface specifically is very vague for a public-use interface. I think we need to make sure that it's more clear what one can expect/put into here.
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.
Could you clarify what additional specificity you'd like for the data type?
We should definitely dig into what this does and add some documentation, currently I don't know how this feature works, or where it's being used.
{' '} | ||
{content.outTime !== undefined && ( | ||
<> | ||
<span className="label">{t('OUT')}: </span> |
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 don't think we should have stylistic capitalization as a part of the Translatable string. Seems like more of a text-transform: uppercase
situation? I also suspect that space at the end needs to be an
maybe?
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.
As these are labels, should we then decide that "IN", "OUT" and "DURATION" are never translated. Or what are your thoughts and what are we doing other places?
Will look at the
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 feel that this is exposing a lot of internal UI mechanics to the Blueprints in a way that ties them to a very specific implementation of the preview mechanics. I see why this can be handy, but I'm worried we may be painting ourselves into a corner for the future, so I think we need to carefully consider documenting what things in the new PreviewContent
interface mean, how that information can be used, etc.
@jstarpl |
About the Contributor
This PR is made on behalf of BBC
Type of Contribution
This is a feature
Current Behavior
Current it's only possible to use predefined Previews
New Behavior
By adding an optional
additionalPreviewContent?: Array<PreviewContent>
inside thePopupPreview
in the Blueprint integration. It's possible to add additionalPreviewContent
to HoverPreviews via blueprints.Example:
Testing
Affected areas
The hover preview has been restyled with the "new" Roboto Flex styling.
Mini shelf has an updated 16:9 layout.
Additional content in the hover previews is only affected if the 'additionalPreviewContent' is added in the Blueprints.
Time Frame
This is something BBC would like to have in R53
Status