@adecore/ui 0.50.2 → 0.50.4

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,8 +842,7 @@
842
842
  min-width: 0;
843
843
  min-height: 0;
844
844
  overflow: hidden;
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;
845
+ border-radius: 0 12px 12px 0;
847
846
  /* The surface its regions draw, so no lighter ground shows where the rounded edge cuts them. Roomy shows its gaps in it. */
848
847
  background: var(--surface);
849
848
  box-shadow: 0 0 0 1px var(--border), var(--sheet-shadow);
@@ -884,6 +883,8 @@
884
883
  .ade-workspace[data-layout="roomy"] > .ade-workspace-sheet { background: var(--separator); }
885
884
  /* The gaps already set the sheet apart, and a shadow over them reads as a smudge. */
886
885
  .ade-workspace[data-layout="roomy"] > .ade-workspace-sheet { box-shadow: 0 0 0 1px var(--border); }
886
+ /* Roomy's panes round their own corners, so the sheet's corner on the window's bottom stays square. */
887
+ .ade-workspace[data-layout="roomy"] > .ade-workspace-sheet { border-bottom-right-radius: 0; }
887
888
  .ade-workspace[data-layout="roomy"] > .ade-workspace-sheet > .ade-workspace-center { gap: 8px; }
888
889
  .ade-workspace[data-layout="roomy"] > .ade-workspace-sheet > .ade-workspace-sidebar:not([data-auto]) { margin-right: 8px; }
889
890
  .ade-workspace[data-layout="roomy"] > .ade-workspace-side-panel:not([data-auto]) { margin-left: 8px; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adecore/ui",
3
- "version": "0.50.2",
3
+ "version": "0.50.4",
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,8 +842,7 @@
842
842
  min-width: 0;
843
843
  min-height: 0;
844
844
  overflow: hidden;
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;
845
+ border-radius: 0 12px 12px 0;
847
846
  /* The surface its regions draw, so no lighter ground shows where the rounded edge cuts them. Roomy shows its gaps in it. */
848
847
  background: var(--surface);
849
848
  box-shadow: 0 0 0 1px var(--border), var(--sheet-shadow);
@@ -884,6 +883,8 @@
884
883
  .ade-workspace[data-layout="roomy"] > .ade-workspace-sheet { background: var(--separator); }
885
884
  /* The gaps already set the sheet apart, and a shadow over them reads as a smudge. */
886
885
  .ade-workspace[data-layout="roomy"] > .ade-workspace-sheet { box-shadow: 0 0 0 1px var(--border); }
886
+ /* Roomy's panes round their own corners, so the sheet's corner on the window's bottom stays square. */
887
+ .ade-workspace[data-layout="roomy"] > .ade-workspace-sheet { border-bottom-right-radius: 0; }
887
888
  .ade-workspace[data-layout="roomy"] > .ade-workspace-sheet > .ade-workspace-center { gap: 8px; }
888
889
  .ade-workspace[data-layout="roomy"] > .ade-workspace-sheet > .ade-workspace-sidebar:not([data-auto]) { margin-right: 8px; }
889
890
  .ade-workspace[data-layout="roomy"] > .ade-workspace-side-panel:not([data-auto]) { margin-left: 8px; }