Skip to content

Commit 6cb22fb

Browse files
author
Akos Kitta
committed
feat: new UX for the boards/library manager widget
Closes #19 Closes #781 Closes #1591 Closes #1607 Closes #1924 Signed-off-by: Akos Kitta <[email protected]>
1 parent 7721350 commit 6cb22fb

21 files changed

+673
-405
lines changed

Diff for: arduino-ide-extension/package.json

-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
"@types/p-queue": "^2.3.1",
5959
"@types/ps-tree": "^1.1.0",
6060
"@types/react-tabs": "^2.3.2",
61-
"@types/react-virtualized": "^9.21.21",
6261
"@types/temp": "^0.8.34",
6362
"@types/which": "^1.3.1",
6463
"@vscode/debugprotocol": "^1.51.0",
@@ -95,7 +94,6 @@
9594
"react-perfect-scrollbar": "^1.5.8",
9695
"react-select": "^5.6.0",
9796
"react-tabs": "^3.1.2",
98-
"react-virtualized": "^9.22.3",
9997
"react-window": "^1.8.6",
10098
"semver": "^7.3.2",
10199
"string-natural-compare": "^2.0.3",

Diff for: arduino-ide-extension/src/browser/boards/boards-auto-installer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export class BoardsAutoInstaller implements FrontendApplicationContribution {
174174
// CLI returns the packages already sorted with the deprecated ones at the end of the list
175175
// in order to ensure the new ones are preferred
176176
const candidates = packagesForBoard.filter(
177-
({ installable, installedVersion }) => installable && !installedVersion
177+
({ installedVersion }) => !installedVersion
178178
);
179179

180180
return candidates[0];

Diff for: arduino-ide-extension/src/browser/style/boards-config-dialog.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ div#select-board-dialog .selectBoardContainer .list .item.selected i {
165165
border: 1px solid var(--theia-arduino-toolbar-dropdown-border);
166166
display: flex;
167167
gap: 10px;
168-
height: 28px;
168+
height: var(--arduino-button-height);
169169
margin: 0 4px;
170170
overflow: hidden;
171171
padding: 0 10px;

Diff for: arduino-ide-extension/src/browser/style/dialogs.css

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
min-width: 424px;
1414
max-height: 560px;
15-
padding: 0 28px;
15+
padding: 0 var(--arduino-button-height);
1616
}
1717

1818
.p-Widget.dialogOverlay .dialogBlock .dialogTitle {
@@ -35,15 +35,15 @@
3535
}
3636

3737
.p-Widget.dialogOverlay .dialogBlock .dialogContent > input {
38-
margin-bottom: 28px;
38+
margin-bottom: var(--arduino-button-height);
3939
}
4040

4141
.p-Widget.dialogOverlay .dialogBlock .dialogContent > div {
4242
padding: 0 0 12px;
4343
}
4444

4545
.p-Widget.dialogOverlay .dialogBlock .dialogContent .dialogSection {
46-
margin-top: 28px;
46+
margin-top: var(--arduino-button-height);
4747
}
4848
.p-Widget.dialogOverlay .dialogBlock .dialogContent .dialogSection:first-child {
4949
margin-top: 0;

Diff for: arduino-ide-extension/src/browser/style/ide-updater-dialog.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
}
1616

1717
.ide-updater-dialog--logo-container {
18-
margin-right: 28px;
18+
margin-right: var(--arduino-button-height);
1919
}
2020

2121
.ide-updater-dialog--logo {
@@ -76,7 +76,7 @@
7676
.ide-updater-dialog .buttons-container {
7777
display: flex;
7878
justify-content: flex-end;
79-
margin-top: 28px;
79+
margin-top: var(--arduino-button-height);
8080
}
8181

8282
.ide-updater-dialog .buttons-container a.theia-button {

Diff for: arduino-ide-extension/src/browser/style/index.css

+7-7
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
@import './progress-bar.css';
2121
@import './settings-step-input.css';
2222

23+
:root {
24+
--arduino-button-height: 28px;
25+
}
26+
2327
/* Revive of the `--theia-icon-loading`. The variable has been removed from Theia while IDE2 still uses is. */
2428
/* The SVG icons are still part of Theia (1.31.1) */
2529
/* https://github.com/arduino/arduino-ide/pull/1662#issuecomment-1324997134 */
@@ -64,9 +68,9 @@ body.theia-dark {
6468

6569
/* Makes the sidepanel a bit wider when opening the widget */
6670
.p-DockPanel-widget {
67-
min-width: 200px;
71+
min-width: 220px;
6872
min-height: 20px;
69-
height: 200px;
73+
height: 220px;
7074
}
7175

7276
/* Overrule the default Theia CSS button styles. */
@@ -95,7 +99,7 @@ button.theia-button,
9599
}
96100

97101
button.theia-button {
98-
height: 28px;
102+
height: var(--arduino-button-height);
99103
max-width: none;
100104
}
101105

@@ -154,10 +158,6 @@ button.theia-button.message-box-dialog-button {
154158
font-size: 14px;
155159
}
156160

157-
.uppercase {
158-
text-transform: uppercase;
159-
}
160-
161161
/* High Contrast Theme rules */
162162
/* TODO: Remove it when the Theia version is upgraded to 1.27.0 and use Theia APIs to implement it*/
163163
.hc-black.hc-theia.theia-hc button.theia-button:hover,

Diff for: arduino-ide-extension/src/browser/style/list-widget.css

+99-37
Original file line numberDiff line numberDiff line change
@@ -44,24 +44,12 @@
4444
height: 100%; /* This has top be 100% down to the `scrollContainer`. */
4545
}
4646

47-
.filterable-list-container .items-container > div > div:nth-child(odd) {
48-
background-color: var(--theia-sideBar-background);
49-
filter: contrast(105%);
50-
}
51-
52-
.filterable-list-container .items-container > div > div:nth-child(even) {
53-
background-color: var(--theia-sideBar-background);
54-
filter: contrast(95%);
55-
}
56-
57-
.filterable-list-container .items-container > div > div:hover {
58-
background-color: var(--theia-sideBar-background);
59-
filter: contrast(90%);
47+
.filterable-list-container > div > div > div > div > div:focus {
48+
border-left: 1px solid;
6049
}
6150

6251
.component-list-item {
63-
padding: 10px 10px 10px 15px;
64-
font-size: var(--theia-ui-font-size1);
52+
padding: 20px 15px 25px;
6553
}
6654

6755
.component-list-item:hover {
@@ -74,18 +62,29 @@
7462
flex-direction: column;
7563
}
7664

77-
.component-list-item .header .version-info {
65+
.component-list-item .header .title {
66+
display: -webkit-box;
67+
-webkit-box-orient: vertical;
68+
-webkit-line-clamp: 2;
69+
white-space: normal;
70+
overflow: hidden;
71+
text-overflow: ellipsis;
72+
}
73+
74+
.component-list-item .header .title .name {
75+
font-family: 'Open Sans';
76+
font-style: normal;
77+
font-weight: 700;
78+
font-size: 14px;
79+
}
80+
81+
.component-list-item .header .version {
7882
display: flex;
7983
justify-content: space-between;
8084
align-items: center;
8185
}
8286

83-
.component-list-item .header .name {
84-
font-weight: bold;
85-
}
86-
8787
.component-list-item .header .author {
88-
font-weight: bold;
8988
color: var(--theia-panelTitle-inactiveForeground);
9089
}
9190

@@ -95,51 +94,95 @@
9594

9695
.component-list-item .header .version {
9796
color: var(--theia-panelTitle-inactiveForeground);
97+
padding-top: 4px;
9898
}
9999

100100
.component-list-item .footer .theia-button.install {
101101
height: auto; /* resets the default Theia button height in the filterable list widget */
102102
}
103103

104-
.component-list-item .header .installed:before {
105-
margin-left: 4px;
104+
.component-list-item .header .installed-version:before {
105+
min-width: 79px;
106106
display: inline-block;
107107
justify-self: end;
108-
background-color: var(--theia-button-background);
108+
background-color: var(--theia-focusBorder);
109109
padding: 2px 4px 2px 4px;
110-
font-size: 10px;
111-
font-weight: bold;
110+
font-size: 12px;
112111
max-height: calc(1em + 4px);
113-
color: var(--theia-button-foreground);
114-
content: attr(install);
112+
color: var(--theia-titleBar-activeBackground);
113+
content: attr(version);
115114
}
116115

117-
.component-list-item .header .installed:hover:before {
116+
.component-list-item .header .installed-version:hover:before {
118117
background-color: var(--theia-button-foreground);
119118
color: var(--theia-button-background);
120-
content: attr(uninstall);
119+
content: attr(remove);
120+
text-transform: uppercase;
121121
}
122122

123-
.component-list-item[min-width~="170px"] .footer {
124-
padding: 5px 5px 0px 0px;
125-
min-height: 35px;
123+
.component-list-item .content {
126124
display: flex;
127-
flex-direction: row-reverse;
125+
flex-direction: column;
126+
padding-top: 4px;
127+
}
128+
129+
.component-list-item .content > p {
130+
margin-block-start: unset;
131+
margin-block-end: unset;
132+
133+
font-style: normal;
134+
font-weight: 400;
135+
font-size: 12px;
136+
137+
display: -webkit-box;
138+
-webkit-box-orient: vertical;
139+
-webkit-line-clamp: 3;
140+
white-space: normal;
141+
overflow: hidden;
142+
text-overflow: ellipsis;
143+
}
144+
145+
.component-list-item .content > .info {
146+
white-space: nowrap;
128147
}
129148

130149
.component-list-item .footer {
131150
flex-direction: column-reverse;
151+
padding-top: 8px;
132152
}
133153

134154
.component-list-item .footer > * {
135155
display: inline-block;
136-
margin: 5px 0px 0px 10px;
156+
}
157+
158+
.filterable-list-container .separator {
159+
display: flex;
160+
flex-direction: row;
161+
}
162+
163+
.filterable-list-container .separator :last-child,
164+
.filterable-list-container .separator :first-child {
165+
min-height: 8px;
166+
max-height: 8px;
167+
min-width: 8px;
168+
max-width: 8px;
169+
}
170+
171+
div.filterable-list-container > div > div > div > div:nth-child(1) > div.separator :first-child,
172+
div.filterable-list-container > div > div > div > div:nth-child(1) > div.separator :last-child {
173+
display: none;
174+
}
175+
176+
.filterable-list-container .separator .line {
177+
max-height: 1px;
178+
height: 1px;
179+
background-color: var(--theia-activityBar-inactiveForeground);
180+
flex: 1 1 auto;
137181
}
138182

139183
.component-list-item:hover .footer > label {
140184
display: inline-block;
141185
align-self: center;
142-
margin: 5px 0px 0px 10px;
143186
}
144187

145188
.component-list-item .info a {
@@ -151,11 +194,30 @@
151194
text-decoration: underline;
152195
}
153196

197+
.component-list-item .theia-button.secondary.no-border {
198+
border: 2px solid var(--theia-button-foreground)
199+
}
200+
201+
.component-list-item .theia-button.secondary.no-border:hover {
202+
border: 2px solid var(--theia-secondaryButton-foreground)
203+
}
204+
205+
.component-list-item .theia-button {
206+
margin-left: 12px;
207+
}
208+
209+
.component-list-item .theia-select {
210+
height: var(--arduino-button-height);
211+
min-height: var(--arduino-button-height);
212+
width: 65px;
213+
min-width: 65px;
214+
}
215+
154216
/* High Contrast Theme rules */
155217
/* TODO: Remove it when the Theia version is upgraded to 1.27.0 and use Theia APIs to implement it*/
156218
.hc-black.hc-theia.theia-hc .component-list-item .header .installed:hover:before {
157219
background-color: transparent;
158-
outline: 1px dashed var(--theia-focusBorder);
220+
outline: 1px dashed var(--theia-focusBorder);
159221
}
160222

161223
.hc-black.hc-theia.theia-hc .component-list-item .header .installed:before {

Diff for: arduino-ide-extension/src/browser/style/main.css

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
display: flex;
2929
justify-content: center;
3030
align-items: center;
31-
height: 28px;
32-
width: 28px;
31+
height: var(--arduino-button-height);
32+
width: var(--arduino-button-height);
3333
}
3434

3535
.p-TabBar-toolbar .item.arduino-tool-item .arduino-upload-sketch--toolbar,
@@ -66,8 +66,8 @@
6666
}
6767

6868
.arduino-tool-icon {
69-
height: 28px;
70-
width: 28px;
69+
height: var(--arduino-button-height);
70+
width: var(--arduino-button-height);
7171
}
7272

7373
.arduino-verify-sketch--toolbar-icon {

0 commit comments

Comments
 (0)