Skip to content

Commit eec119b

Browse files
author
Tajudeen
committed
Fix Windows menubar dropdown visibility issue
- Disable backdrop-filter on Windows titlebar to prevent stacking context issues - Add will-change property to Windows-specific menubar dropdown CSS - Use FloatingPortal for VoidCustomDropdownBox to fix Windows stacking context - Ensures menubar dropdowns appear correctly when appended to document.body on Windows - Fix whitespace indentation issues
1 parent 1f55631 commit eec119b

File tree

4 files changed

+87
-75
lines changed

4 files changed

+87
-75
lines changed

product.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"nameShort": "CortexIDE",
33
"nameLong": "CortexIDE",
44
"cortexVersion": "0.0.8",
5-
"cortexRelease": "0900",
5+
"cortexRelease": "0901",
66
"applicationName": "cortexide",
77
"dataFolderName": ".cortexide",
88
"win32MutexName": "cortexide",

src/vs/base/browser/ui/menu/menubar.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ body > .menubar-menu-items-holder.monaco-menu-container {
116116
transform: none !important;
117117
/* Prevent any stacking context issues */
118118
isolation: auto;
119+
/* Ensure menu appears above all workbench content including titlebar with backdrop-filter */
120+
will-change: auto;
119121
}
120122

121123
.menubar .toolbar-toggle-more {

src/vs/workbench/contrib/cortexide/browser/media/cortexide.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,12 @@ body.monaco-workbench {
149149
box-shadow: var(--cortex-shadow-hairline);
150150
}
151151

152+
/* On Windows, disable backdrop-filter on titlebar to avoid stacking context issues
153+
* that prevent menubar dropdowns from appearing when appended to document.body */
154+
.monaco-workbench.windows .part.titlebar {
155+
backdrop-filter: none;
156+
}
157+
152158
.monaco-workbench .part.activitybar {
153159
background: var(--cortex-surface-3) !important;
154160
border-right: 1px solid var(--cortex-border-strong) !important;

src/vs/workbench/contrib/cortexide/browser/react/src/util/inputs.tsx

Lines changed: 78 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { useAccessor } from './services.js';
1515
import { ITextModel } from '../../../../../../../editor/common/model.js';
1616
import { asCssVariable } from '../../../../../../../platform/theme/common/colorUtils.js';
1717
import { inputBackground, inputForeground } from '../../../../../../../platform/theme/common/colorRegistry.js';
18-
import { useFloating, autoUpdate, offset, flip, shift, size, autoPlacement } from '@floating-ui/react';
18+
import { useFloating, autoUpdate, offset, flip, shift, size, autoPlacement, FloatingPortal } from '@floating-ui/react';
1919
import { URI } from '../../../../../../../base/common/uri.js';
2020
import { getBasename, getFolderName } from '../sidebar-tsx/SidebarChat.js';
2121
import { ChevronRight, File, Folder, FolderClosed, LucideProps } from 'lucide-react';
@@ -1275,22 +1275,22 @@ export const VoidSwitch = ({
12751275
${size === 'sm' ? 'h-5 w-9' : ''}
12761276
${size === 'sm+' ? 'h-5 w-10' : ''}
12771277
${size === 'md' ? 'h-6 w-11' : ''}
1278-
`}
1278+
`}
12791279
>
12801280
<span
12811281
className={`
1282-
inline-block transform rounded-full bg-white dark:bg-zinc-900 shadow transition-transform duration-200 ease-in-out
1283-
${size === 'xxs' ? 'h-2 w-2' : ''}
1284-
${size === 'xs' ? 'h-2.5 w-2.5' : ''}
1285-
${size === 'sm' ? 'h-3 w-3' : ''}
1286-
${size === 'sm+' ? 'h-3.5 w-3.5' : ''}
1287-
${size === 'md' ? 'h-4 w-4' : ''}
1288-
${size === 'xxs' ? (value ? 'translate-x-2.5' : 'translate-x-0.5') : ''}
1289-
${size === 'xs' ? (value ? 'translate-x-3.5' : 'translate-x-0.5') : ''}
1290-
${size === 'sm' ? (value ? 'translate-x-5' : 'translate-x-1') : ''}
1291-
${size === 'sm+' ? (value ? 'translate-x-6' : 'translate-x-1') : ''}
1292-
${size === 'md' ? (value ? 'translate-x-6' : 'translate-x-1') : ''}
1293-
`}
1282+
inline-block transform rounded-full bg-white dark:bg-zinc-900 shadow transition-transform duration-200 ease-in-out
1283+
${size === 'xxs' ? 'h-2 w-2' : ''}
1284+
${size === 'xs' ? 'h-2.5 w-2.5' : ''}
1285+
${size === 'sm' ? 'h-3 w-3' : ''}
1286+
${size === 'sm+' ? 'h-3.5 w-3.5' : ''}
1287+
${size === 'md' ? 'h-4 w-4' : ''}
1288+
${size === 'xxs' ? (value ? 'translate-x-2.5' : 'translate-x-0.5') : ''}
1289+
${size === 'xs' ? (value ? 'translate-x-3.5' : 'translate-x-0.5') : ''}
1290+
${size === 'sm' ? (value ? 'translate-x-5' : 'translate-x-1') : ''}
1291+
${size === 'sm+' ? (value ? 'translate-x-6' : 'translate-x-1') : ''}
1292+
${size === 'md' ? (value ? 'translate-x-6' : 'translate-x-1') : ''}
1293+
`}
12941294
/>
12951295
</div>
12961296
</label>
@@ -1497,64 +1497,68 @@ export const VoidCustomDropdownBox = <T extends NonNullable<any>>({
14971497
</button>
14981498

14991499
{/* Dropdown Menu */}
1500+
{/* On Windows, use FloatingPortal to append dropdown to document.body to avoid stacking context issues
1501+
where the dropdown renders behind the workbench content, similar to VSCode's menubar implementation */}
15001502
{isOpen && (
1501-
<div
1502-
ref={refs.setFloating}
1503-
className="z-[100] bg-void-bg-1 border-void-border-3 border rounded shadow-lg"
1504-
style={{
1505-
position: strategy,
1506-
top: y ?? 0,
1507-
left: x ?? 0,
1508-
width: (matchInputWidth
1509-
? (refs.reference.current instanceof HTMLElement ? refs.reference.current.offsetWidth : 0)
1510-
: Math.max(
1511-
(refs.reference.current instanceof HTMLElement ? refs.reference.current.offsetWidth : 0),
1512-
(measureRef.current instanceof HTMLElement ? measureRef.current.offsetWidth : 0)
1513-
))
1514-
}}
1515-
onWheel={(e) => e.stopPropagation()}
1516-
><div className='overflow-auto max-h-80'>
1517-
1518-
{options.map((option) => {
1519-
const thisOptionIsSelected = getOptionsEqual(option, selectedOption);
1520-
const optionName = getOptionDropdownName(option);
1521-
const optionDetail = getOptionDropdownDetail?.(option) || '';
1522-
1523-
return (
1524-
<div
1525-
key={optionName}
1526-
className={`flex items-center px-2 py-1 pr-4 cursor-pointer whitespace-nowrap
1527-
transition-all duration-100
1528-
${thisOptionIsSelected ? 'bg-blue-500 text-white/80' : 'hover:bg-blue-500 hover:text-white/80'}
1529-
`}
1530-
onClick={() => {
1531-
onChangeOption(option);
1532-
setIsOpen(false);
1533-
}}
1534-
>
1535-
<div className="w-4 flex justify-center flex-shrink-0">
1536-
{thisOptionIsSelected && (
1537-
<svg className="size-3" viewBox="0 0 12 12" fill="none">
1538-
<path
1539-
d="M10 3L4.5 8.5L2 6"
1540-
stroke="currentColor"
1541-
strokeWidth="1.5"
1542-
strokeLinecap="round"
1543-
strokeLinejoin="round"
1544-
/>
1545-
</svg>
1546-
)}
1503+
<FloatingPortal>
1504+
<div
1505+
ref={refs.setFloating}
1506+
className="z-[100] bg-void-bg-1 border-void-border-3 border rounded shadow-lg"
1507+
style={{
1508+
position: strategy,
1509+
top: y ?? 0,
1510+
left: x ?? 0,
1511+
width: (matchInputWidth
1512+
? (refs.reference.current instanceof HTMLElement ? refs.reference.current.offsetWidth : 0)
1513+
: Math.max(
1514+
(refs.reference.current instanceof HTMLElement ? refs.reference.current.offsetWidth : 0),
1515+
(measureRef.current instanceof HTMLElement ? measureRef.current.offsetWidth : 0)
1516+
))
1517+
}}
1518+
onWheel={(e) => e.stopPropagation()}
1519+
><div className='overflow-auto max-h-80'>
1520+
1521+
{options.map((option) => {
1522+
const thisOptionIsSelected = getOptionsEqual(option, selectedOption);
1523+
const optionName = getOptionDropdownName(option);
1524+
const optionDetail = getOptionDropdownDetail?.(option) || '';
1525+
1526+
return (
1527+
<div
1528+
key={optionName}
1529+
className={`flex items-center px-2 py-1 pr-4 cursor-pointer whitespace-nowrap
1530+
transition-all duration-100
1531+
${thisOptionIsSelected ? 'bg-blue-500 text-white/80' : 'hover:bg-blue-500 hover:text-white/80'}
1532+
`}
1533+
onClick={() => {
1534+
onChangeOption(option);
1535+
setIsOpen(false);
1536+
}}
1537+
>
1538+
<div className="w-4 flex justify-center flex-shrink-0">
1539+
{thisOptionIsSelected && (
1540+
<svg className="size-3" viewBox="0 0 12 12" fill="none">
1541+
<path
1542+
d="M10 3L4.5 8.5L2 6"
1543+
stroke="currentColor"
1544+
strokeWidth="1.5"
1545+
strokeLinecap="round"
1546+
strokeLinejoin="round"
1547+
/>
1548+
</svg>
1549+
)}
1550+
</div>
1551+
<span className="flex justify-between items-center w-full gap-x-1">
1552+
<span>{optionName}</span>
1553+
<span className='opacity-60'>{optionDetail}</span>
1554+
</span>
15471555
</div>
1548-
<span className="flex justify-between items-center w-full gap-x-1">
1549-
<span>{optionName}</span>
1550-
<span className='opacity-60'>{optionDetail}</span>
1551-
</span>
1552-
</div>
1553-
);
1554-
})}
1555-
</div>
1556+
);
1557+
})}
1558+
</div>
15561559

1557-
</div>
1560+
</div>
1561+
</FloatingPortal>
15581562
)}
15591563
</div>
15601564
);
@@ -2067,11 +2071,11 @@ export const VoidDiffEditor = ({ uri, searchReplaceBlocks, language }: { uri?: a
20672071
<div className="w-full flex flex-col gap-2">
20682072
{blocks.map((block, index) => (
20692073
<div key={index} className="w-full">
2070-
{blocks.length > 1 && (
2071-
<div className="text-void-fg-4 text-xs mb-1 px-1 void-diff-block-header">
2072-
Change {index + 1} of {blocks.length}
2073-
</div>
2074-
)}
2074+
{blocks.length > 1 && (
2075+
<div className="text-void-fg-4 text-xs mb-1 px-1 void-diff-block-header">
2076+
Change {index + 1} of {blocks.length}
2077+
</div>
2078+
)}
20752079
<SingleDiffEditor block={block} lang={lang} />
20762080
</div>
20772081
))}

0 commit comments

Comments
 (0)