Skip to content

Commit 0d7d5cb

Browse files
Try to not hide connection card (not yet wired up)
1 parent d2e3929 commit 0d7d5cb

File tree

2 files changed

+29
-4
lines changed

2 files changed

+29
-4
lines changed

kernel/src/components/Dialog.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,16 @@ export class Dialog {
2727
const header = this.createHeader();
2828
const optionsContainer = this.createOptionsContainer();
2929

30-
30+
// this.connectCard = new ConnectCard(
31+
// {
32+
// action: 'connect',
33+
// icon: '🔌',
34+
// title: 'Connect Device',
35+
// description: 'Connect to RedBoard via serial',
36+
// color: 'var(--ui-navy)'
37+
// },
38+
// props.serviceContainer.deviceService);
39+
3140
this.flashCard = new FlashCard({
3241
action: 'flash',
3342
icon: '⚡️',

kernel/src/panel.ts

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { globalStyles, animations, overlayStyles, dialogStyles, minimizedStyles, cardStyles, buttonStyles, progressOverlayStyles } from './styles';
22
import { MinimizedButton } from './components/MinimizedButton';
33
// import { Dialog } from './components/Dialog';
4-
// import { ServiceContainer } from './services/ServiceContainer';
4+
import { ServiceContainer } from './services/ServiceContainer';
55

66
// class DialogPanel {
77
// private element: HTMLDivElement;
@@ -91,7 +91,7 @@ export default class WelcomePanel {
9191
private minimizedPanel: MinimizedPanel;
9292
// private dialogPanel: DialogPanel;
9393

94-
constructor() {
94+
constructor(private serviceContainer: ServiceContainer) {
9595

9696
this.element = document.createElement('div');
9797
this.element.id = 'jp-kernel-welcome-panel';
@@ -109,6 +109,21 @@ export default class WelcomePanel {
109109
].join('\n');
110110
document.head.appendChild(styleElement);
111111

112+
// TODO:
113+
// 1) We no longer want the dialog to be shown on startup and we also don't want it
114+
// to be shown when the user clicks on the minimized button.
115+
// 2) We want to act as if the connect card was clicked when the user clicks on the minimized button.
116+
// 3) We want there to be a new popup if connecting to the device fails that contains suggestions for why
117+
118+
// currently objects are like this:
119+
120+
// WelcomePanel -> MinimizedPanel -> MinimizedButton -> DeviceService <-|
121+
// WelcomePanel -> DialogPanel -> Dialog -> ConnectCard -> DeviceService <-|
122+
// We want to change this to be like this:
123+
// WelcomePanel -> MinimizedPanel -> MinimizedButton -> DeviceService
124+
125+
// need a good way to add the same connection behavior but up a level
126+
112127
const minimizedButton = new MinimizedButton(() => this.show());
113128
this.minimizedPanel = new MinimizedPanel(minimizedButton);
114129

@@ -156,6 +171,7 @@ export default class WelcomePanel {
156171
}
157172

158173
show(): void {
174+
// This is where we will do or invoke the toggling of the connection
159175
this.element.style.display = 'block';
160176
this.element.classList.remove('minimized');
161177
this.element.classList.add('visible');
@@ -164,7 +180,7 @@ export default class WelcomePanel {
164180
this.element.style.opacity = '1';
165181

166182
// this.dialogPanel.show();
167-
this.minimizedPanel.hide();
183+
//this.minimizedPanel.hide();
168184
}
169185

170186
hide(): void {

0 commit comments

Comments
 (0)