react-os-shell 0.6.8 → 0.6.9

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.
package/dist/index.js CHANGED
@@ -1221,7 +1221,7 @@ function StatusBadge({ status }) {
1221
1221
  }
1222
1222
 
1223
1223
  // src/version.ts
1224
- var VERSION = "0.6.8" ;
1224
+ var VERSION = "0.6.9" ;
1225
1225
  var APP_VERSION = VERSION;
1226
1226
 
1227
1227
  // src/changelog.ts
@@ -3212,8 +3212,8 @@ function StartMenu({
3212
3212
  const subFlyoutRef = useRef(null);
3213
3213
  const hoverTimeout = useRef();
3214
3214
  const childHoverTimeout = useRef();
3215
- const [measuredFlyoutH, setMeasuredFlyoutH] = useState(null);
3216
- const [measuredSubH, setMeasuredSubH] = useState(null);
3215
+ const [measuredFlyout, setMeasuredFlyout] = useState(null);
3216
+ const [measuredSub, setMeasuredSub] = useState(null);
3217
3217
  useEffect(() => {
3218
3218
  if (!open) {
3219
3219
  setSearch("");
@@ -3225,22 +3225,20 @@ function StartMenu({
3225
3225
  useEffect(() => {
3226
3226
  setHoveredChild(null);
3227
3227
  }, [hoveredSection]);
3228
- useEffect(() => {
3229
- setMeasuredFlyoutH(null);
3230
- }, [hoveredSection]);
3231
- useEffect(() => {
3232
- setMeasuredSubH(null);
3233
- }, [hoveredChild]);
3234
3228
  useLayoutEffect(() => {
3235
3229
  if (!flyoutRef.current || !hoveredSection || search.length >= 2) return;
3236
3230
  const h = flyoutRef.current.offsetHeight;
3237
- if (h !== measuredFlyoutH) setMeasuredFlyoutH(h);
3238
- }, [hoveredSection, search, measuredFlyoutH]);
3231
+ if (measuredFlyout?.key !== hoveredSection || measuredFlyout.h !== h) {
3232
+ setMeasuredFlyout({ key: hoveredSection, h });
3233
+ }
3234
+ }, [hoveredSection, search, measuredFlyout]);
3239
3235
  useLayoutEffect(() => {
3240
3236
  if (!subFlyoutRef.current || !hoveredChild || search.length >= 2) return;
3241
3237
  const h = subFlyoutRef.current.offsetHeight;
3242
- if (h !== measuredSubH) setMeasuredSubH(h);
3243
- }, [hoveredChild, search, measuredSubH]);
3238
+ if (measuredSub?.key !== hoveredChild || measuredSub.h !== h) {
3239
+ setMeasuredSub({ key: hoveredChild, h });
3240
+ }
3241
+ }, [hoveredChild, search, measuredSub]);
3244
3242
  useEffect(() => {
3245
3243
  if (!open) return;
3246
3244
  const handler = (e) => {
@@ -3374,7 +3372,7 @@ function StartMenu({
3374
3372
  const menuGlass = glassStyle();
3375
3373
  const itemCls = `w-full flex items-center gap-2 rounded-lg ${sizeConfig.px} ${sizeConfig.py} ${sizeConfig.text}`;
3376
3374
  const flyoutEstH = flyoutItems.length * sizeConfig.itemH + 12;
3377
- const flyoutH = measuredFlyoutH ?? flyoutEstH;
3375
+ const flyoutH = measuredFlyout?.key === hoveredSection ? measuredFlyout.h : flyoutEstH;
3378
3376
  const menuWidth = sizeConfig.mw;
3379
3377
  const menuRect = menuRef.current?.getBoundingClientRect();
3380
3378
  const minTop = menuRect ? menuRect.top : taskbarPosition === "top" ? taskbarH + 4 : 4;
@@ -3641,7 +3639,7 @@ function StartMenu({
3641
3639
  const flyoutRect = flyoutRef.current?.getBoundingClientRect();
3642
3640
  const subLeft = flyoutRect ? flyoutRect.right + 4 : 0;
3643
3641
  const subEstH = kids.length * sizeConfig.itemH + 12;
3644
- const subH = measuredSubH ?? subEstH;
3642
+ const subH = measuredSub?.key === hoveredChild ? measuredSub.h : subEstH;
3645
3643
  let subTop = hoveredChildY - subH / 2;
3646
3644
  if (subTop < minTop) subTop = minTop;
3647
3645
  if (subTop + subH > maxBottom) subTop = Math.max(minTop, maxBottom - subH);