diff --git a/packages/docs/content/en/manual/features/instances.mdx b/packages/docs/content/en/manual/features/instances.mdx new file mode 100644 index 00000000..46a9014f --- /dev/null +++ b/packages/docs/content/en/manual/features/instances.mdx @@ -0,0 +1,42 @@ +--- +title: Instance Library +description: Search, inspect, launch, migrate, and recover isolated Minecraft environments +--- + +# Instance Library + +The instance library is the operating surface for every isolated Minecraft environment in DropOut. Selecting an instance also makes it the active instance used by the Home launch command center, so the library and launch state never point at different environments. + +## Find an instance + +Use the search field to match an instance name, Minecraft version, loader, or notes. Sort the result by: + +- **Last played** for the environments you use most often; +- **Name** for large, structured libraries; +- **Created** for recently added or imported environments. + +List view keeps dense libraries scannable. Grid view gives smaller libraries more visual separation. DropOut remembers the selected presentation on the current device. + +## Read launch state + +Each visible instance is checked progressively so a large library does not issue hundreds of runtime probes at once. The readiness marker uses the same backend check as the Home command center and considers the selected Minecraft version, local game files, compatible Java runtime, account, and memory override. + +The active workspace on the right shows: + +- Minecraft version, loader, and launch readiness; +- local file and Java availability; +- memory and Java overrides; +- enabled and disabled mod count; +- notes, creation date, and the managed game directory. + +Use **Launch active instance** as the primary action. Opening another card changes the active instance everywhere, including Home. + +## Manage and move environments + +Secondary commands are grouped under the instance menu. From there you can open the game directory, edit metadata and runtime overrides, duplicate the environment, manage mods, browse content, export a ZIP, or delete it. The active workspace repeats the most useful shortcuts without hiding launch state. + +Use **Library actions** to import a ZIP, migrate instances from Prism/MultiMC or PCL/HMCL, or repair the instance index from directories on disk. + +## Delete safely + +Deletion removes the managed game directory and cannot be undone from DropOut. Export the instance first when you may need its saves, mods, resource packs, or configuration later. Cancel the confirmation dialog if the target name or recovery plan is not correct. diff --git a/packages/docs/content/en/manual/features/meta.json b/packages/docs/content/en/manual/features/meta.json index fcaa9ad8..34099d98 100644 --- a/packages/docs/content/en/manual/features/meta.json +++ b/packages/docs/content/en/manual/features/meta.json @@ -1,4 +1,4 @@ { "title": "Features", - "pages": ["index", "authentication", "java", "mod-loaders"] + "pages": ["index", "instances", "authentication", "java", "mod-loaders"] } diff --git a/packages/docs/content/zh/manual/features/instances.mdx b/packages/docs/content/zh/manual/features/instances.mdx new file mode 100644 index 00000000..7699bb8d --- /dev/null +++ b/packages/docs/content/zh/manual/features/instances.mdx @@ -0,0 +1,42 @@ +--- +title: 实例库 +description: 搜索、检查、启动、迁移并修复隔离的 Minecraft 环境 +--- + +# 实例库 + +实例库用于管理 DropOut 中所有隔离的 Minecraft 环境。选择某个实例时,它也会成为主页启动指挥中心使用的当前实例,因此实例库与启动状态不会指向不同环境。 + +## 查找实例 + +搜索框可匹配实例名称、Minecraft 版本、加载器或备注。可以按以下方式排序: + +- **最近游玩**:优先显示常用环境; +- **名称**:便于浏览大型、结构化实例库; +- **创建时间**:优先显示最近创建或导入的环境。 + +列表视图适合高密度实例库,网格视图让较小的实例库更易区分。DropOut 会在当前设备上记住所选展示方式。 + +## 查看启动状态 + +可见实例会被渐进检查,避免大型实例库一次发起数百个运行时探测。就绪标记与主页使用同一个后端检查,并综合已选 Minecraft 版本、本地游戏文件、兼容 Java、账户和内存覆盖。 + +右侧当前工作区会显示: + +- Minecraft 版本、加载器和启动就绪度; +- 本地文件与 Java 可用性; +- 内存与 Java 覆盖; +- 已启用和已禁用的模组数量; +- 备注、创建时间和托管游戏目录。 + +将 **启动当前实例** 作为主要操作。打开其他实例卡片会同步修改全局当前实例,包括主页。 + +## 管理与迁移环境 + +次要命令统一收进实例菜单,可打开游戏目录、编辑元数据和运行时覆盖、复制环境、管理模组、浏览内容、导出 ZIP 或删除实例。当前工作区也会重复最常用快捷操作,同时保留启动状态。 + +通过 **实例库操作** 可以导入 ZIP、从 Prism/MultiMC 或 PCL/HMCL 迁移实例,或根据磁盘目录修复实例索引。 + +## 安全删除 + +删除会移除托管的游戏目录,且无法从 DropOut 撤销。如果以后可能需要存档、模组、资源包或配置,请先导出实例。如果目标名称或恢复方案不正确,请取消确认对话框。 diff --git a/packages/docs/content/zh/manual/features/meta.json b/packages/docs/content/zh/manual/features/meta.json index 3bf3d240..b1993a18 100644 --- a/packages/docs/content/zh/manual/features/meta.json +++ b/packages/docs/content/zh/manual/features/meta.json @@ -1,4 +1,4 @@ { "title": "功能特性", - "pages": ["index", "authentication", "java", "mod-loaders"] + "pages": ["index", "instances", "authentication", "java", "mod-loaders"] } diff --git a/packages/ui/README.md b/packages/ui/README.md index 5d30a5b2..dc35e089 100644 --- a/packages/ui/README.md +++ b/packages/ui/README.md @@ -35,6 +35,13 @@ Available fixture states are: | `stopped` | Cleanly ended session with retained logs and relaunch action | | `failed` | Failed session with captured diagnostic output | | `error` | Instance-index failure and recovery feedback | +| `instances-empty` | Empty instance library onboarding | +| `instances-single` | One-instance library and active detail workspace | +| `instances-20` | Medium library for grid/list and visual review | +| `instances-grid` | Medium library with the grid presentation preselected | +| `instances-100` | Large library for search, sorting, and keyboard flows | +| `instances-loading` | Pending instance-index read | +| `instances-error` | Failed instance-index read with retry and repair actions | | `migration` | Detected Prism/MultiMC and PCL/HMCL import sources | Use `theme=dark` or `theme=light`, and `locale=en` or `locale=zh-CN`. Fixture activation is guarded by `import.meta.env.DEV`; production builds ignore fixture parameters and continue to call Tauri directly. diff --git a/packages/ui/src/components/instance-editor-modal.tsx b/packages/ui/src/components/instance-editor-modal.tsx index 47687d72..a0d74412 100644 --- a/packages/ui/src/components/instance-editor-modal.tsx +++ b/packages/ui/src/components/instance-editor-modal.tsx @@ -60,6 +60,7 @@ export function InstanceEditorModal({ open, instance, onOpenChange }: Props) { // Settings tab fields const [editMemoryMin, setEditMemoryMin] = useState(0); const [editMemoryMax, setEditMemoryMax] = useState(0); + const [editJavaPath, setEditJavaPath] = useState(""); const [editJavaArgs, setEditJavaArgs] = useState(""); const [editServerAddress, setEditServerAddress] = useState(""); const [editSkinPath, setEditSkinPath] = useState(""); @@ -82,6 +83,7 @@ export function InstanceEditorModal({ open, instance, onOpenChange }: Props) { config?.maxMemory ?? 2048, ); + setEditJavaPath(instance.javaPathOverride ?? ""); setEditJavaArgs(instance.jvmArgsOverride ?? ""); setEditServerAddress(instance.serverAddress ?? ""); setEditSkinPath(instance.skinPath ?? ""); @@ -181,6 +183,7 @@ export function InstanceEditorModal({ open, instance, onOpenChange }: Props) { min: editMemoryMin, max: editMemoryMax, }, + javaPathOverride: editJavaPath.trim() ? editJavaPath.trim() : null, jvmArgsOverride: editJavaArgs.trim() ? editJavaArgs.trim() : null, serverAddress: editServerAddress.trim() ? editServerAddress.trim() @@ -466,6 +469,45 @@ export function InstanceEditorModal({ open, instance, onOpenChange }: Props) { {activeTab === "settings" && (
+
+ +
+ setEditJavaPath(e.target.value)} + placeholder={t("editor.javaPathPlaceholder")} + disabled={saving} + className="flex-1" + /> + +
+

+ {t("editor.javaPathHint")} +

+
+