Skip to content

Commit a59e6e9

Browse files
authored
Revert "Linked Time: Update prospective fob styling" (#6068)
Reverts #6055 This breaks zooming 🤦‍♂️
1 parent 068843a commit a59e6e9

File tree

8 files changed

+32
-75
lines changed

8 files changed

+32
-75
lines changed

tensorboard/webapp/metrics/views/card_renderer/scalar_card_test.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3455,23 +3455,20 @@ describe('scalar card', () => {
34553455
expect(fobs.length).toEqual(1);
34563456

34573457
// Click the prospective fob to set the start time
3458-
testController.prospectiveFobClicked(new MouseEvent('mouseclick'));
3459-
fixture.detectChanges();
3460-
3461-
// One start fob
3462-
fobs = fixture.debugElement.queryAll(By.directive(CardFobComponent));
3463-
expect(fobs.length).toEqual(2);
3458+
fixture.debugElement
3459+
.query(By.css('.prospective-fob-area'))
3460+
.nativeElement.click();
34643461
fixture.detectChanges();
34653462

34663463
// One start fob + 1 prospective fob
3467-
testController.prospectiveStep = 25;
3468-
fixture.detectChanges();
3469-
34703464
fobs = fixture.debugElement.queryAll(By.directive(CardFobComponent));
34713465
expect(fobs.length).toEqual(2);
34723466

34733467
// Click the prospective fob to set the end time
3474-
testController.prospectiveFobClicked(new MouseEvent('mouseclick'));
3468+
testController.prospectiveStep = 25;
3469+
fixture.debugElement
3470+
.query(By.css('.prospective-fob-area'))
3471+
.nativeElement.click();
34753472
fixture.detectChanges();
34763473

34773474
// One start fob, one end fob

tensorboard/webapp/widgets/card_fob/card_fob_component.ng.html

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515
limitations under the License.
1616
-->
1717

18-
<div
19-
[ngClass]="{'fob': true, 'unremovable': !allowRemoval, 'prospective': isProspective}"
20-
>
18+
<div class="fob">
2119
<span
2220
contenteditable
2321
#stepSpan
@@ -36,11 +34,4 @@
3634
>
3735
<mat-icon svgIcon="close_24px"></mat-icon>
3836
</button>
39-
<button
40-
aria-label="Deselect fob"
41-
(click)="fobRemoved.emit()"
42-
*ngIf="isProspective"
43-
>
44-
<mat-icon svgIcon="keep_24px"></mat-icon>
45-
</button>
4637
</div>

tensorboard/webapp/widgets/card_fob/card_fob_component.scss

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,35 +25,14 @@ limitations under the License.
2525
border-radius: 25px;
2626
padding: 2px 2px 2px 4px;
2727
font-size: 11px;
28-
text-align: center;
2928
width: min-content;
3029

31-
> .prospective {
32-
padding-top: 1px;
33-
}
34-
3530
&:hover {
3631
cursor: grab;
37-
38-
&.prospective {
39-
cursor: pointer;
40-
}
4132
}
4233
&:active {
4334
cursor: grabbing;
4435
}
45-
46-
&.unremovable {
47-
padding: 2px 4px;
48-
}
49-
50-
&.prospective {
51-
align-items: center;
52-
box-sizing: border-box;
53-
border: 1px dashed mat.get-color-from-palette(mat.$gray-palette, 500);
54-
font-weight: bold;
55-
height: 17px;
56-
}
5736
}
5837

5938
span {

tensorboard/webapp/widgets/card_fob/card_fob_component.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ export class CardFobComponent {
3838

3939
@Input() allowRemoval?: boolean = true;
4040

41-
@Input() isProspective?: boolean = false;
42-
4341
@Output() stepChanged = new EventEmitter<number | null>();
4442
@Output() fobRemoved = new EventEmitter();
4543

tensorboard/webapp/widgets/card_fob/card_fob_controller_component.ng.html

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,36 +15,30 @@
1515
limitations under the License.
1616
-->
1717

18-
<div class="card-fob-controller">
18+
<div>
1919
<ng-container
2020
*ngIf="isProspectiveFobFeatureEnabled && !rangeSelectionEnabled"
2121
>
2222
<div
23-
*ngIf="showExtendedLine && prospectiveStep !== null"
24-
class="extended-line"
23+
#prospectiveFobWrapper
24+
*ngIf="prospectiveStep !== null"
25+
class="time-fob-wrapper prospectiveFob"
2526
[style.transform]="getCssTranslatePxForProspectiveFob()"
26-
></div>
27+
>
28+
<div *ngIf="showExtendedLine" class="extended-line"></div>
29+
<card-fob
30+
[ngClass]="isVertical() ? 'vertical-fob' : 'horizontal-fob'"
31+
[allowRemoval]="false"
32+
[step]="prospectiveStep"
33+
></card-fob>
34+
</div>
2735
<div
2836
class="prospective-fob-area"
2937
[ngClass]="isVertical() ? 'vertical-prospective-area' : 'horizontal-prospective-area'"
30-
(mousemove)="mouseOverProspectiveFobArea($event)"
38+
(mousemove)="mouseOver($event)"
3139
(mouseleave)="onProspectiveAreaMouseLeave()"
32-
>
33-
<div
34-
#prospectiveFobWrapper
35-
*ngIf="prospectiveStep !== null"
36-
(click)="prospectiveFobClicked($event)"
37-
class="time-fob-wrapper"
38-
[style.transform]="getCssTranslatePxForProspectiveFob()"
39-
>
40-
<card-fob
41-
[ngClass]="isVertical() ? 'vertical-fob' : 'horizontal-fob'"
42-
[allowRemoval]="false"
43-
[isProspective]="true"
44-
[step]="prospectiveStep"
45-
></card-fob>
46-
</div>
47-
</div>
40+
(click)="prospectiveFobClicked($event)"
41+
></div>
4842
</ng-container>
4943
<div
5044
#startFobWrapper

tensorboard/webapp/widgets/card_fob/card_fob_controller_component.scss

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ limitations under the License.
1616
pointer-events: all;
1717
}
1818

19-
.card-fob-controller {
20-
height: calc(100% + 30px);
21-
position: relative;
22-
}
23-
2419
.time-fob-wrapper {
2520
display: inline-block;
2621
position: absolute;
@@ -56,6 +51,11 @@ limitations under the License.
5651
}
5752
}
5853

54+
.prospectiveFob {
55+
opacity: 0.8;
56+
cursor: pointer;
57+
}
58+
5959
.horizontal-prospective-area {
6060
bottom: 0;
6161
position: absolute;

tensorboard/webapp/widgets/card_fob/card_fob_controller_component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ export class CardFobControllerComponent {
240240
this.hasFobMoved = true;
241241
}
242242

243-
mouseOverProspectiveFobArea(event: MouseEvent) {
243+
mouseOver(event: MouseEvent) {
244244
if (
245245
this.timeSelection?.end !== null &&
246246
this.timeSelection?.end !== undefined

tensorboard/webapp/widgets/card_fob/card_fob_controller_test.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,11 +1417,9 @@ describe('card_fob_controller', () => {
14171417
});
14181418
fixture.detectChanges();
14191419

1420-
const testController = fixture.debugElement.query(
1421-
By.directive(CardFobControllerComponent)
1422-
).componentInstance;
1423-
testController.prospectiveFobClicked(new MouseEvent('mouseclick'));
1424-
1420+
fixture.debugElement
1421+
.query(By.css('.prospective-fob-area'))
1422+
.nativeElement.click();
14251423
expect(onTimeSelectionChanged.calls.allArgs()).toEqual([
14261424
[
14271425
{

0 commit comments

Comments
 (0)