Skip to content

Commit deee7c6

Browse files
authored
Merge pull request #1478 from bbc/upstream/fix-in-outword-in-new-hoverpvw
2 parents 7162cad + c8f1974 commit deee7c6

File tree

3 files changed

+29
-20
lines changed

3 files changed

+29
-20
lines changed

packages/webui/src/client/ui/PreviewPopUp/PreviewPopUp.scss

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,24 +174,30 @@
174174
}
175175

176176
.preview-popUp__in-out-words {
177-
font-size: 0.8em;
178177
letter-spacing: 0em;
179178

180179
width: 100%;
181180
overflow: hidden;
182-
text-overflow: ellipsis;
181+
text-overflow: clip;
183182
white-space: nowrap;
184183

185-
display: flex;
186-
justify-content: space-between;
187-
184+
margin-top: -25px; //Pull up the in/out words a bit
188185
padding: 7px;
189186

187+
.separation-line {
188+
width: 100%;
189+
height: 1px;
190+
background-color: #5b5b5b;
191+
margin-bottom: 5px;
192+
}
193+
190194
.in-words,
191195
.out-words {
196+
color: white;
197+
font-weight: 500;
192198
white-space: nowrap;
193199
overflow: hidden;
194-
text-overflow: ellipsis;
200+
text-overflow: clip;
195201
}
196202

197203
.out-words {

packages/webui/src/client/ui/PreviewPopUp/PreviewPopUpContent.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export function PreviewPopUpContent({ content, time }: PreviewPopUpContentProps)
3838
case 'inOutWords':
3939
return (
4040
<div className="preview-popUp__in-out-words">
41+
<hr className="separation-line" />
4142
<div className="in-words">{content.in}</div>
4243
<div className="out-words">{content.out}</div>
4344
</div>

packages/webui/src/client/ui/PreviewPopUp/PreviewPopUpContext.tsx

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,13 @@ export function convertSourceLayerItemToPreview(
9898
}
9999
break
100100
case PreviewType.VT:
101+
if (popupPreview.preview.outWords) {
102+
contents.push({
103+
type: 'inOutWords',
104+
in: popupPreview.preview.inWords,
105+
out: popupPreview.preview.outWords,
106+
})
107+
}
101108
if (contentStatus?.previewUrl) {
102109
contents.push({
103110
type: 'video',
@@ -109,13 +116,6 @@ export function convertSourceLayerItemToPreview(
109116
src: contentStatus.thumbnailUrl,
110117
})
111118
}
112-
if (popupPreview.preview.outWords) {
113-
contents.push({
114-
type: 'inOutWords',
115-
in: popupPreview.preview.inWords,
116-
out: popupPreview.preview.outWords,
117-
})
118-
}
119119
break
120120
}
121121
}
@@ -139,6 +139,13 @@ export function convertSourceLayerItemToPreview(
139139
type: 'title',
140140
content: content.fileName,
141141
},
142+
content.lastWords
143+
? {
144+
type: 'inOutWords',
145+
in: content.firstWords,
146+
out: content.lastWords,
147+
}
148+
: undefined,
142149
contentStatus?.previewUrl
143150
? {
144151
type: 'video',
@@ -150,13 +157,6 @@ export function convertSourceLayerItemToPreview(
150157
src: contentStatus.thumbnailUrl,
151158
}
152159
: undefined,
153-
content.lastWords
154-
? {
155-
type: 'inOutWords',
156-
in: content.firstWords,
157-
out: content.lastWords,
158-
}
159-
: undefined,
160160
...(contentStatus?.messages?.map<PreviewContent>((m) => ({
161161
type: 'warning',
162162
content: m as any,
@@ -261,6 +261,7 @@ export function convertSourceLayerItemToPreview(
261261
{
262262
type: 'script',
263263
script: content.fullScript,
264+
firstWords: content.firstWords,
264265
lastWords: content.lastWords,
265266
comment: content.comment,
266267
lastModified: content.lastModified ?? undefined,
@@ -301,6 +302,7 @@ export type PreviewContent =
301302
| {
302303
type: 'script'
303304
script?: string
305+
firstWords?: string
304306
lastWords?: string
305307
comment?: string
306308
lastModified?: number

0 commit comments

Comments
 (0)