Skip to content
Closed
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.8.0",
"version": "0.8.1",
"description": "轻量桌宠,聚合主窗口可见会话的任务状态、需要回答的提醒和最新结果,支持外观切换及图集导入。",
"author": "MiniMax",
"icon": "icon.png",
Expand Down
2 changes: 2 additions & 0 deletions plugins/minimax-ai/minimax-pet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ A lightweight desktop companion for MiniMax Code, by **MiniMax**. It shows visib

The pet does not run Agent turns, create independent chats, write to chat inputs, comment on every session, stop tasks, or answer questionnaires. Selecting a task only reads its details; the main window switches only when you click **打开对话** or **去回答**.

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.

Version **0.7.0** renders each task's latest reply as Markdown: headings, emphasis, lists, task lists, fenced code, tables, quotes and links, with raw HTML shown as inert text and images as a label instead of a remote request. Notification cards and reminder previews stay plain text. Parsing uses a vendored bundle of unified, remark-parse and remark-gfm (MIT) built by `npm run build:markdown`; the page never builds an HTML string from model output. The bundle makes no network request and runs entirely in the page.
Expand Down
2 changes: 2 additions & 0 deletions plugins/minimax-ai/minimax-pet/README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

**0.5.11** 新增可选内置宠物 **MMX 章鱼娘**,是一位橙发、白背心、棕格纹短裙的 Q 版全身章鱼娘。在“外观 → 选择宠物”中选择她即可;薄荷色机器人仍为默认宠物。她采用 v1 图集,包含九种动作,不含十六个视线方向,因此鼠标跟随对她不生效;沿用六帧、6.6 秒一轮的慢速待机,不新增权限或改变播放器。图集已通过校验。创作流程和贡献者许可见[素材说明](ARTWORK.md)。

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

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

**0.7.0** 把任务最近回复按 Markdown 渲染:标题、强调、列表、任务清单、代码块、表格、引用和链接;回复里的原始 HTML 只作为文本显示,图片显示为文字标签而不发起网络请求。通知卡片和提醒预览仍为纯文本。解析使用 `npm run build:markdown` 打包的 unified + remark-parse + remark-gfm(MIT);页面不会把模型输出拼成 HTML 字符串。
Expand Down
13 changes: 10 additions & 3 deletions plugins/minimax-ai/minimax-pet/miniapp/client/compact-pet-view.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,17 @@ export function createCompactPetView({
const allTasks = button('全部任务', 'compact-link', () => api.open('allTasks'));
tasksFooter.append(allTasks); tasksPane.append(taskList, tasksFooter);

const detailPane = element('div', 'compact-detail compact-body');
const detailPane = element('div', 'compact-detail');
const detailHead = element('div', 'compact-detail-head');
const detailTitle = element('strong', 'compact-detail-title');
const detailStatus = element('span', 'compact-detail-status'); detailStatus.setAttribute('role', 'status');
detailHead.append(detailTitle, detailStatus);
// Only the reply scrolls; the title and the actions stay pinned so a long title or a
// long reply can never push the buttons out of the 280px card.
const detailBody = element('div', 'compact-detail-body');
const detailReply = element('div', 'compact-detail-reply md');
detailReply.setAttribute('aria-label', '任务最近回复'); detailReply.tabIndex = 0;
detailBody.append(detailReply);
const detailFooter = element('div', 'compact-footer');
const back = button('返回任务', 'compact-detail-back compact-link', () => api.open(detailBackView));
const openHint = element('p', 'compact-hint'); openHint.setAttribute('role', 'status'); openHint.hidden = true;
Expand All @@ -87,7 +93,8 @@ export function createCompactPetView({
setHint(textOf(result?.text) || (failed ? `没能打开对话(${failureCode(result)})。` : ''), textOf(result?.kind) || (failed ? 'error' : 'info'));
});
});
detailFooter.append(back, openSession); detailPane.append(detailTitle, detailStatus, detailReply, detailFooter, openHint);
detailFooter.append(back, openSession);
detailPane.append(detailHead, detailBody, detailFooter, openHint);
container.append(header, tasksPane, detailPane);

function paintTasks() {
Expand Down Expand Up @@ -152,7 +159,7 @@ export function createCompactPetView({
}
detailPane.setAttribute('aria-busy', String(available && !needsAnswer && taskSelection.detailLoading === true));
if (paintedDetailId !== id) {
detailReply.scrollTop = 0; detailPane.scrollTop = 0; paintedDetailId = id;
detailReply.scrollTop = 0; detailBody.scrollTop = 0; paintedDetailId = id;
openToken++; openSession.disabled = false; setHint('');
}
openSession.hidden = typeof onOpenSession !== 'function' || !available || !id;
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 @@ -157,7 +157,7 @@ <h2 id="connection-title">任务连接</h2>
<details class="panel-help">
<summary>版本与帮助</summary>
<div class="help-content">
<p class="muted">MiniMax Pet 0.8.0</p>
<p class="muted">MiniMax Pet 0.8.1</p>
<div class="row">
<span id="version-badge" class="badge" hidden></span>
<span id="source-badge" class="badge"></span>
Expand Down
6 changes: 4 additions & 2 deletions plugins/minimax-ai/minimax-pet/miniapp/client/pet-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,9 @@ let animationGate = null;
let workbenchView = null;
let workbenchWindow = null;
const reminders = createReminderStore();
const compactBubbleSize = { width: 300, height: 340 };
// Expanded card: the pet keeps its slot at the bottom and the card gets a readable
// reply body, instead of the ~110px left in the compact window.
const compactBubbleSize = { width: 300, height: 520 };
let notificationPreviews = null;
let askObserver = null;
let detailOpenToken = 0;
Expand Down Expand Up @@ -1912,7 +1914,7 @@ function renderReminders() {

function renderScale() {
root.style.setProperty('--minimax-pet-height', `${208 * prefs.scale}px`);
compactBubbleSize.height = Math.max(340, Math.ceil(208 * prefs.scale) + 232);
compactBubbleSize.height = Math.max(380, Math.ceil(208 * prefs.scale) + 332);
syncSegmented(els.scaleGroup, prefs.scale);
}

Expand Down
21 changes: 15 additions & 6 deletions plugins/minimax-ai/minimax-pet/miniapp/client/pet.css
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,9 @@ html.mode-window body {
justify-content: flex-end;
gap: 4px;
padding: 8px 8px 4px;
overflow: hidden;
/* The window is transparent and frameless: the card may overflow it upward so a
long reply keeps a readable body instead of a single line. */
overflow: visible;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不挡合并:html.mode-window body 仍是 overflow: hidden,而且窗口外的内容本来也画不出来,所以卡片实际不能向上溢出,这行注释跟实际不符。如果展开失败、窗口还是 340 高,卡片顶部仍会被裁掉,但这个问题以前就有。建议删掉这行改动或者改一下注释,sources/ 里那份也一样。

}

.desk-overlays {
Expand Down Expand Up @@ -821,8 +823,9 @@ html.mode-window .pet-sprite:focus-visible {
z-index: 5;
left: 8px;
right: 8px;
bottom: calc(var(--minimax-pet-height, 104px) + 12px);
max-height: 216px;
bottom: calc(var(--minimax-pet-height, 104px) + 8px);
/* Use the space the expanded window provides, up to what the desk leaves above the pet. */
max-height: max(216px, calc(100% - var(--minimax-pet-height, 104px) - 24px));
display: flex;
flex-direction: column;
border: 1px solid var(--mcode-border);
Expand All @@ -844,6 +847,12 @@ html.mode-window .pet-sprite:focus-visible {
.compact-button:disabled { opacity: .4; cursor: default; }
.compact-close { color: var(--mcode-text-muted); margin-left: auto; font-size: 17px; padding: 0 5px; min-width: 32px; min-height: 32px; }
.compact-body { min-height: 0; overflow: auto; padding: 2px 10px 8px; }
/* The detail pane owns the height: head and footer are fixed, the reply is the only scroller. */
.compact-detail { display: flex; flex-direction: column; gap: 4px; min-height: 0; padding: 2px 10px 8px; overflow: hidden; }
.compact-detail-head { display: flex; align-items: baseline; gap: 6px; flex: none; min-width: 0; }
.compact-detail-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.compact-detail .compact-footer { flex: none; margin-top: 0; padding-top: 4px; border-top: 1px solid var(--mcode-border); }
.compact-detail .compact-hint { flex: none; }
.compact-hint { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; color: var(--mcode-text-muted); margin: 4px 0; font-size: 12px; line-height: 16px; }
.compact-hint[data-kind='error'] { color: var(--mcode-danger); }
.compact-footer { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; }
Expand All @@ -860,9 +869,9 @@ html.mode-window .pet-sprite:focus-visible {
.pet-notice-open { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--mcode-text); text-align: left; font: inherit; font-size: 12px; line-height: 16px; padding: 0; cursor: pointer; }
.pet-notice-open strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pet-notice-preview { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; overflow: hidden; color: var(--mcode-text-muted); overflow-wrap: anywhere; }
.compact-detail-title { margin: 0; font-size: 13px; line-height: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-detail-status { margin: 2px 0 2px 6px; font-size: 12px; line-height: 16px; color: var(--mcode-text-muted); }
.compact-detail-reply { margin: 5px 0; max-height: 126px; overflow: auto; overscroll-behavior: contain; overflow-wrap: anywhere; user-select: text; -webkit-user-select: text; }
.compact-detail-title { flex: 1; min-width: 0; margin: 0; font-size: 13px; line-height: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-detail-status { flex: none; font-size: 12px; line-height: 16px; color: var(--mcode-text-muted); }
.compact-detail-reply { margin: 0; overflow-wrap: anywhere; user-select: text; -webkit-user-select: text; }
/* The desktop card is 280px wide; keep the same structure at a tighter scale. */
.compact-detail-reply.md { font-size: 12px; line-height: 17px; text-align: left; }
.compact-detail-reply.md .md-p,
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.8.0",
"version": "0.8.1",
"description": "轻量桌宠,聚合主窗口可见会话的任务状态、需要回答的提醒和最新结果,支持外观切换及图集导入。",
"author": "MiniMax",
"icon": "icon.png",
Expand Down
2 changes: 2 additions & 0 deletions sources/minimax-ai/minimax-pet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ A lightweight desktop companion for MiniMax Code, by **MiniMax**. It shows visib

The pet does not run Agent turns, create independent chats, write to chat inputs, comment on every session, stop tasks, or answer questionnaires. Selecting a task only reads its details; the main window switches only when you click **打开对话** or **去回答**.

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.

Version **0.7.0** renders each task's latest reply as Markdown: headings, emphasis, lists, task lists, fenced code, tables, quotes and links, with raw HTML shown as inert text and images as a label instead of a remote request. Notification cards and reminder previews stay plain text. Parsing uses a vendored bundle of unified, remark-parse and remark-gfm (MIT) built by `npm run build:markdown`; the page never builds an HTML string from model output. The bundle makes no network request and runs entirely in the page.
Expand Down
2 changes: 2 additions & 0 deletions sources/minimax-ai/minimax-pet/README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

**0.5.11** 新增可选内置宠物 **MMX 章鱼娘**,是一位橙发、白背心、棕格纹短裙的 Q 版全身章鱼娘。在“外观 → 选择宠物”中选择她即可;薄荷色机器人仍为默认宠物。她采用 v1 图集,包含九种动作,不含十六个视线方向,因此鼠标跟随对她不生效;沿用六帧、6.6 秒一轮的慢速待机,不新增权限或改变播放器。图集已通过校验。创作流程和贡献者许可见[素材说明](ARTWORK.md)。

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

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

**0.7.0** 把任务最近回复按 Markdown 渲染:标题、强调、列表、任务清单、代码块、表格、引用和链接;回复里的原始 HTML 只作为文本显示,图片显示为文字标签而不发起网络请求。通知卡片和提醒预览仍为纯文本。解析使用 `npm run build:markdown` 打包的 unified + remark-parse + remark-gfm(MIT);页面不会把模型输出拼成 HTML 字符串。
Expand Down
22 changes: 22 additions & 0 deletions sources/minimax-ai/minimax-pet/dev/compact-pet-view.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -314,3 +314,25 @@ domTest('a markdown reply renders as structure in the detail, previews stay flat
h.update({ taskSelection: selection(1, reply) });
assert.equal(node.querySelector('.md-heading').textContent, '结论');
});

domTest('a long title truncates on one line and a long reply cannot push the footer out', (t) => {
const h = harness(t);
const longTitle = '确认 mcode-data-analytics 数据获取状态并核对安全边界与聚合口径的最终结论';
const longReply = Array.from({ length: 40 }, (_, n) => `第 ${n + 1} 行很长的回复正文,用来把卡片撑满`).join('\n\n');
h.update({ taskSelection: { availability: 'ready', selectedSessionId: 'task-1', session: { sessionId: 'task-1', title: longTitle, status: 'idle' },
detail: { sessionId: 'task-1', title: longTitle, status: 'idle', lastAssistantText: longReply } } });
h.view.open('detail');
const title = h.container.querySelector('.compact-detail-title');
const head = h.container.querySelector('.compact-detail-head');
const body = h.container.querySelector('.compact-detail-body');
const reply = h.container.querySelector('.compact-detail-reply');
const footer = h.container.querySelector('.compact-detail .compact-footer');
assert.equal(title.textContent, longTitle);
assert.equal(head.contains(title) && head.contains(h.container.querySelector('.compact-detail-status')), true);
// The title and the footer sit outside the scrolling body, and only the body scrolls.
assert.equal(head.parentNode, h.container.querySelector('.compact-detail'));
assert.equal(body.contains(reply), true);
assert.equal(body.contains(footer), false);
assert.equal(footer.parentNode, h.container.querySelector('.compact-detail'));
assert.equal(reply.textContent.includes('第 40 行'), true);
});
13 changes: 10 additions & 3 deletions sources/minimax-ai/minimax-pet/miniapp/client/compact-pet-view.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,17 @@ export function createCompactPetView({
const allTasks = button('全部任务', 'compact-link', () => api.open('allTasks'));
tasksFooter.append(allTasks); tasksPane.append(taskList, tasksFooter);

const detailPane = element('div', 'compact-detail compact-body');
const detailPane = element('div', 'compact-detail');
const detailHead = element('div', 'compact-detail-head');
const detailTitle = element('strong', 'compact-detail-title');
const detailStatus = element('span', 'compact-detail-status'); detailStatus.setAttribute('role', 'status');
detailHead.append(detailTitle, detailStatus);
// Only the reply scrolls; the title and the actions stay pinned so a long title or a
// long reply can never push the buttons out of the 280px card.
const detailBody = element('div', 'compact-detail-body');
const detailReply = element('div', 'compact-detail-reply md');
detailReply.setAttribute('aria-label', '任务最近回复'); detailReply.tabIndex = 0;
detailBody.append(detailReply);
const detailFooter = element('div', 'compact-footer');
const back = button('返回任务', 'compact-detail-back compact-link', () => api.open(detailBackView));
const openHint = element('p', 'compact-hint'); openHint.setAttribute('role', 'status'); openHint.hidden = true;
Expand All @@ -87,7 +93,8 @@ export function createCompactPetView({
setHint(textOf(result?.text) || (failed ? `没能打开对话(${failureCode(result)})。` : ''), textOf(result?.kind) || (failed ? 'error' : 'info'));
});
});
detailFooter.append(back, openSession); detailPane.append(detailTitle, detailStatus, detailReply, detailFooter, openHint);
detailFooter.append(back, openSession);
detailPane.append(detailHead, detailBody, detailFooter, openHint);
container.append(header, tasksPane, detailPane);

function paintTasks() {
Expand Down Expand Up @@ -152,7 +159,7 @@ export function createCompactPetView({
}
detailPane.setAttribute('aria-busy', String(available && !needsAnswer && taskSelection.detailLoading === true));
if (paintedDetailId !== id) {
detailReply.scrollTop = 0; detailPane.scrollTop = 0; paintedDetailId = id;
detailReply.scrollTop = 0; detailBody.scrollTop = 0; paintedDetailId = id;
openToken++; openSession.disabled = false; setHint('');
}
openSession.hidden = typeof onOpenSession !== 'function' || !available || !id;
Expand Down
2 changes: 1 addition & 1 deletion sources/minimax-ai/minimax-pet/miniapp/client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ <h2 id="connection-title">任务连接</h2>
<details class="panel-help">
<summary>版本与帮助</summary>
<div class="help-content">
<p class="muted">MiniMax Pet 0.8.0</p>
<p class="muted">MiniMax Pet 0.8.1</p>
<div class="row">
<span id="version-badge" class="badge" hidden></span>
<span id="source-badge" class="badge"></span>
Expand Down
6 changes: 4 additions & 2 deletions sources/minimax-ai/minimax-pet/miniapp/client/pet-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,9 @@ let animationGate = null;
let workbenchView = null;
let workbenchWindow = null;
const reminders = createReminderStore();
const compactBubbleSize = { width: 300, height: 340 };
// Expanded card: the pet keeps its slot at the bottom and the card gets a readable
// reply body, instead of the ~110px left in the compact window.
const compactBubbleSize = { width: 300, height: 520 };
let notificationPreviews = null;
let askObserver = null;
let detailOpenToken = 0;
Expand Down Expand Up @@ -1912,7 +1914,7 @@ function renderReminders() {

function renderScale() {
root.style.setProperty('--minimax-pet-height', `${208 * prefs.scale}px`);
compactBubbleSize.height = Math.max(340, Math.ceil(208 * prefs.scale) + 232);
compactBubbleSize.height = Math.max(380, Math.ceil(208 * prefs.scale) + 332);
syncSegmented(els.scaleGroup, prefs.scale);
}

Expand Down
Loading
Loading