дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-09 03:05:40 +02:00
Message dialogs: `Dialog` gets an `icon` (question / info / warning / error) that renders IDEA's alert layout: no title bar, a 32px icon, bold title, text, checkbox under it. Every confirmation helper (prompt, VCS, services, project tree, keymap, LSP choices, run, database, Replace All) uses it. Open Project matches IDEA: "This Window" is the default and has focus. The Code Analysis and TODO commit checks default to Review. Project widget: the title bar project button opens a popup like IDEA's ProjectWidget, with Open… / Clone Repository…, the projects open in other windows (new `window_open_projects` command) and recent projects, filtered by typing. Chinese UI: UI text stays written in English and is translated through a source-text catalog (`locales/text/zh.json`, about 2300 strings). The UI primitives (buttons, checkboxes, selects, tabs, dialogs, menus, tooltips, toasts, settings labels and hints) translate the strings they are given. Action titles and categories are localised in the registry, and static JSX text uses `<T>`, so text follows a locale switch without a reload. The Settings window now syncs the locale too. Settings search matches both languages. Claude-Session: https://claude.ai/code/session_01B65qLEKnkeYTGdbwhLpjCu
41 рядки
1.2 KiB
TypeScript
41 рядки
1.2 KiB
TypeScript
import { useEffect } from "react";
|
||
import { create } from "zustand";
|
||
import { useProject } from "@/platform/project";
|
||
import { Dialog, T } from "@/ui";
|
||
import { RecentList } from "./RecentList";
|
||
import { loadRecent } from "./recent";
|
||
import styles from "./Welcome.module.css";
|
||
|
||
export const useRecentPopup = create<{ open: boolean }>(() => ({ open: false }));
|
||
|
||
export function showRecentProjectsPopup() {
|
||
useRecentPopup.setState({ open: true });
|
||
}
|
||
|
||
const close = () => useRecentPopup.setState({ open: false });
|
||
|
||
/** File › Open Recent: chooser over recent projects (overlay contribution). */
|
||
export function RecentProjectsPopup() {
|
||
const open = useRecentPopup((s) => s.open);
|
||
const current = useProject((s) => s.project?.root ?? null);
|
||
useEffect(() => {
|
||
if (open) void loadRecent();
|
||
}, [open]);
|
||
return (
|
||
<Dialog
|
||
open={open}
|
||
onClose={close}
|
||
position="top"
|
||
width={560}
|
||
transparentBackdrop
|
||
aria-label="Recent Projects"
|
||
className={styles.popup}
|
||
>
|
||
<div className={styles.popupHeader}>
|
||
<T>Recent Projects</T>
|
||
</div>
|
||
<RecentList compact autoFocus exclude={current} onOpened={close} className={styles.popupList} />
|
||
</Dialog>
|
||
);
|
||
}
|