Files
apes-sidebar/src/client/FloatingWindow.module.css
T
Menghuan1918 84b68e9216 feat(tasks): 任务窗内容填满高度可自然拉伸;聚合卡在成员多时报出 +N
用户两条优化:
  1. 任务详细占满上下部分,不要留空(这样能自然拉伸)
  2. 思考如何优化内容很多时的待命和完成的样式

第 1 条:描述区原本是 `max-height: 160px` 的滚动盒,窗口拉大只长空白。
FloatingWindow 新增 `bodyLayout: 'scroll' | 'fill'`(默认 scroll 不变,后台
任务输出窗仍按原样流动),fill 把 body 变成列容器、让调用方的子节点自己决定
谁吃余量;任务窗据此把余量全给描述区(编辑态给多行输入框,`flex: 1` 跟着窗
口长),头部行 / 元信息 / 负责人 / 提示行都 `flex: none`,不会跟着漂。

第 2 条:一队队友很多时,聚合卡只有一行名字却塞了十几个人,卡上看不出还有
多少。名称行现在写「前两个名字 + N」—— 用的是团队任务行已有的同一个 `+N`
约定,不是第二套;分组总数另有徽标和小条两处,所以 `+N` 只是尾巴而不是唯一
计数。图卡片与树行共用同一个 foldPreviews。

测试:新增 2 例(窗口声明 fill 布局、描述区在 body 内且编辑态换成多行框;
五个待命成员的聚合卡名称是 `m1 / m2 +3`);floating-window 既有 9 例回归通过。
pnpm test 1288 passed / 9 skipped,typecheck / lint 通过。

(cherry picked from commit 62651e731d6e5fd0378e2ecc504792cb2e3eb461)
2026-09-27 22:19:05 +08:00

143 lines
3.4 KiB
CSS

/**
* Chrome of the plugin's persistent floating window (FloatingWindow.tsx):
* a fixed, portaled card with a drag handle title bar, a scrolling body, an
* optional footer and three resize strips.
*
* Tokens only (`--dsw-alias-*` / `--dsw-font-*`): the frame wears the same
* 1px `border-l2` edge and 8px radius as the Tasks page's node cards, and the
* floating layer keeps the app's `--dsw-shadow-lv3` (the one shadow tier the
* plugin is allowed on a floating surface).
*/
.window {
position: fixed;
z-index: 90;
display: flex;
flex-direction: column;
min-width: 0;
min-height: 0;
background: var(--dsw-alias-bg-layer-1);
border: 1px solid var(--dsw-alias-border-l2);
border-radius: 8px;
box-shadow: var(--dsw-shadow-lv3);
overflow: hidden;
font: var(--dsw-font-xxs-12);
color: var(--dsw-alias-label-primary);
box-sizing: border-box;
}
/* The drag handle. It is exactly one control tall, so the close button and the
title sit on one optical line whatever the header's actions are. */
.titleBar {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
flex: none;
min-height: 34px;
padding: 0 6px 0 12px;
border-bottom: 1px solid var(--dsw-alias-border-l1);
background: var(--dsw-alias-bg-layer-2);
cursor: grab;
user-select: none;
}
.titleBar:active {
cursor: grabbing;
}
.title {
min-width: 0;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
font-family: var(--ds-font-family-code, monospace);
font-size: 11px;
color: var(--dsw-alias-label-secondary);
}
.titleActions {
display: inline-flex;
align-items: center;
gap: 2px;
flex: none;
}
.close {
flex: none;
}
/* The body IS the height bound: whatever the caller renders (a long terminal
log, a table) scrolls here instead of growing the window past the viewport.
`min-height: 0` is what lets a flex child actually shrink and scroll. */
.body {
flex: 1;
min-height: 0;
overflow: auto;
overscroll-behavior: contain;
padding: 10px 12px 12px;
}
/* A body whose content should FILL the window instead of stacking from the top
(a form with one editable region, a detail view with prose): the caller's
children become a column and decide for themselves what takes the slack, so
dragging the window bigger grows the content rather than the empty space. */
.bodyFill {
display: flex;
flex-direction: column;
}
.bodyFill > * {
flex: 1;
min-height: 0;
}
.footer {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
flex: none;
padding: 8px 12px;
border-top: 1px solid var(--dsw-alias-border-l1);
background: var(--dsw-alias-bg-base);
}
/* Resize strips sit on top of the body's own scrollbar area; each one owns
only its axis (the cursor says which). */
.handle {
position: absolute;
touch-action: none;
}
.handleRight {
top: 34px;
right: 0;
bottom: 0;
width: 6px;
cursor: ew-resize;
}
.handleBottom {
left: 0;
right: 0;
bottom: 0;
height: 6px;
cursor: ns-resize;
}
/* The corner wins over both edges (it is declared last and larger). */
.handleCorner {
right: 0;
bottom: 0;
width: 16px;
height: 16px;
cursor: nwse-resize;
background: linear-gradient(
135deg,
transparent 0%,
transparent 55%,
color-mix(in srgb, var(--dsw-alias-label-tertiary) 45%, transparent) 55%,
color-mix(in srgb, var(--dsw-alias-label-tertiary) 45%, transparent) 100%
);
}