@adecore/ui 0.50.1 → 0.50.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -80,9 +80,28 @@ export function CommandPaletteVirtualList({
80
80
  }
81
81
  const highlight = (index_0, reason) => {
82
82
  const row = itemRows[index_0];
83
- if (row !== undefined && reason !== 'pointer') {
84
- virtualizer.scrollToIndex(row, {
85
- align: reason === 'none' ? 'start' : 'auto'
83
+ if (row === undefined || reason === 'pointer') {
84
+ return;
85
+ }
86
+ // The first item of a group brings its label along, so the list never opens on half a label.
87
+ const label = row > 0 && rows[row - 1].index === -1 ? row - 1 : null;
88
+ if (reason === 'none') {
89
+ const target = label ?? row;
90
+ if (target === 0) {
91
+ virtualizer.scrollToOffset(0);
92
+ } else {
93
+ virtualizer.scrollToIndex(target, {
94
+ align: 'start'
95
+ });
96
+ }
97
+ return;
98
+ }
99
+ virtualizer.scrollToIndex(row, {
100
+ align: 'auto'
101
+ });
102
+ if (label !== null) {
103
+ virtualizer.scrollToIndex(label, {
104
+ align: 'auto'
86
105
  });
87
106
  }
88
107
  };
@@ -92,7 +111,7 @@ export function CommandPaletteVirtualList({
92
111
  scroll.current = null;
93
112
  }
94
113
  };
95
- }, [scroll, virtualizer, itemRows]);
114
+ }, [scroll, virtualizer, itemRows, rows]);
96
115
  const visible = virtualizer.getVirtualItems();
97
116
  const visibleGroups = new Map();
98
117
  for (const item of visible) {
package/dist/theme.css CHANGED
@@ -842,7 +842,8 @@
842
842
  min-width: 0;
843
843
  min-height: 0;
844
844
  overflow: hidden;
845
- border-radius: 0 12px 12px 0;
845
+ /* Rounded where it meets the window's top, square where it stands on the window's bottom. */
846
+ border-radius: 0 12px 0 0;
846
847
  /* The surface its regions draw, so no lighter ground shows where the rounded edge cuts them. Roomy shows its gaps in it. */
847
848
  background: var(--surface);
848
849
  box-shadow: 0 0 0 1px var(--border), var(--sheet-shadow);
@@ -881,6 +882,8 @@
881
882
  .ade-workspace-sidebar[data-auto], .ade-workspace-side-panel[data-auto] { display: contents; }
882
883
  .ade-workspace[data-layout="roomy"],
883
884
  .ade-workspace[data-layout="roomy"] > .ade-workspace-sheet { background: var(--separator); }
885
+ /* The gaps already set the sheet apart, and a shadow over them reads as a smudge. */
886
+ .ade-workspace[data-layout="roomy"] > .ade-workspace-sheet { box-shadow: 0 0 0 1px var(--border); }
884
887
  .ade-workspace[data-layout="roomy"] > .ade-workspace-sheet > .ade-workspace-center { gap: 8px; }
885
888
  .ade-workspace[data-layout="roomy"] > .ade-workspace-sheet > .ade-workspace-sidebar:not([data-auto]) { margin-right: 8px; }
886
889
  .ade-workspace[data-layout="roomy"] > .ade-workspace-side-panel:not([data-auto]) { margin-left: 8px; }
@@ -270,7 +270,7 @@ export function Workspace(t0) {
270
270
  if ($[63] !== t23 || $[64] !== t24) {
271
271
  t25 = {
272
272
  top: t23,
273
- right: true,
273
+ right: false,
274
274
  bottom: true,
275
275
  left: t24
276
276
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adecore/ui",
3
- "version": "0.50.1",
3
+ "version": "0.50.3",
4
4
  "description": "React components, a theme, formatters and a settings dialog for desktop-grade apps on React 19, Base UI and Tailwind 4.",
5
5
  "license": "FSL-1.1-MIT",
6
6
  "author": "Bas Milius",
@@ -90,8 +90,29 @@ export function CommandPaletteVirtualList<ItemValue, Group extends { items: read
90
90
  const highlight = (index: number, reason: string): void => {
91
91
  const row = itemRows[index];
92
92
 
93
- if (row !== undefined && reason !== 'pointer') {
94
- virtualizer.scrollToIndex(row, { align: reason === 'none' ? 'start' : 'auto' });
93
+ if (row === undefined || reason === 'pointer') {
94
+ return;
95
+ }
96
+
97
+ // The first item of a group brings its label along, so the list never opens on half a label.
98
+ const label = row > 0 && rows[row - 1]!.index === -1 ? row - 1 : null;
99
+
100
+ if (reason === 'none') {
101
+ const target = label ?? row;
102
+
103
+ if (target === 0) {
104
+ virtualizer.scrollToOffset(0);
105
+ } else {
106
+ virtualizer.scrollToIndex(target, { align: 'start' });
107
+ }
108
+
109
+ return;
110
+ }
111
+
112
+ virtualizer.scrollToIndex(row, { align: 'auto' });
113
+
114
+ if (label !== null) {
115
+ virtualizer.scrollToIndex(label, { align: 'auto' });
95
116
  }
96
117
  };
97
118
 
@@ -102,7 +123,7 @@ export function CommandPaletteVirtualList<ItemValue, Group extends { items: read
102
123
  scroll.current = null;
103
124
  }
104
125
  };
105
- }, [scroll, virtualizer, itemRows]);
126
+ }, [scroll, virtualizer, itemRows, rows]);
106
127
 
107
128
  const visible = virtualizer.getVirtualItems();
108
129
  const visibleGroups = new Map<number, typeof visible>();
package/src/theme.css CHANGED
@@ -842,7 +842,8 @@
842
842
  min-width: 0;
843
843
  min-height: 0;
844
844
  overflow: hidden;
845
- border-radius: 0 12px 12px 0;
845
+ /* Rounded where it meets the window's top, square where it stands on the window's bottom. */
846
+ border-radius: 0 12px 0 0;
846
847
  /* The surface its regions draw, so no lighter ground shows where the rounded edge cuts them. Roomy shows its gaps in it. */
847
848
  background: var(--surface);
848
849
  box-shadow: 0 0 0 1px var(--border), var(--sheet-shadow);
@@ -881,6 +882,8 @@
881
882
  .ade-workspace-sidebar[data-auto], .ade-workspace-side-panel[data-auto] { display: contents; }
882
883
  .ade-workspace[data-layout="roomy"],
883
884
  .ade-workspace[data-layout="roomy"] > .ade-workspace-sheet { background: var(--separator); }
885
+ /* The gaps already set the sheet apart, and a shadow over them reads as a smudge. */
886
+ .ade-workspace[data-layout="roomy"] > .ade-workspace-sheet { box-shadow: 0 0 0 1px var(--border); }
884
887
  .ade-workspace[data-layout="roomy"] > .ade-workspace-sheet > .ade-workspace-center { gap: 8px; }
885
888
  .ade-workspace[data-layout="roomy"] > .ade-workspace-sheet > .ade-workspace-sidebar:not([data-auto]) { margin-right: 8px; }
886
889
  .ade-workspace[data-layout="roomy"] > .ade-workspace-side-panel:not([data-auto]) { margin-left: 8px; }
@@ -85,8 +85,8 @@ export function Workspace({
85
85
  }
86
86
  });
87
87
 
88
- // The content ends at the sheet's own edge, whatever stands beside it.
89
- const context = { layout, edges: { top: !hasToolbar, right: true, bottom: true, left: !leftOpen } };
88
+ // The sheet's right edge is rounded, so panes along it keep their corners, whatever stands beside the sheet.
89
+ const context = { layout, edges: { top: !hasToolbar, right: false, bottom: true, left: !leftOpen } };
90
90
 
91
91
  return (
92
92
  <WorkspaceContext value={context}>