Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/minimax-ai/minimax-pet/.minimax-plugin/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"schemaVersion": 1,
"name": "minimax-pet",
"displayName": "MiniMax Pet",
"version": "0.9.3",
"version": "0.9.4",
"description": "轻量桌宠,聚合主窗口可见会话的任务状态、需要回答的提醒和最新结果,支持外观切换及图集导入。",
"author": "MiniMax",
"icon": "icon.png",
Expand Down
3 changes: 3 additions & 0 deletions plugins/minimax-ai/minimax-pet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ Version **0.9.2** keeps the desktop window at its intended size while dragging b

Version **0.9.3** moves the desktop pet using the Host-confirmed window position and the pointer's offset from the grab point. The page waits for each move to finish before using another pointer sample. If you release while a move is pending, the window stays at the last position accepted by the Host.

Version **0.9.4** keeps the pet reachable when you choose **放到桌面**. It tries the saved position, then fits the window to the usable area of the screen it actually lands on. A valid position on another display stays put; when the window is taller than the available area, the pet stays at the bottom rather than being hidden below the screen.

Version **0.8.1** fixes the desktop card: the title truncates to one line, only the reply scrolls, and the actions stay pinned, so a long title or reply no longer pushes 返回任务 / 打开对话 out of the card. Expanding the card also grows the window instead of squeezing the reply into one line.

Version **0.8.0** aligns the panel with the MiniMax Code design language: 24px page margins and section gaps, 14px/22px body copy with 12px/18px supporting text, 32px minimum control height, 12px cards and 8px controls, 0.5px borders on desktop overlays, and press/focus states. The desktop pet keeps its 280px layout with the same tokens.
Expand Down Expand Up @@ -53,6 +55,7 @@ Earlier local prototypes use a different plugin ID. The Host gives `minimax-pet`
- Version 0.9.0 has Node/DOM tests for the card timer, the preference round trip and the copy of both languages (every key the page uses must exist in both), plus a browser check of the panel and desktop window in both languages against a simulated Host. Not verified for 0.9.0: the language the real client reports on any given install, and both languages inside a real MiniMax Code window.
- Version 0.9.2 was checked in MiniMax Code **3.1.19.232** on Windows 11 x64 (build 26200, 150% display scaling). With the task card open, four automated pointer drags moved the real window without cumulative width or height growth. A physical mouse and other display configurations were not tested for this fix.
- The drag behavior was exercised with a physical mouse in a local comparison build on MiniMax Inside Code **3.1.19.169**, Windows 11 (build 26300), and a 4K display. Version 0.9.3 has regression tests for input before and after the Host applies a pending move. Desktop testing of the final 0.9.3 package remains open.
- A pre-rebase build of the pop-out fix was checked in MiniMax Code **3.1.19.232** on Windows 11 x64 (build 26200, 150% display scaling). The old saved position clipped the pet at the top of the screen; the patched app brought it fully inside the work area and saved the corrected position. Secondary and disconnected displays were exercised in automated tests, not on physical displays.
- Not verified for 0.6.0: opening a conversation or following the theme inside a real MiniMax Code 3.1.11+ window (panel or desktop pet), any Windows GUI, and released-client installation or GUI acceptance on 3.1.6. Automated tests use synthetic data and do not prove those paths.

## Data & access
Expand Down
4 changes: 4 additions & 0 deletions plugins/minimax-ai/minimax-pet/README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

**0.9.3** 根据宿主确认的窗口位置和指针相对抓取点的偏移移动桌宠。每次移动结束后,才使用新的指针事件。如果在宿主应答前松手,窗口停在宿主最后接受的位置。

**0.9.4** 修复点击“放到桌面”后宠物可能落到屏幕外的问题。先尝试恢复上次的位置,再按窗口实际落在哪块屏幕校正;副屏上的合法位置不会被移回主屏。如果窗口比可用区域更高,优先让窗口底部的宠物留在屏幕上。

**0.8.1** 修复桌面卡片:标题单行截断,只有回复区滚动,底部操作固定在卡片内;长标题或长回复不再把「返回任务 / 打开对话」顶出卡片。展开卡片时窗口同步变高,回复不会被压成一行。

**0.8.0** 按 MiniMax Code 的设计语言对齐面板:24px 页边距与区块间距、14px/22px 正文与 12px/18px 辅助文字、控件最小高度 32px、卡片 12px 与控件 8px 圆角、桌面浮层 0.5px 描边,并补齐按下与焦点状态。桌面宠物保持 280px 布局,沿用同一套 token。
Expand All @@ -48,6 +50,8 @@

本地对照构建已在 Windows 11(构建 26300)、4K 显示器和 MiniMax Inside Code **3.1.19.169** 下用物理鼠标测试。0.9.3 的回归测试覆盖宿主应用窗口移动前后到达的指针事件。0.9.3 正式打包版本仍待桌面验收。

弹出修复在本次 rebase 前已用 Windows 11 x64(构建 26200,屏幕缩放 150%)和 MiniMax Code **3.1.19.232** 测试。旧保存位置会让宠物在屏幕上沿被裁切,修复版把宠物完整移进工作区并保存校正位置。副屏及屏幕断开场景只做了自动化测试,未连接实际副屏测试。

## 数据与能力边界

只申请 `session.read`,读取 Host 对本插件可见的用户会话状态和所选会话最新回复,不直接读取 Host 数据库、日志、配置或凭据。状态和提醒只在页面内存中,关闭或静音不修改 Host 的任务或未读事实。
Expand Down
2 changes: 1 addition & 1 deletion plugins/minimax-ai/minimax-pet/miniapp/client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ <h2 id="connection-title" data-i18n="settings.connection">任务连接</h2>
<details class="panel-help">
<summary data-i18n="settings.help">版本与帮助</summary>
<div class="help-content">
<p class="muted">MiniMax Pet 0.9.3</p>
<p class="muted">MiniMax Pet 0.9.4</p>
<div class="row">
<span id="version-badge" class="badge" hidden></span>
<span id="source-badge" class="badge"></span>
Expand Down
24 changes: 19 additions & 5 deletions plugins/minimax-ai/minimax-pet/miniapp/client/pet-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -590,11 +590,25 @@ function onWindowState(state) {
void restoreWindowPosition(win, saved, { isCurrent }).then(async (result) => {
if (disposed || token !== app.positionRestoreToken || app.mode !== 'window') return;
let restoredState = result.state;
const height = deskHeight(prefs.scale);
if (result.interactive && restoredState?.window && (restoredState.window.width !== DESK_WIDTH || restoredState.window.height !== height)) {
try { restoredState = await win.update({ width: DESK_WIDTH, height }); }
catch (error) { if (!isCurrent()) return; result.error = errCode(error); }
const size = { width: DESK_WIDTH, height: deskHeight(prefs.scale) };
if (result.interactive && restoredState?.window) {
// Restore first: the saved position may be on a different display. Check the work
// area only after the Host settles there, including when the saved move was refused.
const fitted = await fitWindowToScreen(win, {
isCurrent, size, keepPetVisible: true,
screenRect: () => ({ x: screen.availLeft, y: screen.availTop, width: screen.availWidth, height: screen.availHeight }),
});
if (!isCurrent()) return;
if (fitted.cancelled) { applyMode('inline'); return; }
if (fitted.state) restoredState = fitted.state;
if (fitted.error) result.error = fitted.error;
else if (result.error === 'not_permitted') result.error = null;
// Older clients can lack usable work-area data. Preserve their existing size repair.
if (fitted.error === 'screen_unavailable' && (restoredState.window.width !== size.width || restoredState.window.height !== size.height)) {
try { restoredState = await win.update(size); }
catch (error) { if (!isCurrent()) return; result.error = errCode(error); }
if (!isCurrent()) return;
}
}
if (restoredState) onWindowState(restoredState);
if (!isCurrent()) return;
Expand All @@ -603,7 +617,7 @@ function onWindowState(state) {
if (result.error) showTransient(result.interactive
? t('mode.positionFailed', { code: result.error })
: t('mode.interactionUnknown', { code: result.error }), 'error');
rememberPosition();
else rememberPosition();
});
return;
}
Expand Down
21 changes: 14 additions & 7 deletions plugins/minimax-ai/minimax-pet/miniapp/client/window-position.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export async function restoreWindowPosition(handle, position, { isCurrent = () =
}
}

/** Fit the complete transparent content area, not only the Host's minimum overlap. */
export async function fitWindowToScreen(handle, { screenRect, isCurrent = () => true } = {}) {
/** Fit the complete transparent content area; on pop-out keep the bottom-centered pet visible even when it cannot all fit. */
export async function fitWindowToScreen(handle, { screenRect, isCurrent = () => true, size, keepPetVisible = false } = {}) {
const cancelled = () => ({ cancelled: true, error: null, state: null });
if (!isCurrent()) return cancelled();
try {
Expand All @@ -34,11 +34,18 @@ export async function fitWindowToScreen(handle, { screenRect, isCurrent = () =>
|| bounds.width <= 0 || bounds.height <= 0) return { error: 'invalid_state' };
if (!rect || ![rect.x, rect.y, rect.width, rect.height].every(finite)
|| rect.width <= 0 || rect.height <= 0) return { error: 'screen_unavailable' };
if (bounds.width > rect.width || bounds.height > rect.height) return { error: 'screen_too_small' };
const x = Math.ceil(Math.max(rect.x, Math.min(bounds.x, rect.x + rect.width - bounds.width)));
const y = Math.ceil(Math.max(rect.y, Math.min(bounds.y, rect.y + rect.height - bounds.height)));
if (x === bounds.x && y === bounds.y) return { state, error: null };
const updated = await handle.update({ x, y });
const { width, height } = size ?? bounds;
const spareX = rect.width - width;
const spareY = rect.height - height;
if (!keepPetVisible && (spareX < 0 || spareY < 0)) return { error: 'screen_too_small' };
// The sprite is centered at the bottom of the window. On small work areas, keep that
// edge on-screen instead of clamping the top and pushing the sprite below the display.
const x = spareX < 0 ? Math.round(rect.x + spareX / 2) : Math.ceil(Math.max(rect.x, Math.min(bounds.x, rect.x + spareX)));
const y = spareY < 0 ? Math.floor(rect.y + spareY) : Math.ceil(Math.max(rect.y, Math.min(bounds.y, rect.y + spareY)));
if (x === bounds.x && y === bounds.y && width === bounds.width && height === bounds.height) return { state, error: null };
// Pop-out has a known design size. Include it with the move instead of relying on
// a position-only update to preserve the pre-correction dimensions.
const updated = await handle.update(size ? { x, y, width, height } : { x, y });
if (!isCurrent() || updated?.mode !== 'window') return cancelled();
return { state: updated, error: null };
} catch (error) {
Expand Down
2 changes: 1 addition & 1 deletion sources/minimax-ai/minimax-pet/.minimax-plugin/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"schemaVersion": 1,
"name": "minimax-pet",
"displayName": "MiniMax Pet",
"version": "0.9.3",
"version": "0.9.4",
"description": "轻量桌宠,聚合主窗口可见会话的任务状态、需要回答的提醒和最新结果,支持外观切换及图集导入。",
"author": "MiniMax",
"icon": "icon.png",
Expand Down
3 changes: 3 additions & 0 deletions sources/minimax-ai/minimax-pet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ Version **0.9.2** keeps the desktop window at its intended size while dragging b

Version **0.9.3** moves the desktop pet using the Host-confirmed window position and the pointer's offset from the grab point. The page waits for each move to finish before using another pointer sample. If you release while a move is pending, the window stays at the last position accepted by the Host.

Version **0.9.4** keeps the pet reachable when you choose **放到桌面**. It tries the saved position, then fits the window to the usable area of the screen it actually lands on. A valid position on another display stays put; when the window is taller than the available area, the pet stays at the bottom rather than being hidden below the screen.

Version **0.8.1** fixes the desktop card: the title truncates to one line, only the reply scrolls, and the actions stay pinned, so a long title or reply no longer pushes 返回任务 / 打开对话 out of the card. Expanding the card also grows the window instead of squeezing the reply into one line.

Version **0.8.0** aligns the panel with the MiniMax Code design language: 24px page margins and section gaps, 14px/22px body copy with 12px/18px supporting text, 32px minimum control height, 12px cards and 8px controls, 0.5px borders on desktop overlays, and press/focus states. The desktop pet keeps its 280px layout with the same tokens.
Expand Down Expand Up @@ -53,6 +55,7 @@ Earlier local prototypes use a different plugin ID. The Host gives `minimax-pet`
- Version 0.9.0 has Node/DOM tests for the card timer, the preference round trip and the copy of both languages (every key the page uses must exist in both), plus a browser check of the panel and desktop window in both languages against a simulated Host. Not verified for 0.9.0: the language the real client reports on any given install, and both languages inside a real MiniMax Code window.
- Version 0.9.2 was checked in MiniMax Code **3.1.19.232** on Windows 11 x64 (build 26200, 150% display scaling). With the task card open, four automated pointer drags moved the real window without cumulative width or height growth. A physical mouse and other display configurations were not tested for this fix.
- The drag behavior was exercised with a physical mouse in a local comparison build on MiniMax Inside Code **3.1.19.169**, Windows 11 (build 26300), and a 4K display. Version 0.9.3 has regression tests for input before and after the Host applies a pending move. Desktop testing of the final 0.9.3 package remains open.
- A pre-rebase build of the pop-out fix was checked in MiniMax Code **3.1.19.232** on Windows 11 x64 (build 26200, 150% display scaling). The old saved position clipped the pet at the top of the screen; the patched app brought it fully inside the work area and saved the corrected position. Secondary and disconnected displays were exercised in automated tests, not on physical displays.
- Not verified for 0.6.0: opening a conversation or following the theme inside a real MiniMax Code 3.1.11+ window (panel or desktop pet), any Windows GUI, and released-client installation or GUI acceptance on 3.1.6. Automated tests use synthetic data and do not prove those paths.

## Data & access
Expand Down
4 changes: 4 additions & 0 deletions sources/minimax-ai/minimax-pet/README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

**0.9.3** 根据宿主确认的窗口位置和指针相对抓取点的偏移移动桌宠。每次移动结束后,才使用新的指针事件。如果在宿主应答前松手,窗口停在宿主最后接受的位置。

**0.9.4** 修复点击“放到桌面”后宠物可能落到屏幕外的问题。先尝试恢复上次的位置,再按窗口实际落在哪块屏幕校正;副屏上的合法位置不会被移回主屏。如果窗口比可用区域更高,优先让窗口底部的宠物留在屏幕上。

**0.8.1** 修复桌面卡片:标题单行截断,只有回复区滚动,底部操作固定在卡片内;长标题或长回复不再把「返回任务 / 打开对话」顶出卡片。展开卡片时窗口同步变高,回复不会被压成一行。

**0.8.0** 按 MiniMax Code 的设计语言对齐面板:24px 页边距与区块间距、14px/22px 正文与 12px/18px 辅助文字、控件最小高度 32px、卡片 12px 与控件 8px 圆角、桌面浮层 0.5px 描边,并补齐按下与焦点状态。桌面宠物保持 280px 布局,沿用同一套 token。
Expand All @@ -48,6 +50,8 @@

本地对照构建已在 Windows 11(构建 26300)、4K 显示器和 MiniMax Inside Code **3.1.19.169** 下用物理鼠标测试。0.9.3 的回归测试覆盖宿主应用窗口移动前后到达的指针事件。0.9.3 正式打包版本仍待桌面验收。

弹出修复在本次 rebase 前已用 Windows 11 x64(构建 26200,屏幕缩放 150%)和 MiniMax Code **3.1.19.232** 测试。旧保存位置会让宠物在屏幕上沿被裁切,修复版把宠物完整移进工作区并保存校正位置。副屏及屏幕断开场景只做了自动化测试,未连接实际副屏测试。

## 数据与能力边界

只申请 `session.read`,读取 Host 对本插件可见的用户会话状态和所选会话最新回复,不直接读取 Host 数据库、日志、配置或凭据。状态和提醒只在页面内存中,关闭或静音不修改 Host 的任务或未读事实。
Expand Down
Loading