Skip to content

Commit 309c4f2

Browse files
iftenneyLIT team
authored andcommitted
Fix disappearing display controls in Sequence Salience.
Left-side toolbar controls were one long non-wrapping block, so if the module was narrow enough these would clip. This splits them into two blocks, allowing them to wrap, and adds a spacer to maintain the intended positioning. PiperOrigin-RevId: 616319869
1 parent d108b59 commit 309c4f2

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

lit_nlp/client/modules/lm_salience_module.css

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,11 @@ select:invalid {
133133
margin-right: 8px;
134134
}
135135

136+
.flex-grow-spacer {
137+
flex: 1;
138+
margin: 0;
139+
}
140+
136141
#change-target-button {
137142
white-space: nowrap;
138143
margin: 0; /* have enough already from controls-group */
@@ -173,13 +178,13 @@ select:invalid {
173178
* Helps in SxS mode when the module is replicated.
174179
*/
175180
@container (width < 720px) {
176-
#granularity-label {
181+
#method-label {
177182
display: none;
178183
}
179184
}
180185

181186
@container (width < 660px) {
182-
#change-target-button, #method-label, #colormap-slider-label {
187+
#change-target-button, #granularity-label, #colormap-slider-label {
183188
display: none;
184189
}
185190

lit_nlp/client/modules/lm_salience_module.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,8 @@ export class LMSalienceModule extends SingleExampleSingleModelModule {
598598
.options=${segmentationOptions}
599599
?disabled=${this.currentTokens.length === 0}>
600600
</lit-fused-button-bar>
601+
</div>
602+
<div class="controls-group" style="gap: 8px;">
601603
<lit-switch
602604
?selected=${!this.denseView}
603605
@change=${onClickToggleDensity}>
@@ -620,6 +622,7 @@ export class LMSalienceModule extends SingleExampleSingleModelModule {
620622
${this.underline ? 'font_download' : 'format_color_text'}
621623
</mwc-icon>
622624
</div>
625+
<div class='flex-grow-spacer'></div>
623626
`;
624627
}
625628

0 commit comments

Comments
 (0)