fix(desktop): 네이티브 위젯 picker를 창 전체 뷰로 전환

portal/overlay 대신 widget-main에서 picker 전용 화면으로 전환해
macOS·Windows WebView 모두에서 위젯 선택 팝업이 보이도록 합니다.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Macbook
2026-06-15 16:49:25 +09:00
parent 1804328b9b
commit 36b4679c9a
4 changed files with 130 additions and 73 deletions
@@ -12,6 +12,8 @@ interface Props {
onSelect: (widgetType: string) => void;
/** Tauri 네이티브 위젯 창 — OS 창 전체를 쓰는 고정형 picker */
nativeCompact?: boolean;
/** 네이티브 위젯 창 루트를 picker 전용으로 쓸 때 (overlay 없음) */
nativeFullRoot?: boolean;
}
function pickerMeta(category: WidgetPickerCategory) {
@@ -69,36 +71,45 @@ const NativeWidgetPicker: React.FC<Props> = ({
category,
onClose,
onSelect,
nativeFullRoot = false,
}) => {
if (!open) return null;
const { title } = pickerMeta(category);
const shell = (
<div
className="wd-picker-native-shell"
role="dialog"
aria-modal="true"
aria-labelledby="wd-picker-native-title"
>
<div className="wd-picker-native-header">
<h2 id="wd-picker-native-title" className="wd-picker-native-title">
{title}
<span className="wd-picker-native-title-ko"> (Widget)</span>
</h2>
<button
type="button"
className="wd-picker-native-close"
onClick={onClose}
aria-label="닫기"
>
</button>
</div>
<div className="wd-picker-native-body wd-picker-popup-body">
<WidgetPickerContent category={category} onSelect={onSelect} onClose={onClose} />
</div>
</div>
);
if (nativeFullRoot) {
return <div className="wd-picker-native-root">{shell}</div>;
}
return (
<div className="wd-picker-native-overlay" role="presentation">
<div
className="wd-picker-native-shell"
role="dialog"
aria-modal="true"
aria-labelledby="wd-picker-native-title"
>
<div className="wd-picker-native-header">
<h2 id="wd-picker-native-title" className="wd-picker-native-title">
{title}
<span className="wd-picker-native-title-ko"> (Widget)</span>
</h2>
<button
type="button"
className="wd-picker-native-close"
onClick={onClose}
aria-label="닫기"
>
</button>
</div>
<div className="wd-picker-native-body wd-picker-popup-body">
<WidgetPickerContent category={category} onSelect={onSelect} onClose={onClose} />
</div>
</div>
{shell}
</div>
);
};
@@ -109,6 +120,7 @@ const WidgetPickerModal: React.FC<Props> = ({
onClose,
onSelect,
nativeCompact = false,
nativeFullRoot = false,
}) => {
if (!open) return null;
@@ -119,6 +131,7 @@ const WidgetPickerModal: React.FC<Props> = ({
category={category}
onClose={onClose}
onSelect={onSelect}
nativeFullRoot={nativeFullRoot}
/>
);
}