Skip to content

Commit 93e3ebf

Browse files
committed
fix: resolve color swatch styling and session card live update
- Add ViewEncapsulation.None to match other Leapp dialogs; BsModal renders components outside Angular's view tree so emulated encapsulation does not apply, causing the dark theme button rule to bleed through - Call behaviouralSubjectService.setSessions() after saving the color so the dot indicator on session cards updates immediately without a restart Signed-off-by: Jeremy Snidaro <jeremy.snidaro@papernest.com> Signed-off-by: Jeremy SNIDARO <jeremy.snidaro@papernest.com>
1 parent bc00319 commit 93e3ebf

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

packages/desktop-app/src/app/components/dialogs/change-color-dialog/change-color-dialog.component.scss

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,16 @@
2424
align-items: center;
2525
cursor: pointer;
2626
gap: 4px;
27-
background: none;
27+
background: none !important;
2828
border: none;
2929
padding: 0;
30+
outline: none;
31+
-webkit-appearance: none;
32+
appearance: none;
33+
34+
&:focus-visible .color-swatch {
35+
box-shadow: 0 0 0 3px white, 0 0 0 5px rgba(0, 0, 0, 0.4);
36+
}
3037

3138
&:hover .color-swatch {
3239
transform: scale(1.15);

packages/desktop-app/src/app/components/dialogs/change-color-dialog/change-color-dialog.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, Input, OnInit } from "@angular/core";
1+
import { Component, Input, OnInit, ViewEncapsulation } from "@angular/core";
22
import { Session } from "@noovolari/leapp-core/models/session";
33
import { AppService } from "../../../services/app.service";
44
import { AppProviderService } from "../../../services/app-provider.service";
@@ -20,6 +20,7 @@ export const containerColors: { name: string; hex: string }[] = [
2020
selector: "app-change-color-dialog",
2121
templateUrl: "./change-color-dialog.component.html",
2222
styleUrls: ["./change-color-dialog.component.scss"],
23+
encapsulation: ViewEncapsulation.None,
2324
})
2425
export class ChangeColorDialogComponent implements OnInit {
2526
@Input()
@@ -50,6 +51,7 @@ export class ChangeColorDialogComponent implements OnInit {
5051
if (this.selectedColor) {
5152
this.session.color = this.selectedColor;
5253
this.appProviderService.repository.updateSession(this.session.sessionId, this.session);
54+
this.appProviderService.behaviouralSubjectService.setSessions(this.appProviderService.repository.getSessions());
5355
this.messageToasterService.toast("Color has been changed!", ToastLevel.success, "Color changed!");
5456
this.closeModal();
5557
}

0 commit comments

Comments
 (0)