dsh-project-recall 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/README.md +22 -9
- package/client.js +1093 -428
- package/package.json +4 -5
package/client.js
CHANGED
|
@@ -6,6 +6,7 @@ window.__ModuleLoader__.load({
|
|
|
6
6
|
const { useCallback, useEffect, useMemo, useRef, useState } = React;
|
|
7
7
|
|
|
8
8
|
const API = '/project-memory/api';
|
|
9
|
+
const DAY = 86_400_000;
|
|
9
10
|
|
|
10
11
|
async function api(path, options = {}) {
|
|
11
12
|
const response = await fetch(API + path, {
|
|
@@ -18,17 +19,35 @@ window.__ModuleLoader__.load({
|
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
const STATUS_LABELS = {
|
|
21
|
-
candidate: '
|
|
22
|
-
idea: '
|
|
23
|
-
someday: '
|
|
24
|
-
planned: '
|
|
25
|
-
blocked: '
|
|
26
|
-
done: '
|
|
27
|
-
dropped: '
|
|
22
|
+
candidate: '先记着',
|
|
23
|
+
idea: '先记着',
|
|
24
|
+
someday: '先记着',
|
|
25
|
+
planned: '排上了',
|
|
26
|
+
blocked: '在等条件',
|
|
27
|
+
done: '做完了',
|
|
28
|
+
dropped: '不做了',
|
|
28
29
|
};
|
|
29
|
-
const PRIORITY_LABELS = { low: '
|
|
30
|
-
const EFFORT_LABELS = { small: '
|
|
31
|
-
const
|
|
30
|
+
const PRIORITY_LABELS = { low: '不急', medium: '一般', high: '重要' };
|
|
31
|
+
const EFFORT_LABELS = { small: '半小时', medium: '半天', large: '大半天以上', unknown: '没估' };
|
|
32
|
+
const STATUS_CHOICES = [
|
|
33
|
+
{ value: 'someday', label: '先记着' },
|
|
34
|
+
{ value: 'planned', label: '排上了' },
|
|
35
|
+
{ value: 'blocked', label: '在等条件' },
|
|
36
|
+
{ value: 'done', label: '做完了' },
|
|
37
|
+
{ value: 'dropped', label: '不做了' },
|
|
38
|
+
];
|
|
39
|
+
const QUICK_DATES = [
|
|
40
|
+
['今天', 0],
|
|
41
|
+
['三天后', 3],
|
|
42
|
+
['一周后', 7],
|
|
43
|
+
['一个月后', 30],
|
|
44
|
+
];
|
|
45
|
+
const VIEWS = [
|
|
46
|
+
{ id: 'now', label: '轮到你', hint: '到期了,或者放太久了。先看最上面这件。' },
|
|
47
|
+
{ id: 'waiting', label: '在等条件', hint: '卡在别处的事。条件到了就点一下。' },
|
|
48
|
+
{ id: 'later', label: '找时间做', hint: '先记着的。想做的时候,排进这周。' },
|
|
49
|
+
{ id: 'closed', label: '已结束', hint: '做完是成绩,不做了也是决定。' },
|
|
50
|
+
];
|
|
32
51
|
|
|
33
52
|
function fmtDate(value, withTime = false) {
|
|
34
53
|
if (!value) return '未安排';
|
|
@@ -41,16 +60,6 @@ window.__ModuleLoader__.load({
|
|
|
41
60
|
}).format(date);
|
|
42
61
|
}
|
|
43
62
|
|
|
44
|
-
function reviewLabel(plan) {
|
|
45
|
-
if (!plan.review_at) return plan.is_stale ? '太久没看' : '未安排';
|
|
46
|
-
if (plan.is_due) return '已到期';
|
|
47
|
-
const days = plan.review_in_days;
|
|
48
|
-
if (days === 0) return '今天';
|
|
49
|
-
if (days === 1) return '明天';
|
|
50
|
-
if (days > 1) return `${days} 天后`;
|
|
51
|
-
return fmtDate(plan.review_at);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
63
|
function toLocalInput(value) {
|
|
55
64
|
if (!value) return '';
|
|
56
65
|
const date = new Date(value);
|
|
@@ -80,6 +89,72 @@ window.__ModuleLoader__.load({
|
|
|
80
89
|
.filter(Boolean);
|
|
81
90
|
}
|
|
82
91
|
|
|
92
|
+
function daysSince(value) {
|
|
93
|
+
if (!value) return null;
|
|
94
|
+
const time = new Date(value).getTime();
|
|
95
|
+
if (Number.isNaN(time)) return null;
|
|
96
|
+
return Math.max(0, Math.floor((Date.now() - time) / DAY));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function inDays(days) {
|
|
100
|
+
const date = new Date(Date.now() + days * DAY);
|
|
101
|
+
date.setHours(9, 0, 0, 0);
|
|
102
|
+
return date.toISOString();
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function groupOf(plan) {
|
|
106
|
+
if (plan.status === 'done') return 'done';
|
|
107
|
+
if (plan.status === 'dropped') return 'dropped';
|
|
108
|
+
if (plan.is_due || plan.is_stale) return 'now';
|
|
109
|
+
if (plan.status === 'blocked' || (plan.reactivation_conditions || []).length > 0) return 'waiting';
|
|
110
|
+
return 'later';
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function statusChip(plan, group) {
|
|
114
|
+
if (group === 'done') return { label: '做完了', tone: 'done' };
|
|
115
|
+
if (group === 'dropped') return { label: '不做了', tone: 'muted' };
|
|
116
|
+
if (group === 'now') {
|
|
117
|
+
if (plan.is_due) {
|
|
118
|
+
const late = daysSince(plan.review_at);
|
|
119
|
+
return { label: late > 0 ? `拖了 ${late} 天` : '今天到期', tone: 'warn' };
|
|
120
|
+
}
|
|
121
|
+
const age = daysSince(plan.updated_at);
|
|
122
|
+
return { label: age > 0 ? `放了 ${age} 天` : '放太久了', tone: 'warn' };
|
|
123
|
+
}
|
|
124
|
+
if (group === 'waiting') return { label: '在等条件', tone: 'wait' };
|
|
125
|
+
if (plan.review_at) return { label: `排到 ${fmtDate(plan.review_at)}`, tone: 'plan' };
|
|
126
|
+
return { label: '先记着', tone: 'idle' };
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function timingNote(plan, group) {
|
|
130
|
+
if (group === 'done' || group === 'dropped') {
|
|
131
|
+
const when = plan.completed_at || plan.updated_at;
|
|
132
|
+
return `${group === 'done' ? '做完' : '放下'}于 ${fmtDate(when)}`;
|
|
133
|
+
}
|
|
134
|
+
if (group === 'now') {
|
|
135
|
+
if (plan.review_at) return `约的是 ${fmtDate(plan.review_at)}`;
|
|
136
|
+
return `上次看是 ${fmtDate(plan.updated_at)}`;
|
|
137
|
+
}
|
|
138
|
+
if (group === 'waiting') {
|
|
139
|
+
if (plan.review_at && plan.review_in_days > 0) return `约了 ${fmtDate(plan.review_at)} 回来看`;
|
|
140
|
+
const age = daysSince(plan.updated_at);
|
|
141
|
+
return age ? `${age} 天前确认过,还在等` : '在等一个条件';
|
|
142
|
+
}
|
|
143
|
+
if (plan.review_at) {
|
|
144
|
+
const days = plan.review_in_days;
|
|
145
|
+
if (days === 0) return '就是今天';
|
|
146
|
+
if (days === 1) return '明天';
|
|
147
|
+
if (days > 1) return `还有 ${days} 天`;
|
|
148
|
+
return `约的 ${fmtDate(plan.review_at)}`;
|
|
149
|
+
}
|
|
150
|
+
return '没定时间';
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function choiceOf(status) {
|
|
154
|
+
if (status === 'candidate' || status === 'idea') return 'someday';
|
|
155
|
+
return status;
|
|
156
|
+
}
|
|
157
|
+
|
|
83
158
|
function IconBase({ size = 16, children, ...props }) {
|
|
84
159
|
return h(
|
|
85
160
|
'svg',
|
|
@@ -112,7 +187,7 @@ window.__ModuleLoader__.load({
|
|
|
112
187
|
return h(IconBase, { size }, h('path', { d: 'M32 14v36M14 32h36' }));
|
|
113
188
|
}
|
|
114
189
|
|
|
115
|
-
function SearchIcon({ size =
|
|
190
|
+
function SearchIcon({ size = 15 }) {
|
|
116
191
|
return h(IconBase, { size }, h('circle', { cx: 28, cy: 28, r: 16 }), h('path', { d: 'm40 40 12 12' }));
|
|
117
192
|
}
|
|
118
193
|
|
|
@@ -132,177 +207,320 @@ window.__ModuleLoader__.load({
|
|
|
132
207
|
return h(IconBase, { size }, h('circle', { cx: 32, cy: 32, r: 22 }), h('path', { d: 'M32 19v14l9 5' }));
|
|
133
208
|
}
|
|
134
209
|
|
|
135
|
-
function
|
|
136
|
-
|
|
210
|
+
function Toast({ toast, onDismiss }) {
|
|
211
|
+
if (!toast) return null;
|
|
212
|
+
const { message, action } = toast;
|
|
213
|
+
return h(
|
|
214
|
+
'div',
|
|
215
|
+
{ className: 'pm-toast', role: 'status' },
|
|
216
|
+
h('span', { className: 'pm-toast-text' }, message),
|
|
217
|
+
action
|
|
218
|
+
? h(
|
|
219
|
+
'button',
|
|
220
|
+
{
|
|
221
|
+
className: 'pm-toast-action',
|
|
222
|
+
onClick: async () => {
|
|
223
|
+
try {
|
|
224
|
+
await action.run();
|
|
225
|
+
} catch (error) {
|
|
226
|
+
// 失败时保留原始提示即可,不额外打扰
|
|
227
|
+
}
|
|
228
|
+
onDismiss();
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
action.label,
|
|
232
|
+
)
|
|
233
|
+
: null,
|
|
234
|
+
);
|
|
137
235
|
}
|
|
138
236
|
|
|
139
|
-
function
|
|
140
|
-
|
|
141
|
-
|
|
237
|
+
function Field({ label, hint, children }) {
|
|
238
|
+
return h(
|
|
239
|
+
'label',
|
|
240
|
+
{ className: 'pm-field' },
|
|
241
|
+
h('span', { className: 'pm-field-label' }, label),
|
|
242
|
+
children,
|
|
243
|
+
hint ? h('span', { className: 'pm-field-hint' }, hint) : null,
|
|
244
|
+
);
|
|
142
245
|
}
|
|
143
246
|
|
|
144
|
-
function
|
|
145
|
-
|
|
247
|
+
function Modal({ title, subtitle, onClose, children, footer, wide = false }) {
|
|
248
|
+
useEffect(() => {
|
|
249
|
+
const onKey = (event) => {
|
|
250
|
+
if (event.key === 'Escape') onClose();
|
|
251
|
+
};
|
|
252
|
+
window.addEventListener('keydown', onKey);
|
|
253
|
+
return () => window.removeEventListener('keydown', onKey);
|
|
254
|
+
}, [onClose]);
|
|
255
|
+
return h(
|
|
256
|
+
'div',
|
|
257
|
+
{ className: 'pm-overlay', onMouseDown: (event) => event.target === event.currentTarget && onClose() },
|
|
258
|
+
h(
|
|
259
|
+
'section',
|
|
260
|
+
{ className: `pm-modal${wide ? ' pm-modal-wide' : ''}`, role: 'dialog', 'aria-modal': true, 'aria-label': title },
|
|
261
|
+
h(
|
|
262
|
+
'header',
|
|
263
|
+
{ className: 'pm-modal-head' },
|
|
264
|
+
h('div', null, h('h2', null, title), subtitle ? h('p', null, subtitle) : null),
|
|
265
|
+
h('button', { className: 'pm-icon-btn', onClick: onClose, title: '关闭' }, h(CloseIcon, { size: 18 })),
|
|
266
|
+
),
|
|
267
|
+
h('div', { className: 'pm-modal-body' }, children),
|
|
268
|
+
footer ? h('footer', { className: 'pm-modal-foot' }, footer) : null,
|
|
269
|
+
),
|
|
270
|
+
);
|
|
146
271
|
}
|
|
147
272
|
|
|
148
|
-
function
|
|
273
|
+
function Section({ title, count, hint, children }) {
|
|
274
|
+
return h(
|
|
275
|
+
'section',
|
|
276
|
+
{ className: 'pm-section' },
|
|
277
|
+
h(
|
|
278
|
+
'div',
|
|
279
|
+
{ className: 'pm-section-head' },
|
|
280
|
+
h('h2', null, title, count != null ? h('span', { className: 'pm-section-count' }, count) : null),
|
|
281
|
+
hint ? h('p', { className: 'pm-section-hint' }, hint) : null,
|
|
282
|
+
),
|
|
283
|
+
children,
|
|
284
|
+
);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
function SubGroup({ label, count, children }) {
|
|
149
288
|
return h(
|
|
150
289
|
'div',
|
|
151
|
-
{ className:
|
|
152
|
-
h('div', { className: 'pm-
|
|
153
|
-
h('div', { className: 'pm-
|
|
154
|
-
hint ? h('div', { className: 'pm-stat-hint' }, hint) : null,
|
|
290
|
+
{ className: 'pm-subgroup' },
|
|
291
|
+
h('div', { className: 'pm-subgroup-head' }, h('span', null, label), h('span', { className: 'pm-subgroup-count' }, count)),
|
|
292
|
+
h('div', { className: 'pm-list' }, children),
|
|
155
293
|
);
|
|
156
294
|
}
|
|
157
295
|
|
|
158
|
-
function Empty({ title, description,
|
|
296
|
+
function Empty({ title, description, actions = [] }) {
|
|
159
297
|
return h(
|
|
160
298
|
'div',
|
|
161
299
|
{ className: 'pm-empty' },
|
|
162
|
-
h('div', { className: 'pm-empty-mark' }, h(BookmarkIcon, { size:
|
|
300
|
+
h('div', { className: 'pm-empty-mark' }, h(BookmarkIcon, { size: 24 })),
|
|
163
301
|
h('h3', null, title),
|
|
164
302
|
h('p', null, description),
|
|
165
|
-
|
|
303
|
+
actions.length
|
|
304
|
+
? h(
|
|
305
|
+
'div',
|
|
306
|
+
{ className: 'pm-empty-actions' },
|
|
307
|
+
...actions.map((action, index) =>
|
|
308
|
+
h(
|
|
309
|
+
'button',
|
|
310
|
+
{
|
|
311
|
+
key: index,
|
|
312
|
+
className: `pm-btn ${action.primary ? 'pm-btn-primary' : 'pm-btn-ghost'}`,
|
|
313
|
+
onClick: action.onClick,
|
|
314
|
+
},
|
|
315
|
+
action.label,
|
|
316
|
+
),
|
|
317
|
+
),
|
|
318
|
+
)
|
|
319
|
+
: null,
|
|
320
|
+
);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
function QuickDates({ value, onChange }) {
|
|
324
|
+
return h(
|
|
325
|
+
'div',
|
|
326
|
+
{ className: 'pm-quick' },
|
|
327
|
+
...QUICK_DATES.map(([label, days]) =>
|
|
328
|
+
h(
|
|
329
|
+
'button',
|
|
330
|
+
{ key: label, type: 'button', className: 'pm-quick-btn', onClick: () => onChange(toLocalInput(inDays(days))) },
|
|
331
|
+
label,
|
|
332
|
+
),
|
|
333
|
+
),
|
|
334
|
+
h(
|
|
335
|
+
'button',
|
|
336
|
+
{
|
|
337
|
+
key: 'none',
|
|
338
|
+
type: 'button',
|
|
339
|
+
className: `pm-quick-btn${value ? '' : ' pm-quick-btn-active'}`,
|
|
340
|
+
onClick: () => onChange(''),
|
|
341
|
+
},
|
|
342
|
+
'不定',
|
|
343
|
+
),
|
|
166
344
|
);
|
|
167
345
|
}
|
|
168
346
|
|
|
169
|
-
function
|
|
170
|
-
const
|
|
347
|
+
function FocusCard({ plan, total, onOpen, onAct }) {
|
|
348
|
+
const conditions = plan.reactivation_conditions || [];
|
|
349
|
+
return h(
|
|
350
|
+
'section',
|
|
351
|
+
{ className: 'pm-focus' },
|
|
352
|
+
h(
|
|
353
|
+
'div',
|
|
354
|
+
{ className: 'pm-focus-top' },
|
|
355
|
+
h('span', { className: 'pm-focus-kicker' }, total > 1 ? `轮到你了 · 后面还有 ${total - 1} 件` : '轮到你了'),
|
|
356
|
+
h(
|
|
357
|
+
'span',
|
|
358
|
+
{ className: 'pm-focus-when' },
|
|
359
|
+
plan.is_due && daysSince(plan.review_at) > 0
|
|
360
|
+
? `${timingNote(plan, 'now')},拖了 ${daysSince(plan.review_at)} 天`
|
|
361
|
+
: timingNote(plan, 'now'),
|
|
362
|
+
),
|
|
363
|
+
),
|
|
364
|
+
h('h2', { className: 'pm-focus-title' }, plan.title),
|
|
365
|
+
plan.details ? h('p', { className: 'pm-focus-detail' }, plan.details) : null,
|
|
366
|
+
plan.reason_deferred
|
|
367
|
+
? h('p', { className: 'pm-focus-why' }, h('span', null, '当时先没做:'), plan.reason_deferred)
|
|
368
|
+
: null,
|
|
369
|
+
conditions.length
|
|
370
|
+
? h(
|
|
371
|
+
'div',
|
|
372
|
+
{ className: 'pm-focus-wait' },
|
|
373
|
+
h('span', { className: 'pm-wait-label' }, '卡在'),
|
|
374
|
+
...conditions.slice(0, 3).map((condition, index) =>
|
|
375
|
+
h('span', { className: 'pm-chip', key: index }, condition),
|
|
376
|
+
),
|
|
377
|
+
)
|
|
378
|
+
: null,
|
|
379
|
+
h('p', { className: 'pm-focus-ask' }, '花两分钟定一下,然后就可以去忙别的了。'),
|
|
380
|
+
h(
|
|
381
|
+
'div',
|
|
382
|
+
{ className: 'pm-focus-actions' },
|
|
383
|
+
h('button', { className: 'pm-btn pm-btn-done', onClick: () => onAct(plan, 'done') }, h(CheckIcon, { size: 14 }), '做好了'),
|
|
384
|
+
h('button', { className: 'pm-btn pm-btn-ghost', onClick: () => onAct(plan, 'snooze') }, h(ClockIcon, { size: 14 }), '再等一周'),
|
|
385
|
+
h('button', { className: 'pm-btn pm-btn-quiet', onClick: () => onAct(plan, 'drop') }, '这件事不做了'),
|
|
386
|
+
h('button', { className: 'pm-btn pm-btn-quiet', onClick: () => onOpen(plan) }, '改一改'),
|
|
387
|
+
),
|
|
388
|
+
);
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
function PlanRow({ plan, group, onOpen, onAct }) {
|
|
392
|
+
const closed = group === 'done' || group === 'dropped';
|
|
393
|
+
const chip = statusChip(plan, group);
|
|
394
|
+
const conditions = plan.reactivation_conditions || [];
|
|
395
|
+
const description = plan.details || plan.reason_deferred || '';
|
|
396
|
+
const actions = closed
|
|
397
|
+
? [{ label: '捡回来', action: 'restore' }]
|
|
398
|
+
: group === 'now'
|
|
399
|
+
? [
|
|
400
|
+
{ label: '再等一周', action: 'snooze' },
|
|
401
|
+
{ label: '不做了', action: 'drop', danger: true },
|
|
402
|
+
]
|
|
403
|
+
: group === 'waiting'
|
|
404
|
+
? [
|
|
405
|
+
{ label: '条件到了', action: 'advance' },
|
|
406
|
+
{ label: '再等一周', action: 'snooze' },
|
|
407
|
+
]
|
|
408
|
+
: plan.status === 'planned'
|
|
409
|
+
? [
|
|
410
|
+
{ label: '今天做', action: 'advance' },
|
|
411
|
+
{ label: '不做了', action: 'drop', danger: true },
|
|
412
|
+
]
|
|
413
|
+
: [
|
|
414
|
+
{ label: '排进这周', action: 'thisweek' },
|
|
415
|
+
{ label: '不做了', action: 'drop', danger: true },
|
|
416
|
+
];
|
|
417
|
+
|
|
171
418
|
return h(
|
|
172
419
|
'article',
|
|
173
420
|
{
|
|
174
|
-
className: `pm-
|
|
421
|
+
className: `pm-item${closed ? ' pm-item-closed' : ''}`,
|
|
175
422
|
onClick: () => onOpen(plan),
|
|
176
423
|
tabIndex: 0,
|
|
177
424
|
onKeyDown: (event) => {
|
|
178
|
-
if (event.key === 'Enter' || event.key === ' ') {
|
|
425
|
+
if ((event.key === 'Enter' || event.key === ' ') && event.target === event.currentTarget) {
|
|
179
426
|
event.preventDefault();
|
|
180
427
|
onOpen(plan);
|
|
181
428
|
}
|
|
182
429
|
},
|
|
183
430
|
},
|
|
184
|
-
|
|
185
|
-
'div',
|
|
186
|
-
{ className: 'pm-card-head' },
|
|
187
|
-
h('span', { className: `pm-dot pm-dot-${plan.status}` }),
|
|
188
|
-
h('h3', { className: 'pm-card-title' }, plan.title),
|
|
189
|
-
h('span', { className: `pm-prio pm-prio-${plan.priority}` }, PRIORITY_LABELS[plan.priority] || plan.priority),
|
|
190
|
-
),
|
|
191
|
-
plan.details
|
|
192
|
-
? h('p', { className: 'pm-card-detail' }, plan.details)
|
|
193
|
-
: plan.reason_deferred
|
|
194
|
-
? h('p', { className: 'pm-card-detail' }, plan.reason_deferred)
|
|
195
|
-
: null,
|
|
196
|
-
plan.reactivation_conditions.length > 0
|
|
431
|
+
closed
|
|
197
432
|
? h(
|
|
198
|
-
'
|
|
199
|
-
{ className: 'pm-
|
|
200
|
-
h('span', { className: 'pm-
|
|
201
|
-
...plan.reactivation_conditions.slice(0, 3).map((condition, index) =>
|
|
202
|
-
h('span', { className: 'pm-chip', key: `${plan.id}-c-${index}` }, condition),
|
|
203
|
-
),
|
|
433
|
+
'span',
|
|
434
|
+
{ className: `pm-item-mark${plan.status === 'done' ? ' pm-item-mark-done' : ''}` },
|
|
435
|
+
plan.status === 'done' ? h(CheckIcon, { size: 12 }) : h('span', { className: 'pm-item-mark-dash' }),
|
|
204
436
|
)
|
|
205
|
-
:
|
|
206
|
-
h(
|
|
207
|
-
'div',
|
|
208
|
-
{ className: 'pm-card-foot' },
|
|
209
|
-
h(
|
|
210
|
-
'div',
|
|
211
|
-
{ className: 'pm-meta' },
|
|
212
|
-
plan.project ? h('span', { className: 'pm-project' }, plan.project.name) : null,
|
|
213
|
-
h('span', { className: overdue ? 'pm-due' : '' }, reviewLabel(plan)),
|
|
214
|
-
plan.review_at ? h('span', { className: 'pm-muted' }, fmtDate(plan.review_at, true)) : null,
|
|
215
|
-
),
|
|
216
|
-
h(
|
|
217
|
-
'div',
|
|
218
|
-
{ className: 'pm-card-actions' },
|
|
219
|
-
h(
|
|
437
|
+
: h(
|
|
220
438
|
'button',
|
|
221
439
|
{
|
|
222
|
-
className: 'pm-
|
|
223
|
-
|
|
440
|
+
className: 'pm-check',
|
|
441
|
+
type: 'button',
|
|
442
|
+
title: '做完了',
|
|
443
|
+
'aria-label': `把「${plan.title}」标记为做完了`,
|
|
224
444
|
onClick: (event) => {
|
|
225
445
|
event.stopPropagation();
|
|
226
|
-
|
|
446
|
+
onAct(plan, 'done');
|
|
227
447
|
},
|
|
228
448
|
},
|
|
229
|
-
h(CheckIcon),
|
|
449
|
+
h(CheckIcon, { size: 12 }),
|
|
230
450
|
),
|
|
451
|
+
h(
|
|
452
|
+
'div',
|
|
453
|
+
{ className: 'pm-item-body' },
|
|
454
|
+
h(
|
|
455
|
+
'div',
|
|
456
|
+
{ className: 'pm-item-head' },
|
|
457
|
+
h('h3', { className: 'pm-item-title' }, plan.title),
|
|
458
|
+
plan.priority === 'high' && !closed ? h('span', { className: 'pm-flag' }, '重要') : null,
|
|
459
|
+
h('span', { className: `pm-state pm-state-${chip.tone}` }, chip.label),
|
|
460
|
+
),
|
|
461
|
+
description ? h('p', { className: 'pm-item-detail' }, description) : null,
|
|
462
|
+
conditions.length && !closed
|
|
463
|
+
? h(
|
|
464
|
+
'div',
|
|
465
|
+
{ className: 'pm-wait' },
|
|
466
|
+
h('span', { className: 'pm-wait-label' }, '卡在'),
|
|
467
|
+
...conditions.slice(0, 2).map((condition, index) =>
|
|
468
|
+
h('span', { className: 'pm-chip', key: index }, condition),
|
|
469
|
+
),
|
|
470
|
+
conditions.length > 2 ? h('span', { className: 'pm-chip' }, `+${conditions.length - 2}`) : null,
|
|
471
|
+
)
|
|
472
|
+
: null,
|
|
473
|
+
h(
|
|
474
|
+
'div',
|
|
475
|
+
{ className: 'pm-item-foot' },
|
|
231
476
|
h(
|
|
232
|
-
'
|
|
233
|
-
{
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
onClick: (event) => {
|
|
237
|
-
event.stopPropagation();
|
|
238
|
-
onSnooze(plan);
|
|
239
|
-
},
|
|
240
|
-
},
|
|
241
|
-
h(ClockIcon),
|
|
477
|
+
'div',
|
|
478
|
+
{ className: 'pm-item-meta' },
|
|
479
|
+
plan.project ? h('span', { className: 'pm-project' }, plan.project.name) : null,
|
|
480
|
+
h('span', null, timingNote(plan, group)),
|
|
242
481
|
),
|
|
243
482
|
h(
|
|
244
|
-
'
|
|
245
|
-
{
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
483
|
+
'div',
|
|
484
|
+
{ className: 'pm-item-actions' },
|
|
485
|
+
...actions.map((action) =>
|
|
486
|
+
h(
|
|
487
|
+
'button',
|
|
488
|
+
{
|
|
489
|
+
key: action.action,
|
|
490
|
+
type: 'button',
|
|
491
|
+
className: `pm-text-btn${action.danger ? ' pm-text-btn-danger' : ''}`,
|
|
492
|
+
onClick: (event) => {
|
|
493
|
+
event.stopPropagation();
|
|
494
|
+
onAct(plan, action.action);
|
|
495
|
+
},
|
|
496
|
+
},
|
|
497
|
+
action.label,
|
|
498
|
+
),
|
|
499
|
+
),
|
|
254
500
|
),
|
|
255
501
|
),
|
|
256
502
|
),
|
|
257
503
|
);
|
|
258
504
|
}
|
|
259
505
|
|
|
260
|
-
function
|
|
261
|
-
return h(
|
|
262
|
-
'label',
|
|
263
|
-
{ className: 'pm-field' },
|
|
264
|
-
h('span', { className: 'pm-field-label' }, label),
|
|
265
|
-
children,
|
|
266
|
-
hint ? h('span', { className: 'pm-field-hint' }, hint) : null,
|
|
267
|
-
);
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
function Modal({ title, subtitle, onClose, children, footer, wide = false }) {
|
|
271
|
-
useEffect(() => {
|
|
272
|
-
const onKey = (event) => {
|
|
273
|
-
if (event.key === 'Escape') onClose();
|
|
274
|
-
};
|
|
275
|
-
window.addEventListener('keydown', onKey);
|
|
276
|
-
return () => window.removeEventListener('keydown', onKey);
|
|
277
|
-
}, [onClose]);
|
|
278
|
-
return h(
|
|
279
|
-
'div',
|
|
280
|
-
{ className: 'pm-overlay', onMouseDown: (event) => event.target === event.currentTarget && onClose() },
|
|
281
|
-
h(
|
|
282
|
-
'section',
|
|
283
|
-
{ className: `pm-modal${wide ? ' pm-modal-wide' : ''}`, role: 'dialog', 'aria-modal': true, 'aria-label': title },
|
|
284
|
-
h(
|
|
285
|
-
'header',
|
|
286
|
-
{ className: 'pm-modal-head' },
|
|
287
|
-
h('div', null, h('h2', null, title), subtitle ? h('p', null, subtitle) : null),
|
|
288
|
-
h('button', { className: 'pm-icon-btn', onClick: onClose, title: '关闭' }, h(CloseIcon, { size: 18 })),
|
|
289
|
-
),
|
|
290
|
-
h('div', { className: 'pm-modal-body' }, children),
|
|
291
|
-
footer ? h('footer', { className: 'pm-modal-foot' }, footer) : null,
|
|
292
|
-
),
|
|
293
|
-
);
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
function DetailModal({ plan, onClose, onSaved, notify }) {
|
|
506
|
+
function DetailModal({ plan, onClose, onSaved, onAct, notify }) {
|
|
297
507
|
const [draft, setDraft] = useState(() => toDraft(plan));
|
|
508
|
+
const [statusTouched, setStatusTouched] = useState(false);
|
|
298
509
|
const [saving, setSaving] = useState(false);
|
|
299
510
|
|
|
300
|
-
useEffect(() =>
|
|
511
|
+
useEffect(() => {
|
|
512
|
+
setDraft(toDraft(plan));
|
|
513
|
+
setStatusTouched(false);
|
|
514
|
+
}, [plan]);
|
|
301
515
|
|
|
302
516
|
function set(key, value) {
|
|
303
517
|
setDraft((current) => ({ ...current, [key]: value }));
|
|
304
518
|
}
|
|
305
519
|
|
|
520
|
+
const group = groupOf(plan);
|
|
521
|
+
const closed = group === 'done' || group === 'dropped';
|
|
522
|
+
const currentChoice = choiceOf(draft.status);
|
|
523
|
+
|
|
306
524
|
async function save() {
|
|
307
525
|
if (!draft.title.trim()) {
|
|
308
526
|
notify('标题不能为空');
|
|
@@ -310,18 +528,20 @@ window.__ModuleLoader__.load({
|
|
|
310
528
|
}
|
|
311
529
|
setSaving(true);
|
|
312
530
|
try {
|
|
531
|
+
const payload = {
|
|
532
|
+
title: draft.title,
|
|
533
|
+
details: draft.details,
|
|
534
|
+
reason_deferred: draft.reason_deferred,
|
|
535
|
+
reactivation_conditions: splitLines(draft.conditions),
|
|
536
|
+
tags: splitTags(draft.tags),
|
|
537
|
+
priority: draft.priority,
|
|
538
|
+
effort: draft.effort,
|
|
539
|
+
review_at: fromLocalInput(draft.review_at),
|
|
540
|
+
};
|
|
541
|
+
if (statusTouched) payload.status = draft.status;
|
|
313
542
|
const result = await api(`/plans/${encodeURIComponent(plan.id)}`, {
|
|
314
543
|
method: 'PATCH',
|
|
315
|
-
body: JSON.stringify(
|
|
316
|
-
title: draft.title,
|
|
317
|
-
details: draft.details,
|
|
318
|
-
reason_deferred: draft.reason_deferred,
|
|
319
|
-
reactivation_conditions: splitLines(draft.conditions),
|
|
320
|
-
tags: splitTags(draft.tags),
|
|
321
|
-
priority: draft.priority,
|
|
322
|
-
effort: draft.effort,
|
|
323
|
-
review_at: fromLocalInput(draft.review_at),
|
|
324
|
-
}),
|
|
544
|
+
body: JSON.stringify(payload),
|
|
325
545
|
});
|
|
326
546
|
onSaved(result.plan);
|
|
327
547
|
notify('已保存');
|
|
@@ -335,7 +555,7 @@ window.__ModuleLoader__.load({
|
|
|
335
555
|
return h(
|
|
336
556
|
Modal,
|
|
337
557
|
{
|
|
338
|
-
title: '
|
|
558
|
+
title: '这一件',
|
|
339
559
|
subtitle: plan.project ? plan.project.name : '未归档',
|
|
340
560
|
onClose,
|
|
341
561
|
wide: true,
|
|
@@ -347,58 +567,181 @@ window.__ModuleLoader__.load({
|
|
|
347
567
|
'div',
|
|
348
568
|
{ className: 'pm-modal-actions' },
|
|
349
569
|
h('button', { className: 'pm-btn pm-btn-ghost', onClick: onClose }, '取消'),
|
|
350
|
-
h('button', { className: 'pm-btn pm-btn-primary', onClick: save, disabled: saving }, saving ? '保存中…' : '
|
|
570
|
+
h('button', { className: 'pm-btn pm-btn-primary', onClick: save, disabled: saving }, saving ? '保存中…' : '保存'),
|
|
351
571
|
),
|
|
352
572
|
),
|
|
353
573
|
},
|
|
354
574
|
h(
|
|
355
575
|
'div',
|
|
356
576
|
{ className: 'pm-form-grid' },
|
|
357
|
-
h(Field, { label: '标题' }, h('input', { value: draft.title, onChange: (e) => set('title', e.target.value) })),
|
|
358
577
|
h(
|
|
359
578
|
'div',
|
|
360
|
-
{ className: 'pm-
|
|
579
|
+
{ className: 'pm-decision' },
|
|
580
|
+
h('span', { className: 'pm-decision-label' }, closed ? '结束了,也可以捡回来' : '直接处理'),
|
|
581
|
+
closed
|
|
582
|
+
? h(
|
|
583
|
+
'button',
|
|
584
|
+
{
|
|
585
|
+
className: 'pm-btn pm-btn-ghost pm-btn-sm',
|
|
586
|
+
onClick: () => {
|
|
587
|
+
onAct(plan, 'restore');
|
|
588
|
+
onClose();
|
|
589
|
+
},
|
|
590
|
+
},
|
|
591
|
+
'捡回来',
|
|
592
|
+
)
|
|
593
|
+
: h(
|
|
594
|
+
React.Fragment,
|
|
595
|
+
null,
|
|
596
|
+
h(
|
|
597
|
+
'button',
|
|
598
|
+
{
|
|
599
|
+
className: 'pm-btn pm-btn-done pm-btn-sm',
|
|
600
|
+
onClick: () => {
|
|
601
|
+
onAct(plan, 'done');
|
|
602
|
+
onClose();
|
|
603
|
+
},
|
|
604
|
+
},
|
|
605
|
+
h(CheckIcon, { size: 13 }),
|
|
606
|
+
'做好了',
|
|
607
|
+
),
|
|
608
|
+
h(
|
|
609
|
+
'button',
|
|
610
|
+
{
|
|
611
|
+
className: 'pm-btn pm-btn-ghost pm-btn-sm',
|
|
612
|
+
onClick: () => {
|
|
613
|
+
onAct(plan, 'snooze');
|
|
614
|
+
onClose();
|
|
615
|
+
},
|
|
616
|
+
},
|
|
617
|
+
'再等一周',
|
|
618
|
+
),
|
|
619
|
+
h(
|
|
620
|
+
'button',
|
|
621
|
+
{
|
|
622
|
+
className: 'pm-btn pm-btn-quiet pm-btn-sm',
|
|
623
|
+
onClick: () => {
|
|
624
|
+
onAct(plan, 'drop');
|
|
625
|
+
onClose();
|
|
626
|
+
},
|
|
627
|
+
},
|
|
628
|
+
'这件事不做了',
|
|
629
|
+
),
|
|
630
|
+
),
|
|
631
|
+
),
|
|
632
|
+
h(Field, { label: '标题' }, h('input', { value: draft.title, onChange: (event) => set('title', event.target.value) })),
|
|
633
|
+
h(
|
|
634
|
+
Field,
|
|
635
|
+
{ label: '这件事现在算什么', hint: '状态会决定它出现在哪个分组里。' },
|
|
361
636
|
h(
|
|
362
|
-
|
|
363
|
-
{ label: '
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
637
|
+
'div',
|
|
638
|
+
{ className: 'pm-seg', role: 'group', 'aria-label': '计划状态' },
|
|
639
|
+
...STATUS_CHOICES.map((choice) =>
|
|
640
|
+
h(
|
|
641
|
+
'button',
|
|
642
|
+
{
|
|
643
|
+
key: choice.value,
|
|
644
|
+
type: 'button',
|
|
645
|
+
className: `pm-seg-btn${currentChoice === choice.value ? ' pm-seg-btn-active' : ''}`,
|
|
646
|
+
onClick: () => {
|
|
647
|
+
set('status', choice.value);
|
|
648
|
+
setStatusTouched(true);
|
|
649
|
+
},
|
|
650
|
+
},
|
|
651
|
+
choice.label,
|
|
652
|
+
),
|
|
368
653
|
),
|
|
369
654
|
),
|
|
655
|
+
),
|
|
656
|
+
currentChoice === 'blocked' && !splitLines(draft.conditions).length
|
|
657
|
+
? h(
|
|
658
|
+
'p',
|
|
659
|
+
{ className: 'pm-seg-note' },
|
|
660
|
+
'还没写条件。写一条,它才知道什么时候回来;不写的话,就只是被放在一边。',
|
|
661
|
+
)
|
|
662
|
+
: null,
|
|
663
|
+
currentChoice === 'planned' && !draft.review_at
|
|
664
|
+
? h(
|
|
665
|
+
'p',
|
|
666
|
+
{ className: 'pm-seg-note pm-seg-note-muted' },
|
|
667
|
+
'还没定哪天回来看,它会先待在「找时间做」里,不会催你。',
|
|
668
|
+
)
|
|
669
|
+
: null,
|
|
670
|
+
h(
|
|
671
|
+
Field,
|
|
672
|
+
{ label: '下一步要做什么' },
|
|
673
|
+
h('textarea', {
|
|
674
|
+
rows: 3,
|
|
675
|
+
placeholder: '具体做哪一步,做到什么程度就算完。',
|
|
676
|
+
value: draft.details,
|
|
677
|
+
onChange: (event) => set('details', event.target.value),
|
|
678
|
+
}),
|
|
679
|
+
),
|
|
680
|
+
h(
|
|
681
|
+
Field,
|
|
682
|
+
{ label: '当时为什么先没做' },
|
|
683
|
+
h('input', {
|
|
684
|
+
placeholder: '一句话就够,给以后的自己看。',
|
|
685
|
+
value: draft.reason_deferred,
|
|
686
|
+
onChange: (event) => set('reason_deferred', event.target.value),
|
|
687
|
+
}),
|
|
688
|
+
),
|
|
689
|
+
h(
|
|
690
|
+
Field,
|
|
691
|
+
{ label: '什么条件下回来', hint: '每行一个。填了条件,它会待在「在等条件」里,不会催你。' },
|
|
692
|
+
h('textarea', {
|
|
693
|
+
rows: 2,
|
|
694
|
+
placeholder: '例如:等 DSH 0.3 发布\n例如:用户再提到这个需求',
|
|
695
|
+
value: draft.conditions,
|
|
696
|
+
onChange: (event) => set('conditions', event.target.value),
|
|
697
|
+
}),
|
|
698
|
+
),
|
|
699
|
+
h(
|
|
700
|
+
Field,
|
|
701
|
+
{ label: '什么时候回来看' },
|
|
702
|
+
h('input', {
|
|
703
|
+
type: 'datetime-local',
|
|
704
|
+
value: draft.review_at,
|
|
705
|
+
onChange: (event) => set('review_at', event.target.value),
|
|
706
|
+
}),
|
|
707
|
+
),
|
|
708
|
+
h(QuickDates, { value: draft.review_at, onChange: (value) => set('review_at', value) }),
|
|
709
|
+
h(
|
|
710
|
+
'details',
|
|
711
|
+
{ className: 'pm-more' },
|
|
712
|
+
h('summary', null, '更多设置'),
|
|
370
713
|
h(
|
|
371
|
-
|
|
372
|
-
{
|
|
714
|
+
'div',
|
|
715
|
+
{ className: 'pm-form-grid' },
|
|
373
716
|
h(
|
|
374
|
-
'
|
|
375
|
-
{
|
|
376
|
-
|
|
717
|
+
'div',
|
|
718
|
+
{ className: 'pm-form-row' },
|
|
719
|
+
h(
|
|
720
|
+
Field,
|
|
721
|
+
{ label: '优先级' },
|
|
722
|
+
h(
|
|
723
|
+
'select',
|
|
724
|
+
{ value: draft.priority, onChange: (event) => set('priority', event.target.value) },
|
|
725
|
+
...Object.entries(PRIORITY_LABELS).map(([value, label]) => h('option', { value, key: value }, label)),
|
|
726
|
+
),
|
|
727
|
+
),
|
|
728
|
+
h(
|
|
729
|
+
Field,
|
|
730
|
+
{ label: '大概要花' },
|
|
731
|
+
h(
|
|
732
|
+
'select',
|
|
733
|
+
{ value: draft.effort, onChange: (event) => set('effort', event.target.value) },
|
|
734
|
+
...Object.entries(EFFORT_LABELS).map(([value, label]) => h('option', { value, key: value }, label)),
|
|
735
|
+
),
|
|
736
|
+
),
|
|
377
737
|
),
|
|
378
|
-
),
|
|
379
|
-
h(
|
|
380
|
-
Field,
|
|
381
|
-
{ label: '投入' },
|
|
382
738
|
h(
|
|
383
|
-
|
|
384
|
-
{
|
|
385
|
-
|
|
739
|
+
Field,
|
|
740
|
+
{ label: '标签' },
|
|
741
|
+
h('input', { placeholder: '用逗号分隔', value: draft.tags, onChange: (event) => set('tags', event.target.value) }),
|
|
386
742
|
),
|
|
387
743
|
),
|
|
388
744
|
),
|
|
389
|
-
h(Field, { label: '计划内容' }, h('textarea', { rows: 4, value: draft.details, onChange: (e) => set('details', e.target.value) })),
|
|
390
|
-
h(Field, { label: '为什么现在不做' }, h('textarea', { rows: 2, value: draft.reason_deferred, onChange: (e) => set('reason_deferred', e.target.value) })),
|
|
391
|
-
h(
|
|
392
|
-
Field,
|
|
393
|
-
{ label: '重新考虑的条件', hint: '每行一个。满足任意一条时,这条计划就值得回来看。' },
|
|
394
|
-
h('textarea', { rows: 3, value: draft.conditions, onChange: (e) => set('conditions', e.target.value) }),
|
|
395
|
-
),
|
|
396
|
-
h(
|
|
397
|
-
'div',
|
|
398
|
-
{ className: 'pm-form-row' },
|
|
399
|
-
h(Field, { label: '计划复盘时间' }, h('input', { type: 'datetime-local', value: draft.review_at, onChange: (e) => set('review_at', e.target.value) })),
|
|
400
|
-
h(Field, { label: '标签', hint: '用逗号分隔' }, h('input', { value: draft.tags, onChange: (e) => set('tags', e.target.value) })),
|
|
401
|
-
),
|
|
402
745
|
),
|
|
403
746
|
);
|
|
404
747
|
}
|
|
@@ -409,7 +752,6 @@ window.__ModuleLoader__.load({
|
|
|
409
752
|
details: '',
|
|
410
753
|
reason_deferred: '',
|
|
411
754
|
conditions: '',
|
|
412
|
-
status: 'someday',
|
|
413
755
|
priority: 'medium',
|
|
414
756
|
effort: 'unknown',
|
|
415
757
|
review_at: '',
|
|
@@ -444,7 +786,7 @@ window.__ModuleLoader__.load({
|
|
|
444
786
|
}),
|
|
445
787
|
});
|
|
446
788
|
onCreated(result.plan);
|
|
447
|
-
notify(result.duplicate ? '
|
|
789
|
+
notify(result.duplicate ? '已有同名计划,已打开那一条' : '记下了');
|
|
448
790
|
} catch (error) {
|
|
449
791
|
notify(error.message);
|
|
450
792
|
} finally {
|
|
@@ -455,13 +797,13 @@ window.__ModuleLoader__.load({
|
|
|
455
797
|
return h(
|
|
456
798
|
Modal,
|
|
457
799
|
{
|
|
458
|
-
title: '
|
|
459
|
-
subtitle: '
|
|
800
|
+
title: '记一件先不做的事',
|
|
801
|
+
subtitle: '写给以后的自己:为什么停下,什么条件下回来。',
|
|
460
802
|
onClose,
|
|
461
803
|
footer: h(
|
|
462
804
|
React.Fragment,
|
|
463
805
|
null,
|
|
464
|
-
h('span', { className: 'pm-modal-note' }, '
|
|
806
|
+
h('span', { className: 'pm-modal-note' }, '只会存在本机,不会上传'),
|
|
465
807
|
h(
|
|
466
808
|
'div',
|
|
467
809
|
{ className: 'pm-modal-actions' },
|
|
@@ -473,7 +815,45 @@ window.__ModuleLoader__.load({
|
|
|
473
815
|
h(
|
|
474
816
|
'div',
|
|
475
817
|
{ className: 'pm-form-grid' },
|
|
476
|
-
h(
|
|
818
|
+
h(
|
|
819
|
+
Field,
|
|
820
|
+
{ label: '要做什么' },
|
|
821
|
+
h('input', {
|
|
822
|
+
autoFocus: true,
|
|
823
|
+
placeholder: '例如:把同步冲突合并做成自动重试',
|
|
824
|
+
value: draft.title,
|
|
825
|
+
onChange: (event) => set('title', event.target.value),
|
|
826
|
+
}),
|
|
827
|
+
),
|
|
828
|
+
h(
|
|
829
|
+
Field,
|
|
830
|
+
{ label: '下一步要做什么' },
|
|
831
|
+
h('textarea', {
|
|
832
|
+
rows: 2,
|
|
833
|
+
placeholder: '可留空。下次回来时,从哪一步接着做。',
|
|
834
|
+
value: draft.details,
|
|
835
|
+
onChange: (event) => set('details', event.target.value),
|
|
836
|
+
}),
|
|
837
|
+
),
|
|
838
|
+
h(
|
|
839
|
+
Field,
|
|
840
|
+
{ label: '为什么现在不做' },
|
|
841
|
+
h('input', {
|
|
842
|
+
placeholder: '例如:先等侧栏 API 稳定',
|
|
843
|
+
value: draft.reason_deferred,
|
|
844
|
+
onChange: (event) => set('reason_deferred', event.target.value),
|
|
845
|
+
}),
|
|
846
|
+
),
|
|
847
|
+
h(
|
|
848
|
+
Field,
|
|
849
|
+
{ label: '什么条件下回来', hint: '每行一个,可留空。填了就会放在「在等条件」里。' },
|
|
850
|
+
h('textarea', {
|
|
851
|
+
rows: 2,
|
|
852
|
+
placeholder: '例如:DSH 发布 0.3\n例如:用户再次提到这个需求',
|
|
853
|
+
value: draft.conditions,
|
|
854
|
+
onChange: (event) => set('conditions', event.target.value),
|
|
855
|
+
}),
|
|
856
|
+
),
|
|
477
857
|
h(
|
|
478
858
|
'div',
|
|
479
859
|
{ className: 'pm-form-row' },
|
|
@@ -482,32 +862,56 @@ window.__ModuleLoader__.load({
|
|
|
482
862
|
{ label: '项目' },
|
|
483
863
|
h(
|
|
484
864
|
'select',
|
|
485
|
-
{ value: draft.project_id, onChange: (
|
|
865
|
+
{ value: draft.project_id, onChange: (event) => set('project_id', event.target.value) },
|
|
486
866
|
...projects.map((project) => h('option', { value: project.id, key: project.id }, project.name)),
|
|
487
867
|
),
|
|
488
868
|
),
|
|
489
869
|
h(
|
|
490
870
|
Field,
|
|
491
|
-
{ label: '
|
|
492
|
-
h(
|
|
493
|
-
'
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
),
|
|
871
|
+
{ label: '什么时候回来看', hint: '到点了会自己跑到「轮到你」' },
|
|
872
|
+
h('input', {
|
|
873
|
+
type: 'datetime-local',
|
|
874
|
+
value: draft.review_at,
|
|
875
|
+
onChange: (event) => set('review_at', event.target.value),
|
|
876
|
+
}),
|
|
497
877
|
),
|
|
498
878
|
),
|
|
499
|
-
h(
|
|
500
|
-
h(Field, { label: '为什么现在不做' }, h('input', { placeholder: '例如:先等 DSH 侧栏 API 稳定', value: draft.reason_deferred, onChange: (e) => set('reason_deferred', e.target.value) })),
|
|
501
|
-
h(
|
|
502
|
-
Field,
|
|
503
|
-
{ label: '重新考虑的条件', hint: '每行一个,可留空。' },
|
|
504
|
-
h('textarea', { rows: 2, placeholder: '例如:DSH 发布 0.3\n例如:用户再次提到这个需求', value: draft.conditions, onChange: (e) => set('conditions', e.target.value) }),
|
|
505
|
-
),
|
|
879
|
+
h(QuickDates, { value: draft.review_at, onChange: (value) => set('review_at', value) }),
|
|
506
880
|
h(
|
|
507
|
-
'
|
|
508
|
-
{ className: 'pm-
|
|
509
|
-
h(
|
|
510
|
-
h(
|
|
881
|
+
'details',
|
|
882
|
+
{ className: 'pm-more' },
|
|
883
|
+
h('summary', null, '更多设置'),
|
|
884
|
+
h(
|
|
885
|
+
'div',
|
|
886
|
+
{ className: 'pm-form-grid' },
|
|
887
|
+
h(
|
|
888
|
+
'div',
|
|
889
|
+
{ className: 'pm-form-row' },
|
|
890
|
+
h(
|
|
891
|
+
Field,
|
|
892
|
+
{ label: '优先级' },
|
|
893
|
+
h(
|
|
894
|
+
'select',
|
|
895
|
+
{ value: draft.priority, onChange: (event) => set('priority', event.target.value) },
|
|
896
|
+
...Object.entries(PRIORITY_LABELS).map(([value, label]) => h('option', { value, key: value }, label)),
|
|
897
|
+
),
|
|
898
|
+
),
|
|
899
|
+
h(
|
|
900
|
+
Field,
|
|
901
|
+
{ label: '大概要花' },
|
|
902
|
+
h(
|
|
903
|
+
'select',
|
|
904
|
+
{ value: draft.effort, onChange: (event) => set('effort', event.target.value) },
|
|
905
|
+
...Object.entries(EFFORT_LABELS).map(([value, label]) => h('option', { value, key: value }, label)),
|
|
906
|
+
),
|
|
907
|
+
),
|
|
908
|
+
),
|
|
909
|
+
h(
|
|
910
|
+
Field,
|
|
911
|
+
{ label: '标签' },
|
|
912
|
+
h('input', { placeholder: 'plugin, ui', value: draft.tags, onChange: (event) => set('tags', event.target.value) }),
|
|
913
|
+
),
|
|
914
|
+
),
|
|
511
915
|
),
|
|
512
916
|
),
|
|
513
917
|
);
|
|
@@ -529,80 +933,292 @@ window.__ModuleLoader__.load({
|
|
|
529
933
|
|
|
530
934
|
function App() {
|
|
531
935
|
const [summary, setSummary] = useState(null);
|
|
532
|
-
const [
|
|
533
|
-
const [
|
|
534
|
-
const [
|
|
936
|
+
const [openPlans, setOpenPlans] = useState([]);
|
|
937
|
+
const [closedPlans, setClosedPlans] = useState([]);
|
|
938
|
+
const [view, setView] = useState('now');
|
|
535
939
|
const [query, setQuery] = useState('');
|
|
536
940
|
const [project, setProject] = useState('');
|
|
537
|
-
const [status, setStatus] = useState('');
|
|
538
941
|
const [loading, setLoading] = useState(true);
|
|
539
942
|
const [error, setError] = useState('');
|
|
540
|
-
const [toast, setToast] = useState(
|
|
943
|
+
const [toast, setToast] = useState(null);
|
|
541
944
|
const [selected, setSelected] = useState(null);
|
|
542
945
|
const [creating, setCreating] = useState(false);
|
|
543
|
-
const [
|
|
946
|
+
const [picked, setPicked] = useState(false);
|
|
544
947
|
const toastTimer = useRef(null);
|
|
545
948
|
|
|
546
|
-
const notify = useCallback((message) => {
|
|
547
|
-
setToast(message);
|
|
949
|
+
const notify = useCallback((message, action = null) => {
|
|
950
|
+
setToast({ message, action });
|
|
548
951
|
if (toastTimer.current) clearTimeout(toastTimer.current);
|
|
549
|
-
toastTimer.current = setTimeout(() => setToast(
|
|
952
|
+
toastTimer.current = setTimeout(() => setToast(null), action ? 7000 : 2600);
|
|
953
|
+
}, []);
|
|
954
|
+
|
|
955
|
+
const dismissToast = useCallback(() => {
|
|
956
|
+
if (toastTimer.current) clearTimeout(toastTimer.current);
|
|
957
|
+
setToast(null);
|
|
550
958
|
}, []);
|
|
551
959
|
|
|
552
960
|
useEffect(() => () => toastTimer.current && clearTimeout(toastTimer.current), []);
|
|
553
961
|
|
|
554
962
|
const load = useCallback(async () => {
|
|
555
|
-
setLoading(true);
|
|
556
963
|
setError('');
|
|
557
964
|
try {
|
|
558
|
-
const
|
|
559
|
-
if (query.trim())
|
|
560
|
-
if (project)
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
965
|
+
const openParams = new URLSearchParams();
|
|
966
|
+
if (query.trim()) openParams.set('q', query.trim());
|
|
967
|
+
if (project) openParams.set('project', project);
|
|
968
|
+
openParams.set('limit', '500');
|
|
969
|
+
|
|
970
|
+
const closedParams = new URLSearchParams(openParams);
|
|
971
|
+
closedParams.set('closed', '1');
|
|
972
|
+
closedParams.set('status', 'done,dropped');
|
|
973
|
+
closedParams.set('limit', '200');
|
|
974
|
+
|
|
975
|
+
const [summaryResult, openResult, closedResult] = await Promise.all([
|
|
566
976
|
api('/summary'),
|
|
567
|
-
api(`/plans?${
|
|
977
|
+
api(`/plans?${openParams.toString()}`),
|
|
978
|
+
api(`/plans?${closedParams.toString()}`),
|
|
568
979
|
]);
|
|
569
980
|
setSummary(summaryResult);
|
|
570
|
-
|
|
571
|
-
|
|
981
|
+
setOpenPlans(openResult.plans || []);
|
|
982
|
+
setClosedPlans(closedResult.plans || []);
|
|
572
983
|
} catch (loadError) {
|
|
573
984
|
setError(loadError.message);
|
|
574
985
|
} finally {
|
|
575
986
|
setLoading(false);
|
|
576
987
|
}
|
|
577
|
-
}, [query, project
|
|
988
|
+
}, [query, project]);
|
|
578
989
|
|
|
579
990
|
useEffect(() => {
|
|
580
991
|
const timer = setTimeout(load, query ? 220 : 0);
|
|
581
992
|
return () => clearTimeout(timer);
|
|
582
993
|
}, [load, query]);
|
|
583
994
|
|
|
995
|
+
const groups = useMemo(() => {
|
|
996
|
+
const now = [];
|
|
997
|
+
const waiting = [];
|
|
998
|
+
const later = [];
|
|
999
|
+
for (const plan of openPlans) {
|
|
1000
|
+
const group = groupOf(plan);
|
|
1001
|
+
if (group === 'waiting') waiting.push(plan);
|
|
1002
|
+
else if (group === 'later') later.push(plan);
|
|
1003
|
+
else now.push(plan);
|
|
1004
|
+
}
|
|
1005
|
+
const recency = (a, b) =>
|
|
1006
|
+
new Date(b.completed_at || b.updated_at).getTime() - new Date(a.completed_at || a.updated_at).getTime();
|
|
1007
|
+
const done = closedPlans.filter((plan) => plan.status === 'done').sort(recency);
|
|
1008
|
+
const dropped = closedPlans.filter((plan) => plan.status !== 'done').sort(recency);
|
|
1009
|
+
return { now, waiting, later, done, dropped };
|
|
1010
|
+
}, [openPlans, closedPlans]);
|
|
1011
|
+
|
|
1012
|
+
const counts = {
|
|
1013
|
+
now: groups.now.length,
|
|
1014
|
+
waiting: groups.waiting.length,
|
|
1015
|
+
later: groups.later.length,
|
|
1016
|
+
closed: groups.done.length + groups.dropped.length,
|
|
1017
|
+
};
|
|
1018
|
+
|
|
1019
|
+
const doneThisWeek = useMemo(
|
|
1020
|
+
() =>
|
|
1021
|
+
groups.done.filter((plan) => {
|
|
1022
|
+
const value = plan.completed_at || plan.updated_at;
|
|
1023
|
+
if (!value) return false;
|
|
1024
|
+
return Date.now() - new Date(value).getTime() < 7 * DAY;
|
|
1025
|
+
}).length,
|
|
1026
|
+
[groups.done],
|
|
1027
|
+
);
|
|
1028
|
+
|
|
1029
|
+
useEffect(() => {
|
|
1030
|
+
if (picked || loading || !summary) return;
|
|
1031
|
+
setPicked(true);
|
|
1032
|
+
if (!openPlans.length) return;
|
|
1033
|
+
if (counts.now === 0 && counts.waiting > 0) setView('waiting');
|
|
1034
|
+
else if (counts.now === 0 && counts.waiting === 0 && counts.later > 0) setView('later');
|
|
1035
|
+
}, [picked, loading, summary, openPlans, counts.now, counts.waiting, counts.later]);
|
|
1036
|
+
|
|
1037
|
+
const act = useCallback(
|
|
1038
|
+
async (plan, action) => {
|
|
1039
|
+
const before = {
|
|
1040
|
+
status: plan.status,
|
|
1041
|
+
review_at: plan.review_at,
|
|
1042
|
+
last_reviewed_at: plan.last_reviewed_at,
|
|
1043
|
+
};
|
|
1044
|
+
const now = new Date();
|
|
1045
|
+
let patch;
|
|
1046
|
+
let message;
|
|
1047
|
+
if (action === 'done') {
|
|
1048
|
+
patch = { status: 'done' };
|
|
1049
|
+
message = '做完了,已归档';
|
|
1050
|
+
} else if (action === 'drop') {
|
|
1051
|
+
patch = { status: 'dropped' };
|
|
1052
|
+
message = '先放下了';
|
|
1053
|
+
} else if (action === 'restore') {
|
|
1054
|
+
patch = { status: 'someday', review_at: null };
|
|
1055
|
+
message = '捡回来了,先放着';
|
|
1056
|
+
} else if (action === 'snooze') {
|
|
1057
|
+
patch = { review_at: inDays(7), last_reviewed_at: now.toISOString() };
|
|
1058
|
+
message = '一周后再提醒你';
|
|
1059
|
+
} else if (action === 'advance') {
|
|
1060
|
+
patch = { status: 'planned', review_at: now.toISOString(), last_reviewed_at: now.toISOString() };
|
|
1061
|
+
message = '排上了,今天处理';
|
|
1062
|
+
} else if (action === 'thisweek') {
|
|
1063
|
+
patch = { status: 'planned', review_at: inDays(3) };
|
|
1064
|
+
message = '排进这周了';
|
|
1065
|
+
} else {
|
|
1066
|
+
return;
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
try {
|
|
1070
|
+
await api(`/plans/${encodeURIComponent(plan.id)}`, {
|
|
1071
|
+
method: 'PATCH',
|
|
1072
|
+
body: JSON.stringify(patch),
|
|
1073
|
+
});
|
|
1074
|
+
notify(message, {
|
|
1075
|
+
label: '撤销',
|
|
1076
|
+
run: async () => {
|
|
1077
|
+
await api(`/plans/${encodeURIComponent(plan.id)}`, {
|
|
1078
|
+
method: 'PATCH',
|
|
1079
|
+
body: JSON.stringify(before),
|
|
1080
|
+
});
|
|
1081
|
+
await load();
|
|
1082
|
+
},
|
|
1083
|
+
});
|
|
1084
|
+
await load();
|
|
1085
|
+
} catch (actionError) {
|
|
1086
|
+
notify(actionError.message);
|
|
1087
|
+
}
|
|
1088
|
+
},
|
|
1089
|
+
[load, notify],
|
|
1090
|
+
);
|
|
1091
|
+
|
|
584
1092
|
const projects = summary?.projects || [];
|
|
585
|
-
const
|
|
1093
|
+
const searching = query.trim().length > 0;
|
|
1094
|
+
const current = view === 'closed' ? [...groups.done, ...groups.dropped] : groups[view] || [];
|
|
1095
|
+
const results = searching ? [...groups.now, ...groups.waiting, ...groups.later, ...groups.done, ...groups.dropped] : current;
|
|
586
1096
|
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
1097
|
+
function rows(list) {
|
|
1098
|
+
return list.map((plan) =>
|
|
1099
|
+
h(PlanRow, { key: plan.id, plan, group: groupOf(plan), onOpen: setSelected, onAct: act }),
|
|
1100
|
+
);
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
function emptyFor(target) {
|
|
1104
|
+
if (target === 'now' && !summary?.stats?.total) {
|
|
1105
|
+
return h(Empty, {
|
|
1106
|
+
title: '还没有记下的事',
|
|
1107
|
+
description: '以后遇到「等下一版」「等条件满足」的事,记在这。到点它会来找你。',
|
|
1108
|
+
actions: [{ label: '记一件', onClick: () => setCreating(true), primary: true }],
|
|
592
1109
|
});
|
|
593
|
-
notify(action === 'done' ? '已完成' : action === 'drop' ? '已放弃' : '已推迟 7 天');
|
|
594
|
-
setSelected(null);
|
|
595
|
-
await load();
|
|
596
|
-
} catch (error) {
|
|
597
|
-
notify(error.message);
|
|
598
1110
|
}
|
|
1111
|
+
if (target === 'now') {
|
|
1112
|
+
return h(Empty, {
|
|
1113
|
+
title: '现在没有在等你的',
|
|
1114
|
+
description:
|
|
1115
|
+
counts.waiting > 0 || counts.later > 0
|
|
1116
|
+
? `有 ${counts.waiting} 件在等条件,${counts.later} 件先记着。想先看哪边?`
|
|
1117
|
+
: '干净了。记一件以后要接着做的事吧。',
|
|
1118
|
+
actions: [
|
|
1119
|
+
...(counts.waiting > 0 ? [{ label: '看看在等条件', onClick: () => setView('waiting') }] : []),
|
|
1120
|
+
...(counts.later > 0 ? [{ label: '看看先记着的', onClick: () => setView('later') }] : []),
|
|
1121
|
+
{ label: '记一件', onClick: () => setCreating(true), primary: true },
|
|
1122
|
+
],
|
|
1123
|
+
});
|
|
1124
|
+
}
|
|
1125
|
+
if (target === 'waiting') {
|
|
1126
|
+
return h(Empty, {
|
|
1127
|
+
title: '没有卡在别处的事',
|
|
1128
|
+
description: '等条件的事都处理完了。以后记的时候填一条条件,它就会待在这里,不会催你。',
|
|
1129
|
+
actions: [{ label: '记一件', onClick: () => setCreating(true), primary: true }],
|
|
1130
|
+
});
|
|
1131
|
+
}
|
|
1132
|
+
if (target === 'later') {
|
|
1133
|
+
return h(Empty, {
|
|
1134
|
+
title: '这里还空着',
|
|
1135
|
+
description: '先记着的事会放在这。到期了,它会自己跑到「轮到你」。',
|
|
1136
|
+
actions: [{ label: '记一件', onClick: () => setCreating(true), primary: true }],
|
|
1137
|
+
});
|
|
1138
|
+
}
|
|
1139
|
+
return h(Empty, {
|
|
1140
|
+
title: '还没有做完的事',
|
|
1141
|
+
description: '做完和放下的事会自动归档到这,随时可以捡回来。',
|
|
1142
|
+
actions: [],
|
|
1143
|
+
});
|
|
599
1144
|
}
|
|
600
1145
|
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
1146
|
+
let content;
|
|
1147
|
+
if (loading && !summary) {
|
|
1148
|
+
content = h(
|
|
1149
|
+
'div',
|
|
1150
|
+
{ className: 'pm-skeleton-list' },
|
|
1151
|
+
...[0, 1, 2].map((index) => h('div', { className: 'pm-skeleton', key: index })),
|
|
1152
|
+
);
|
|
1153
|
+
} else if (searching) {
|
|
1154
|
+
content =
|
|
1155
|
+
results.length === 0
|
|
1156
|
+
? h(Empty, {
|
|
1157
|
+
title: `没找到「${query.trim()}」`,
|
|
1158
|
+
description: '换个词试试,或者清空搜索。',
|
|
1159
|
+
actions: [{ label: '清空搜索', onClick: () => setQuery(''), primary: true }],
|
|
1160
|
+
})
|
|
1161
|
+
: h(Section, { title: '搜索结果', count: results.length, hint: '点开任意一件可以改,也可以直接归档。' }, h('div', { className: 'pm-list' }, ...rows(results)));
|
|
1162
|
+
} else if (current.length === 0) {
|
|
1163
|
+
content = emptyFor(view);
|
|
1164
|
+
} else if (view === 'now') {
|
|
1165
|
+
const [hero, ...rest] = current;
|
|
1166
|
+
content = h(
|
|
1167
|
+
'section',
|
|
1168
|
+
{ className: 'pm-section' },
|
|
1169
|
+
h(
|
|
1170
|
+
'div',
|
|
1171
|
+
{ className: 'pm-section-head' },
|
|
1172
|
+
h('h2', null, '轮到你', h('span', { className: 'pm-section-count' }, current.length)),
|
|
1173
|
+
h('p', { className: 'pm-section-hint' }, VIEWS[0].hint),
|
|
1174
|
+
),
|
|
1175
|
+
h(FocusCard, { plan: hero, total: current.length, onOpen: setSelected, onAct: act }),
|
|
1176
|
+
rest.length
|
|
1177
|
+
? h(
|
|
1178
|
+
'div',
|
|
1179
|
+
{ className: 'pm-rest' },
|
|
1180
|
+
h('div', { className: 'pm-rest-head' }, `还有 ${rest.length} 件在等你`),
|
|
1181
|
+
h('div', { className: 'pm-list' }, ...rows(rest)),
|
|
1182
|
+
)
|
|
1183
|
+
: null,
|
|
1184
|
+
);
|
|
1185
|
+
} else if (view === 'waiting') {
|
|
1186
|
+
content = h(
|
|
1187
|
+
Section,
|
|
1188
|
+
{ title: '在等条件', count: current.length, hint: VIEWS[1].hint },
|
|
1189
|
+
h('div', { className: 'pm-list' }, ...rows(current)),
|
|
1190
|
+
);
|
|
1191
|
+
} else if (view === 'later') {
|
|
1192
|
+
const scheduled = current.filter((plan) => plan.review_at);
|
|
1193
|
+
const backlog = current.filter((plan) => !plan.review_at);
|
|
1194
|
+
content = h(
|
|
1195
|
+
Section,
|
|
1196
|
+
{ title: '找时间做', count: current.length, hint: VIEWS[2].hint },
|
|
1197
|
+
scheduled.length ? h(SubGroup, { label: '排上了', count: scheduled.length }, ...rows(scheduled)) : null,
|
|
1198
|
+
backlog.length ? h(SubGroup, { label: '先记着', count: backlog.length }, ...rows(backlog)) : null,
|
|
1199
|
+
);
|
|
1200
|
+
} else {
|
|
1201
|
+
content = h(
|
|
1202
|
+
Section,
|
|
1203
|
+
{ title: '已结束', count: current.length, hint: VIEWS[3].hint },
|
|
1204
|
+
groups.done.length
|
|
1205
|
+
? h(SubGroup, { label: '做完了', count: groups.done.length }, ...rows(groups.done))
|
|
1206
|
+
: null,
|
|
1207
|
+
groups.dropped.length
|
|
1208
|
+
? h(SubGroup, { label: '不做了', count: groups.dropped.length }, ...rows(groups.dropped))
|
|
1209
|
+
: null,
|
|
1210
|
+
);
|
|
604
1211
|
}
|
|
605
1212
|
|
|
1213
|
+
const showBrief = !searching && summary && counts.now + counts.waiting + counts.later > 0;
|
|
1214
|
+
const headline = counts.now > 0 ? `今天有 ${counts.now} 件在等你` : counts.waiting > 0 ? '现在没有在等你的' : '可以喘口气';
|
|
1215
|
+
const subline =
|
|
1216
|
+
counts.now > 0
|
|
1217
|
+
? '处理完一件,下一件会自动顶上来。'
|
|
1218
|
+
: counts.waiting + counts.later > 0
|
|
1219
|
+
? `还有 ${counts.waiting} 件在等条件、${counts.later} 件先记着,不着急。`
|
|
1220
|
+
: '';
|
|
1221
|
+
|
|
606
1222
|
return h(
|
|
607
1223
|
'div',
|
|
608
1224
|
{ className: 'pm-shell' },
|
|
@@ -616,48 +1232,69 @@ window.__ModuleLoader__.load({
|
|
|
616
1232
|
h(
|
|
617
1233
|
'div',
|
|
618
1234
|
{ className: 'pm-brand' },
|
|
619
|
-
h('div', { className: 'pm-logo' }, h(BookmarkIcon, { size:
|
|
1235
|
+
h('div', { className: 'pm-logo' }, h(BookmarkIcon, { size: 22 })),
|
|
620
1236
|
h(
|
|
621
1237
|
'div',
|
|
622
1238
|
null,
|
|
623
1239
|
h('h1', null, '续忆'),
|
|
624
|
-
h('p', null, '
|
|
1240
|
+
h('p', null, '把推迟的事放在这,到点再回来看'),
|
|
625
1241
|
),
|
|
626
1242
|
),
|
|
627
1243
|
h(
|
|
628
1244
|
'div',
|
|
629
1245
|
{ className: 'pm-header-actions' },
|
|
630
1246
|
h('button', { className: 'pm-btn pm-btn-ghost pm-refresh', onClick: load, title: '刷新' }, h(RefreshIcon)),
|
|
631
|
-
h('button', { className: 'pm-btn pm-btn-primary', onClick: () => setCreating(true) }, h(PlusIcon), '
|
|
1247
|
+
h('button', { className: 'pm-btn pm-btn-primary', onClick: () => setCreating(true) }, h(PlusIcon), '记一件'),
|
|
632
1248
|
),
|
|
633
1249
|
),
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
1250
|
+
showBrief
|
|
1251
|
+
? h(
|
|
1252
|
+
'div',
|
|
1253
|
+
{ className: 'pm-brief' },
|
|
1254
|
+
h(
|
|
1255
|
+
'div',
|
|
1256
|
+
{ className: 'pm-brief-main' },
|
|
1257
|
+
h('span', { className: `pm-brief-dot${counts.now > 0 ? '' : ' pm-brief-dot-ok'}` }),
|
|
1258
|
+
h(
|
|
1259
|
+
'div',
|
|
1260
|
+
null,
|
|
1261
|
+
h('h2', { className: 'pm-brief-title' }, headline),
|
|
1262
|
+
subline ? h('p', { className: 'pm-brief-desc' }, subline) : null,
|
|
1263
|
+
),
|
|
1264
|
+
),
|
|
1265
|
+
h(
|
|
1266
|
+
'div',
|
|
1267
|
+
{ className: 'pm-brief-side' },
|
|
1268
|
+
doneThisWeek > 0 ? h('span', { className: 'pm-week' }, `本周做完 ${doneThisWeek} 件`) : null,
|
|
1269
|
+
),
|
|
1270
|
+
)
|
|
1271
|
+
: null,
|
|
1272
|
+
error
|
|
1273
|
+
? h('div', { className: 'pm-error' }, error, h('button', { className: 'pm-btn pm-btn-ghost pm-btn-sm', onClick: load }, '重试'))
|
|
1274
|
+
: null,
|
|
642
1275
|
h(
|
|
643
1276
|
'div',
|
|
644
1277
|
{ className: 'pm-toolbar' },
|
|
645
|
-
|
|
646
|
-
'div',
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
1278
|
+
searching
|
|
1279
|
+
? h('div', { className: 'pm-toolbar-note' }, `搜索「${query.trim()}」`)
|
|
1280
|
+
: h(
|
|
1281
|
+
'div',
|
|
1282
|
+
{ className: 'pm-views', role: 'tablist', 'aria-label': '待办分组' },
|
|
1283
|
+
...VIEWS.map((item) =>
|
|
1284
|
+
h(
|
|
1285
|
+
'button',
|
|
1286
|
+
{
|
|
1287
|
+
key: item.id,
|
|
1288
|
+
role: 'tab',
|
|
1289
|
+
'aria-selected': view === item.id,
|
|
1290
|
+
className: `pm-view${view === item.id ? ' pm-view-active' : ''}${item.id === 'now' && counts.now > 0 ? ' pm-view-alert' : ''}`,
|
|
1291
|
+
onClick: () => setView(item.id),
|
|
1292
|
+
},
|
|
1293
|
+
item.label,
|
|
1294
|
+
counts[item.id] ? h('span', { className: 'pm-view-count' }, counts[item.id]) : null,
|
|
1295
|
+
),
|
|
1296
|
+
),
|
|
1297
|
+
),
|
|
661
1298
|
h(
|
|
662
1299
|
'div',
|
|
663
1300
|
{ className: 'pm-filters' },
|
|
@@ -667,84 +1304,40 @@ window.__ModuleLoader__.load({
|
|
|
667
1304
|
h(SearchIcon),
|
|
668
1305
|
h('input', {
|
|
669
1306
|
value: query,
|
|
670
|
-
placeholder: '
|
|
1307
|
+
placeholder: '搜一下记过的…',
|
|
1308
|
+
'aria-label': '搜索计划',
|
|
671
1309
|
onChange: (event) => setQuery(event.target.value),
|
|
672
1310
|
}),
|
|
1311
|
+
query
|
|
1312
|
+
? h(
|
|
1313
|
+
'button',
|
|
1314
|
+
{ className: 'pm-search-clear', onClick: () => setQuery(''), title: '清空搜索', type: 'button' },
|
|
1315
|
+
h(CloseIcon, { size: 12 }),
|
|
1316
|
+
)
|
|
1317
|
+
: null,
|
|
673
1318
|
),
|
|
674
|
-
|
|
675
|
-
'select',
|
|
676
|
-
{ value: project, onChange: (event) => setProject(event.target.value), 'aria-label': '按项目筛选' },
|
|
677
|
-
h('option', { value: '' }, '所有项目'),
|
|
678
|
-
...projects.map((item) => h('option', { value: item.id, key: item.id }, item.name)),
|
|
679
|
-
),
|
|
680
|
-
tab === 'all'
|
|
1319
|
+
projects.length > 0
|
|
681
1320
|
? h(
|
|
682
1321
|
'select',
|
|
683
|
-
{ value:
|
|
684
|
-
h('option', { value: '' }, '
|
|
685
|
-
...
|
|
686
|
-
h('option', { value: 'done' }, '已完成'),
|
|
687
|
-
h('option', { value: 'dropped' }, '已放弃'),
|
|
1322
|
+
{ value: project, onChange: (event) => setProject(event.target.value), 'aria-label': '按项目筛选' },
|
|
1323
|
+
h('option', { value: '' }, '所有项目'),
|
|
1324
|
+
...projects.map((item) => h('option', { value: item.id, key: item.id }, item.name)),
|
|
688
1325
|
)
|
|
689
1326
|
: null,
|
|
690
|
-
h(
|
|
691
|
-
'label',
|
|
692
|
-
{ className: 'pm-check' },
|
|
693
|
-
h('input', { type: 'checkbox', checked: showClosed, onChange: (event) => setShowClosed(event.target.checked) }),
|
|
694
|
-
'含已结束',
|
|
695
|
-
),
|
|
696
1327
|
),
|
|
697
1328
|
),
|
|
698
|
-
|
|
699
|
-
? h('div', { className: 'pm-error' }, error, h('button', { className: 'pm-btn pm-btn-ghost', onClick: load }, '重试'))
|
|
700
|
-
: null,
|
|
701
|
-
loading && !summary
|
|
702
|
-
? h(
|
|
703
|
-
'div',
|
|
704
|
-
{ className: 'pm-skeleton-list' },
|
|
705
|
-
...[0, 1, 2].map((index) => h('div', { className: 'pm-skeleton', key: index })),
|
|
706
|
-
)
|
|
707
|
-
: null,
|
|
708
|
-
!loading && plans.length === 0
|
|
709
|
-
? h(Empty, {
|
|
710
|
-
title: tab === 'review' ? '现在没有等你回来的计划' : '这里还是空的',
|
|
711
|
-
description:
|
|
712
|
-
tab === 'review'
|
|
713
|
-
? '当有到期、或者太久没看的计划时,它们会出现在这里。你也可以主动记下一个。'
|
|
714
|
-
: '把一件现在做不了、但以后要接着做的事记下来,比靠记忆靠谱。',
|
|
715
|
-
onAction: () => setCreating(true),
|
|
716
|
-
actionLabel: '记一个计划',
|
|
717
|
-
})
|
|
718
|
-
: null,
|
|
719
|
-
h(
|
|
720
|
-
'div',
|
|
721
|
-
{ className: 'pm-list' },
|
|
722
|
-
...plans.map((plan) =>
|
|
723
|
-
h(PlanCard, {
|
|
724
|
-
key: plan.id,
|
|
725
|
-
plan,
|
|
726
|
-
onOpen: setSelected,
|
|
727
|
-
onDone: (item) => mutate(item, 'done'),
|
|
728
|
-
onSnooze: (item) => mutate(item, 'snooze', 7),
|
|
729
|
-
onDrop: (item) => mutate(item, 'drop'),
|
|
730
|
-
}),
|
|
731
|
-
),
|
|
732
|
-
),
|
|
733
|
-
plans.length > 0
|
|
734
|
-
? h(
|
|
735
|
-
'div',
|
|
736
|
-
{ className: 'pm-list-foot' },
|
|
737
|
-
`显示 ${plans.length} / ${total} 条`,
|
|
738
|
-
tab === 'review' ? ' · 按到期与优先级排序' : ' · 最近更新的在前',
|
|
739
|
-
)
|
|
740
|
-
: null,
|
|
1329
|
+
content,
|
|
741
1330
|
),
|
|
742
1331
|
selected
|
|
743
1332
|
? h(DetailModal, {
|
|
744
1333
|
plan: selected,
|
|
745
1334
|
onClose: () => setSelected(null),
|
|
746
|
-
|
|
1335
|
+
onAct: act,
|
|
747
1336
|
notify,
|
|
1337
|
+
onSaved: async () => {
|
|
1338
|
+
setSelected(null);
|
|
1339
|
+
await load();
|
|
1340
|
+
},
|
|
748
1341
|
})
|
|
749
1342
|
: null,
|
|
750
1343
|
creating
|
|
@@ -759,7 +1352,7 @@ window.__ModuleLoader__.load({
|
|
|
759
1352
|
notify,
|
|
760
1353
|
})
|
|
761
1354
|
: null,
|
|
762
|
-
h(Toast, {
|
|
1355
|
+
h(Toast, { toast, onDismiss: dismissToast }),
|
|
763
1356
|
);
|
|
764
1357
|
}
|
|
765
1358
|
|
|
@@ -868,13 +1461,13 @@ window.__ModuleLoader__.load({
|
|
|
868
1461
|
{ className: 'pm-settings' },
|
|
869
1462
|
h('style', null, CSS),
|
|
870
1463
|
h('h3', null, '续忆'),
|
|
871
|
-
h('p', { className: 'pm-muted' }, '
|
|
1464
|
+
h('p', { className: 'pm-muted' }, '跨会话保存延后计划。到点了会回到「轮到你」,不用靠记忆。数据只在本机 DSH 的独立数据域中。'),
|
|
872
1465
|
data
|
|
873
1466
|
? h(
|
|
874
1467
|
'div',
|
|
875
1468
|
{ className: 'pm-settings-grid' },
|
|
876
1469
|
h('div', null, h('strong', null, data.stats.open), h('span', null, '进行中')),
|
|
877
|
-
h('div', null, h('strong', null, data.stats.due), h('span', null, '
|
|
1470
|
+
h('div', null, h('strong', null, data.stats.due), h('span', null, '轮到你')),
|
|
878
1471
|
h('div', null, h('strong', null, data.stats.projects), h('span', null, '项目')),
|
|
879
1472
|
)
|
|
880
1473
|
: null,
|
|
@@ -988,130 +1581,202 @@ window.__ModuleLoader__.load({
|
|
|
988
1581
|
}
|
|
989
1582
|
|
|
990
1583
|
const CSS = `
|
|
991
|
-
.pm-shell
|
|
1584
|
+
.pm-shell, .pm-settings {
|
|
1585
|
+
--pm-warn: color-mix(in srgb, var(--dsw-alias-state-warn-primary) 66%, var(--dsw-alias-label-primary));
|
|
1586
|
+
--pm-warn-tint: color-mix(in srgb, var(--dsw-alias-state-warn-primary) 10%, transparent);
|
|
1587
|
+
--pm-ok: color-mix(in srgb, var(--dsw-alias-state-success-primary) 62%, var(--dsw-alias-label-primary));
|
|
1588
|
+
--pm-ok-tint: color-mix(in srgb, var(--dsw-alias-state-success-primary) 12%, transparent);
|
|
1589
|
+
--pm-wait: color-mix(in srgb, var(--dsw-alias-state-business-primary) 72%, var(--dsw-alias-label-primary));
|
|
1590
|
+
--pm-wait-tint: color-mix(in srgb, var(--dsw-alias-state-business-primary) 10%, transparent);
|
|
1591
|
+
--pm-muted: var(--dsw-alias-label-secondary);
|
|
1592
|
+
--pm-faint: var(--dsw-alias-label-tertiary);
|
|
1593
|
+
}
|
|
1594
|
+
.pm-shell { min-height: 100%; height: 100%; overflow: auto; background: var(--dsw-alias-bg-base); color: var(--dsw-alias-label-primary); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif; -webkit-font-smoothing: antialiased; font-size: 14px; }
|
|
992
1595
|
.pm-shell *, .pm-settings * { box-sizing: border-box; }
|
|
993
|
-
.pm-wrap { width: min(
|
|
994
|
-
.pm-header { display: flex; align-items: center; justify-content: space-between; gap:
|
|
995
|
-
.pm-brand { display: flex; align-items: center; gap:
|
|
996
|
-
.pm-logo { width:
|
|
997
|
-
.pm-brand h1 { margin: 0; font-size:
|
|
998
|
-
.pm-brand p { margin:
|
|
999
|
-
.pm-header-actions { display: flex; align-items: center; gap:
|
|
1000
|
-
.pm-btn { appearance: none; border: 1px solid transparent; border-radius: 10px; min-height:
|
|
1596
|
+
.pm-wrap { width: min(880px, 100%); margin: 0 auto; padding: 30px 30px 80px; }
|
|
1597
|
+
.pm-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
|
|
1598
|
+
.pm-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
|
|
1599
|
+
.pm-logo { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: var(--dsw-alias-label-primary); background: var(--dsw-alias-bg-layer-1); border: 1px solid var(--dsw-alias-border-l2); flex: none; }
|
|
1600
|
+
.pm-brand h1 { margin: 0; font-size: 21px; line-height: 1.2; letter-spacing: .005em; }
|
|
1601
|
+
.pm-brand p { margin: 3px 0 0; color: var(--pm-muted); font-size: 12px; }
|
|
1602
|
+
.pm-header-actions { display: flex; align-items: center; gap: 7px; }
|
|
1603
|
+
.pm-btn { appearance: none; border: 1px solid transparent; border-radius: 10px; min-height: 34px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: 12.5px; font-weight: 620; cursor: pointer; color: var(--dsw-alias-label-primary); background: transparent; transition: background .15s ease, border-color .15s ease, opacity .15s ease, transform .15s ease; white-space: nowrap; }
|
|
1001
1604
|
.pm-btn:hover { background: var(--dsw-alias-bg-layer-2); }
|
|
1002
1605
|
.pm-btn:active { transform: translateY(1px); }
|
|
1003
|
-
.pm-btn:disabled { opacity: .
|
|
1004
|
-
.pm-btn-
|
|
1005
|
-
.pm-btn-primary
|
|
1606
|
+
.pm-btn:disabled { opacity: .5; cursor: default; }
|
|
1607
|
+
.pm-btn:focus-visible, .pm-view:focus-visible, .pm-check:focus-visible, .pm-text-btn:focus-visible, .pm-item:focus-visible, .pm-quick-btn:focus-visible, .pm-toast-action:focus-visible, .pm-icon-btn:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary); outline-offset: 2px; }
|
|
1608
|
+
.pm-btn-primary { background: var(--dsw-alias-label-primary); color: var(--dsw-alias-bg-base); border-color: var(--dsw-alias-label-primary); }
|
|
1609
|
+
.pm-btn-primary:hover { background: color-mix(in srgb, var(--dsw-alias-label-primary) 88%, var(--dsw-alias-state-business-primary)); }
|
|
1006
1610
|
.pm-btn-ghost { border-color: var(--dsw-alias-border-l1); background: var(--dsw-alias-bg-layer-1); }
|
|
1007
|
-
.pm-btn-ghost:hover { border-color: var(--dsw-alias-border-l2); }
|
|
1008
|
-
.pm-
|
|
1009
|
-
.pm-
|
|
1010
|
-
.pm-
|
|
1011
|
-
.pm-
|
|
1012
|
-
.pm-
|
|
1013
|
-
.pm-
|
|
1014
|
-
.pm-
|
|
1015
|
-
.pm-
|
|
1016
|
-
.pm-
|
|
1017
|
-
.pm-
|
|
1018
|
-
.pm-
|
|
1019
|
-
.pm-tab { appearance: none; border: 0; background: transparent; color: var(--dsw-alias-label-secondary); font: inherit; font-size: 13px; font-weight: 600; border-radius: 8px; padding: 7px 11px; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
|
|
1020
|
-
.pm-tab:hover { color: var(--dsw-alias-label-primary); }
|
|
1021
|
-
.pm-tab-active { background: var(--dsw-alias-bg-base); color: var(--dsw-alias-label-primary); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
|
|
1022
|
-
.pm-tab-count { font-size: 11px; padding: 1px 6px; border-radius: 99px; background: var(--dsw-alias-bg-layer-2); color: var(--dsw-alias-label-secondary); }
|
|
1023
|
-
.pm-tab-active .pm-tab-count { background: color-mix(in srgb, var(--dsw-alias-brand-primary) 12%, transparent); color: var(--dsw-alias-label-primary); }
|
|
1024
|
-
.pm-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
|
|
1025
|
-
.pm-search { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 10px; border: 1px solid var(--dsw-alias-border-l1); border-radius: 10px; color: var(--dsw-alias-label-secondary); background: var(--dsw-alias-bg-layer-1); }
|
|
1026
|
-
.pm-search:focus-within { border-color: var(--dsw-alias-brand-primary); }
|
|
1027
|
-
.pm-search input { width: 190px; border: 0; outline: 0; background: transparent; color: var(--dsw-alias-label-primary); font: inherit; font-size: 13px; }
|
|
1028
|
-
.pm-search input::placeholder { color: var(--dsw-alias-label-secondary); opacity: .8; }
|
|
1029
|
-
.pm-filters select { height: 36px; max-width: 150px; padding: 0 9px; border: 1px solid var(--dsw-alias-border-l1); border-radius: 10px; background: var(--dsw-alias-bg-layer-1); color: var(--dsw-alias-label-primary); font: inherit; font-size: 12.5px; }
|
|
1030
|
-
.pm-check { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--dsw-alias-label-secondary); user-select: none; }
|
|
1031
|
-
.pm-check input { accent-color: var(--dsw-alias-brand-primary); }
|
|
1032
|
-
.pm-list { display: flex; flex-direction: column; gap: 9px; }
|
|
1033
|
-
.pm-card { position: relative; border: 1px solid var(--dsw-alias-border-l1); background: var(--dsw-alias-bg-layer-1); border-radius: 14px; padding: 15px 16px 12px; cursor: pointer; outline: none; transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease; }
|
|
1034
|
-
.pm-card:hover, .pm-card:focus-visible { border-color: var(--dsw-alias-border-l2); transform: translateY(-1px); box-shadow: 0 7px 20px rgba(0,0,0,.06); }
|
|
1035
|
-
.pm-card-overdue { border-left: 3px solid var(--dsw-alias-state-warn-primary); padding-left: 14px; }
|
|
1036
|
-
.pm-card-head { display: flex; align-items: center; gap: 9px; padding-right: 2px; }
|
|
1037
|
-
.pm-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--dsw-alias-state-idle-primary); }
|
|
1038
|
-
.pm-dot-blocked { background: var(--dsw-alias-state-warn-primary); }
|
|
1039
|
-
.pm-dot-planned { background: var(--dsw-alias-brand-primary); }
|
|
1040
|
-
.pm-dot-done { background: var(--dsw-alias-state-success-primary); }
|
|
1041
|
-
.pm-dot-dropped { background: var(--dsw-alias-state-idle-primary); }
|
|
1042
|
-
.pm-card-title { margin: 0; font-size: 14.5px; font-weight: 660; line-height: 1.45; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1043
|
-
.pm-prio { flex: none; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 6px; color: var(--dsw-alias-label-secondary); background: var(--dsw-alias-bg-layer-2); }
|
|
1044
|
-
.pm-prio-high { color: var(--dsw-alias-state-error-primary); background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 10%, transparent); }
|
|
1045
|
-
.pm-prio-medium { color: var(--dsw-alias-state-warn-primary); background: color-mix(in srgb, var(--dsw-alias-state-warn-primary) 10%, transparent); }
|
|
1046
|
-
.pm-card-detail { margin: 8px 0 0 16px; color: var(--dsw-alias-label-secondary); font-size: 12.5px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
|
|
1047
|
-
.pm-conditions { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin: 9px 0 0 16px; }
|
|
1048
|
-
.pm-conditions-label { font-size: 10.5px; color: var(--dsw-alias-label-secondary); }
|
|
1049
|
-
.pm-chip { font-size: 10.5px; color: var(--dsw-alias-label-secondary); background: var(--dsw-alias-bg-layer-2); border: 1px solid var(--dsw-alias-border-l1); border-radius: 6px; padding: 2px 6px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1050
|
-
.pm-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--dsw-alias-border-l1); }
|
|
1051
|
-
.pm-meta { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--dsw-alias-label-secondary); font-size: 11.5px; }
|
|
1052
|
-
.pm-project { color: var(--dsw-alias-label-secondary); background: var(--dsw-alias-bg-layer-2); padding: 2px 7px; border-radius: 5px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1053
|
-
.pm-due { color: var(--dsw-alias-state-warn-primary); font-weight: 650; }
|
|
1054
|
-
.pm-muted { color: var(--dsw-alias-label-secondary); }
|
|
1055
|
-
.pm-card-actions { display: flex; align-items: center; gap: 2px; opacity: .2; transition: opacity .16s ease; }
|
|
1056
|
-
.pm-card:hover .pm-card-actions, .pm-card:focus-within .pm-card-actions { opacity: 1; }
|
|
1057
|
-
.pm-icon-btn { appearance: none; border: 0; background: transparent; color: var(--dsw-alias-label-secondary); width: 28px; height: 28px; border-radius: 8px; display: inline-grid; place-items: center; cursor: pointer; }
|
|
1611
|
+
.pm-btn-ghost:hover { border-color: var(--dsw-alias-border-l2); background: var(--dsw-alias-bg-layer-2); }
|
|
1612
|
+
.pm-btn-quiet { color: var(--pm-muted); }
|
|
1613
|
+
.pm-btn-quiet:hover { color: var(--dsw-alias-label-primary); }
|
|
1614
|
+
.pm-btn-done { background: var(--pm-ok-tint); border-color: color-mix(in srgb, var(--dsw-alias-state-success-primary) 30%, var(--dsw-alias-border-l1)); color: var(--pm-ok); }
|
|
1615
|
+
.pm-btn-done:hover { background: color-mix(in srgb, var(--dsw-alias-state-success-primary) 17%, var(--dsw-alias-bg-layer-1)); }
|
|
1616
|
+
.pm-btn-danger { color: var(--dsw-alias-state-error-primary); border-color: color-mix(in srgb, var(--dsw-alias-state-error-primary) 26%, var(--dsw-alias-border-l1)); background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 7%, var(--dsw-alias-bg-layer-1)); }
|
|
1617
|
+
.pm-btn-danger:hover { background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 13%, var(--dsw-alias-bg-layer-1)); }
|
|
1618
|
+
.pm-btn-sm { min-height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
|
|
1619
|
+
.pm-seg-note { margin: -8px 0 4px; font-size: 11.5px; line-height: 1.6; color: var(--pm-warn); }
|
|
1620
|
+
.pm-seg-note-muted { color: var(--pm-muted); }
|
|
1621
|
+
.pm-refresh { width: 34px; padding: 0; color: var(--pm-muted); }
|
|
1622
|
+
.pm-icon-btn { appearance: none; border: 0; background: transparent; color: var(--pm-muted); width: 28px; height: 28px; border-radius: 8px; display: inline-grid; place-items: center; cursor: pointer; flex: none; }
|
|
1058
1623
|
.pm-icon-btn:hover { background: var(--dsw-alias-bg-layer-2); color: var(--dsw-alias-label-primary); }
|
|
1059
|
-
.pm-
|
|
1060
|
-
.pm-
|
|
1061
|
-
.pm-
|
|
1624
|
+
.pm-brief { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; border: 1px solid var(--dsw-alias-border-l1); background: var(--dsw-alias-bg-layer-1); border-radius: 15px; padding: 14px 16px; margin-bottom: 14px; }
|
|
1625
|
+
.pm-brief-main { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
|
|
1626
|
+
.pm-brief-dot { flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--pm-warn); box-shadow: 0 0 0 4px var(--pm-warn-tint); }
|
|
1627
|
+
.pm-brief-dot-ok { background: var(--pm-ok); box-shadow: 0 0 0 4px var(--pm-ok-tint); }
|
|
1628
|
+
.pm-brief-title { margin: 0; font-size: 14.5px; font-weight: 680; }
|
|
1629
|
+
.pm-brief-desc { margin: 3px 0 0; font-size: 12px; color: var(--pm-muted); line-height: 1.5; }
|
|
1630
|
+
.pm-brief-side { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--pm-muted); }
|
|
1631
|
+
.pm-week { padding: 3px 8px; border-radius: 99px; background: var(--pm-ok-tint); color: var(--pm-ok); font-weight: 650; }
|
|
1632
|
+
.pm-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
|
|
1633
|
+
.pm-views { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--dsw-alias-bg-layer-1); border: 1px solid var(--dsw-alias-border-l1); }
|
|
1634
|
+
.pm-view { appearance: none; border: 0; background: transparent; color: var(--pm-muted); font: inherit; font-size: 12.5px; font-weight: 620; padding: 6px 10px; border-radius: 8px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; transition: color .15s ease, background .15s ease; }
|
|
1635
|
+
.pm-view:hover { color: var(--dsw-alias-label-primary); }
|
|
1636
|
+
.pm-view-active { background: var(--dsw-alias-bg-base); color: var(--dsw-alias-label-primary); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
|
|
1637
|
+
.pm-view-alert { color: var(--pm-warn); }
|
|
1638
|
+
.pm-view-alert.pm-view-active { color: var(--dsw-alias-label-primary); }
|
|
1639
|
+
.pm-view-count { font-size: 10.5px; font-weight: 650; min-width: 17px; text-align: center; padding: 1px 5px; border-radius: 99px; background: var(--dsw-alias-bg-layer-2); color: var(--pm-muted); }
|
|
1640
|
+
.pm-view-active .pm-view-count { background: color-mix(in srgb, var(--dsw-alias-label-primary) 9%, transparent); color: var(--dsw-alias-label-primary); }
|
|
1641
|
+
.pm-view-alert .pm-view-count { background: var(--pm-warn-tint); color: var(--pm-warn); }
|
|
1642
|
+
.pm-toolbar-note { font-size: 12px; color: var(--pm-muted); padding-left: 2px; }
|
|
1643
|
+
.pm-filters { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
|
|
1644
|
+
.pm-search { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 9px; border: 1px solid var(--dsw-alias-border-l1); border-radius: 9px; color: var(--pm-faint); background: var(--dsw-alias-bg-layer-1); }
|
|
1645
|
+
.pm-search:focus-within { border-color: var(--dsw-alias-border-l2); }
|
|
1646
|
+
.pm-search input { width: 168px; border: 0; outline: 0; background: transparent; color: var(--dsw-alias-label-primary); font: inherit; font-size: 12.5px; }
|
|
1647
|
+
.pm-search input::placeholder { color: var(--pm-faint); }
|
|
1648
|
+
.pm-search-clear { appearance: none; border: 0; background: transparent; color: var(--pm-faint); cursor: pointer; padding: 2px; display: grid; place-items: center; border-radius: 4px; }
|
|
1649
|
+
.pm-search-clear:hover { color: var(--dsw-alias-label-primary); background: var(--dsw-alias-bg-layer-2); }
|
|
1650
|
+
.pm-filters select { height: 34px; max-width: 140px; padding: 0 8px; border: 1px solid var(--dsw-alias-border-l1); border-radius: 9px; background: var(--dsw-alias-bg-layer-1); color: var(--dsw-alias-label-primary); font: inherit; font-size: 12px; }
|
|
1651
|
+
.pm-section { animation: pmIn .16s ease; }
|
|
1652
|
+
@keyframes pmIn { from { opacity: 0; } to { opacity: 1; } }
|
|
1653
|
+
.pm-section-head { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; margin: 2px 2px 10px; }
|
|
1654
|
+
.pm-section-head h2 { margin: 0; font-size: 12.5px; font-weight: 700; letter-spacing: .04em; color: var(--pm-muted); display: inline-flex; align-items: center; gap: 6px; }
|
|
1655
|
+
.pm-section-count { font-size: 10.5px; font-weight: 650; color: var(--pm-faint); background: var(--dsw-alias-bg-layer-2); border-radius: 99px; padding: 1px 6px; letter-spacing: 0; }
|
|
1656
|
+
.pm-section-hint { margin: 0; font-size: 11.5px; color: var(--pm-faint); }
|
|
1657
|
+
.pm-focus { position: relative; overflow: hidden; border: 1px solid color-mix(in srgb, var(--dsw-alias-state-warn-primary) 26%, var(--dsw-alias-border-l1)); border-radius: 17px; padding: 16px 18px 14px; background: linear-gradient(180deg, color-mix(in srgb, var(--dsw-alias-state-warn-primary) 5%, var(--dsw-alias-bg-layer-1)), var(--dsw-alias-bg-layer-1) 70%); margin-bottom: 10px; }
|
|
1658
|
+
.pm-focus-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11.5px; }
|
|
1659
|
+
.pm-focus-kicker { color: var(--pm-warn); font-weight: 680; }
|
|
1660
|
+
.pm-focus-when { color: var(--pm-faint); }
|
|
1661
|
+
.pm-focus-title { margin: 7px 0 0; font-size: 18px; line-height: 1.4; font-weight: 700; letter-spacing: -.005em; }
|
|
1662
|
+
.pm-focus-detail { margin: 7px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--pm-muted); }
|
|
1663
|
+
.pm-focus-why { margin: 6px 0 0; font-size: 12px; line-height: 1.55; color: var(--pm-muted); }
|
|
1664
|
+
.pm-focus-why span { color: var(--pm-faint); }
|
|
1665
|
+
.pm-focus-wait { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
|
|
1666
|
+
.pm-focus-ask { margin: 13px 0 8px; font-size: 11.5px; color: var(--pm-faint); }
|
|
1667
|
+
.pm-focus-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
|
|
1668
|
+
.pm-rest { margin-top: 16px; }
|
|
1669
|
+
.pm-rest-head { font-size: 11.5px; color: var(--pm-faint); margin: 0 2px 8px; }
|
|
1670
|
+
.pm-list { display: flex; flex-direction: column; gap: 7px; }
|
|
1671
|
+
.pm-item { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--dsw-alias-border-l1); background: var(--dsw-alias-bg-layer-1); border-radius: 13px; padding: 11px 13px 10px; cursor: pointer; outline: none; transition: border-color .15s ease, background .15s ease; }
|
|
1672
|
+
.pm-item:hover { border-color: var(--dsw-alias-border-l2); background: var(--dsw-alias-bg-layer-2); }
|
|
1673
|
+
.pm-item-closed { background: color-mix(in srgb, var(--dsw-alias-bg-layer-1) 55%, transparent); }
|
|
1674
|
+
.pm-check { flex: none; width: 20px; height: 20px; margin-top: 2px; padding: 0; border: 1.6px solid var(--pm-faint); border-radius: 50%; background: transparent; color: transparent; display: grid; place-items: center; cursor: pointer; transition: border-color .15s ease, color .15s ease, background .15s ease; }
|
|
1675
|
+
.pm-check:hover { border-color: var(--pm-ok); color: color-mix(in srgb, var(--pm-ok) 45%, transparent); background: transparent; }
|
|
1676
|
+
.pm-item-mark { flex: none; width: 20px; height: 20px; margin-top: 2px; border-radius: 50%; display: grid; place-items: center; background: var(--dsw-alias-bg-layer-2); color: var(--pm-faint); }
|
|
1677
|
+
.pm-item-mark-done { background: var(--pm-ok-tint); color: var(--pm-ok); }
|
|
1678
|
+
.pm-item-mark-dash { width: 8px; height: 1.6px; background: var(--pm-faint); border-radius: 2px; }
|
|
1679
|
+
.pm-item-body { flex: 1; min-width: 0; }
|
|
1680
|
+
.pm-item-head { display: flex; align-items: center; gap: 7px; }
|
|
1681
|
+
.pm-item-title { margin: 0; flex: 1; min-width: 0; font-size: 13.5px; font-weight: 650; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1682
|
+
.pm-item-closed .pm-item-title { font-weight: 600; color: var(--pm-muted); }
|
|
1683
|
+
.pm-flag { flex: none; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 5px; color: var(--dsw-alias-state-error-primary); background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 9%, transparent); }
|
|
1684
|
+
.pm-state { flex: none; font-size: 10.5px; font-weight: 650; padding: 2px 7px; border-radius: 6px; white-space: nowrap; }
|
|
1685
|
+
.pm-state-warn { color: var(--pm-warn); background: var(--pm-warn-tint); }
|
|
1686
|
+
.pm-state-wait { color: var(--pm-wait); background: var(--pm-wait-tint); }
|
|
1687
|
+
.pm-state-done { color: var(--pm-ok); background: var(--pm-ok-tint); }
|
|
1688
|
+
.pm-state-plan, .pm-state-idle { color: var(--pm-muted); background: var(--dsw-alias-bg-layer-2); }
|
|
1689
|
+
.pm-state-muted { color: var(--pm-faint); border: 1px solid var(--dsw-alias-border-l1); }
|
|
1690
|
+
.pm-item-detail { margin: 3px 0 0; font-size: 11.5px; line-height: 1.55; color: var(--pm-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1691
|
+
.pm-wait { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
|
|
1692
|
+
.pm-wait-label { font-size: 10.5px; color: var(--pm-faint); }
|
|
1693
|
+
.pm-chip { font-size: 10.5px; color: var(--pm-muted); background: var(--dsw-alias-bg-layer-2); border: 1px solid var(--dsw-alias-border-l1); border-radius: 6px; padding: 1px 6px; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1694
|
+
.pm-item-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 7px; }
|
|
1695
|
+
.pm-item-meta { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 11px; color: var(--pm-faint); }
|
|
1696
|
+
.pm-project { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 1px 6px; border-radius: 5px; background: var(--dsw-alias-bg-layer-2); color: var(--pm-muted); }
|
|
1697
|
+
.pm-item-actions { display: flex; align-items: center; gap: 1px; opacity: .78; transition: opacity .15s ease; flex: none; }
|
|
1698
|
+
.pm-item:hover .pm-item-actions, .pm-item:focus-within .pm-item-actions { opacity: 1; }
|
|
1699
|
+
.pm-text-btn { appearance: none; border: 0; background: transparent; color: var(--pm-muted); font: inherit; font-size: 11.5px; font-weight: 620; padding: 4px 7px; border-radius: 6px; cursor: pointer; }
|
|
1700
|
+
.pm-text-btn:hover { background: var(--dsw-alias-bg-layer-1); color: var(--dsw-alias-label-primary); }
|
|
1701
|
+
.pm-item:hover .pm-text-btn:hover { background: var(--dsw-alias-bg-layer-2); }
|
|
1702
|
+
.pm-text-btn-danger:hover { color: var(--dsw-alias-state-error-primary); background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 8%, transparent); }
|
|
1703
|
+
.pm-subgroup + .pm-subgroup { margin-top: 14px; }
|
|
1704
|
+
.pm-subgroup-head { display: flex; align-items: center; gap: 6px; margin: 0 2px 7px; font-size: 11px; font-weight: 650; color: var(--pm-faint); }
|
|
1705
|
+
.pm-subgroup-count { font-size: 10px; font-weight: 650; background: var(--dsw-alias-bg-layer-2); border-radius: 99px; padding: 0 5px; }
|
|
1706
|
+
.pm-empty { border: 1px dashed var(--dsw-alias-border-l2); border-radius: 17px; padding: 40px 24px 36px; text-align: center; color: var(--pm-muted); background: color-mix(in srgb, var(--dsw-alias-bg-layer-1) 55%, transparent); }
|
|
1707
|
+
.pm-empty-mark { width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 15px; display: grid; place-items: center; background: var(--dsw-alias-bg-layer-2); color: var(--pm-faint); }
|
|
1062
1708
|
.pm-empty h3 { margin: 0 0 6px; color: var(--dsw-alias-label-primary); font-size: 15px; }
|
|
1063
|
-
.pm-empty p { margin: 0 auto 16px; max-width:
|
|
1709
|
+
.pm-empty p { margin: 0 auto 16px; max-width: 400px; font-size: 12.5px; line-height: 1.65; }
|
|
1710
|
+
.pm-empty-actions { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
|
|
1064
1711
|
.pm-error { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid color-mix(in srgb, var(--dsw-alias-state-error-primary) 35%, transparent); background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 7%, transparent); color: var(--dsw-alias-state-error-primary); border-radius: 10px; padding: 9px 12px; margin-bottom: 12px; font-size: 12.5px; }
|
|
1065
|
-
.pm-skeleton-list { display: flex; flex-direction: column; gap:
|
|
1066
|
-
.pm-skeleton { height:
|
|
1712
|
+
.pm-skeleton-list { display: flex; flex-direction: column; gap: 8px; }
|
|
1713
|
+
.pm-skeleton { height: 96px; border-radius: 13px; background: linear-gradient(90deg, var(--dsw-alias-bg-layer-1) 20%, var(--dsw-alias-bg-layer-2) 50%, var(--dsw-alias-bg-layer-1) 80%); background-size: 220% 100%; animation: pmShimmer 1.4s infinite; }
|
|
1067
1714
|
@keyframes pmShimmer { from { background-position: 180% 0; } to { background-position: -60% 0; } }
|
|
1068
|
-
.pm-
|
|
1069
|
-
.pm-overlay { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 22px; background: rgba(0,0,0,.42); backdrop-filter: blur(5px); animation: pmFade .15s ease; }
|
|
1715
|
+
.pm-overlay { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(0,0,0,.42); backdrop-filter: blur(5px); animation: pmFade .15s ease; }
|
|
1070
1716
|
@keyframes pmFade { from { opacity: 0; } to { opacity: 1; } }
|
|
1071
|
-
.pm-modal { width: min(
|
|
1072
|
-
.pm-modal-wide { width: min(
|
|
1717
|
+
.pm-modal { width: min(540px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; border: 1px solid var(--dsw-alias-border-l2); background: var(--dsw-alias-bg-overlay); color: var(--dsw-alias-label-primary); border-radius: 18px; box-shadow: 0 24px 70px rgba(0,0,0,.28); animation: pmRise .18s cubic-bezier(.2,.8,.2,1); }
|
|
1718
|
+
.pm-modal-wide { width: min(680px, 100%); }
|
|
1073
1719
|
@keyframes pmRise { from { transform: translateY(8px) scale(.99); opacity: 0; } to { transform: none; opacity: 1; } }
|
|
1074
1720
|
.pm-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 19px 20px 12px; border-bottom: 1px solid var(--dsw-alias-border-l1); }
|
|
1075
1721
|
.pm-modal-head h2 { margin: 0; font-size: 17px; }
|
|
1076
|
-
.pm-modal-head p { margin: 4px 0 0; color: var(--
|
|
1722
|
+
.pm-modal-head p { margin: 4px 0 0; color: var(--pm-muted); font-size: 12px; }
|
|
1077
1723
|
.pm-modal-body { overflow: auto; padding: 16px 20px 18px; }
|
|
1078
1724
|
.pm-modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 20px 16px; border-top: 1px solid var(--dsw-alias-border-l1); }
|
|
1079
|
-
.pm-modal-note { color: var(--
|
|
1725
|
+
.pm-modal-note { color: var(--pm-faint); font-size: 11px; }
|
|
1080
1726
|
.pm-modal-actions { display: flex; align-items: center; gap: 7px; }
|
|
1081
|
-
.pm-
|
|
1727
|
+
.pm-decision { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; border: 1px solid var(--dsw-alias-border-l1); background: var(--dsw-alias-bg-layer-1); border-radius: 11px; padding: 9px 10px; }
|
|
1728
|
+
.pm-decision-label { font-size: 11.5px; color: var(--pm-faint); margin-right: 2px; }
|
|
1729
|
+
.pm-form-grid { display: flex; flex-direction: column; gap: 12px; }
|
|
1082
1730
|
.pm-form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
|
|
1083
1731
|
.pm-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
|
|
1084
|
-
.pm-field-label { font-size: 11.5px; font-weight: 650; color: var(--
|
|
1085
|
-
.pm-field-hint { font-size: 10.5px; color: var(--
|
|
1086
|
-
.pm-field input, .pm-field textarea, .pm-field select { width: 100%; border: 1px solid var(--dsw-alias-border-l1); border-radius: 9px; background: var(--dsw-alias-bg-layer-1); color: var(--dsw-alias-label-primary); font: inherit; font-size:
|
|
1087
|
-
.pm-field textarea { resize: vertical; min-height:
|
|
1088
|
-
.pm-field input:focus, .pm-field textarea:focus, .pm-field select:focus { border-color: var(--dsw-alias-
|
|
1089
|
-
.pm-
|
|
1732
|
+
.pm-field-label { font-size: 11.5px; font-weight: 650; color: var(--pm-muted); }
|
|
1733
|
+
.pm-field-hint { font-size: 10.5px; color: var(--pm-faint); line-height: 1.45; }
|
|
1734
|
+
.pm-field input, .pm-field textarea, .pm-field select { width: 100%; border: 1px solid var(--dsw-alias-border-l1); border-radius: 9px; background: var(--dsw-alias-bg-layer-1); color: var(--dsw-alias-label-primary); font: inherit; font-size: 12.5px; padding: 7px 9px; outline: none; }
|
|
1735
|
+
.pm-field textarea { resize: vertical; min-height: 48px; line-height: 1.5; }
|
|
1736
|
+
.pm-field input:focus, .pm-field textarea:focus, .pm-field select:focus { border-color: var(--dsw-alias-border-l2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--dsw-alias-state-business-primary) 10%, transparent); }
|
|
1737
|
+
.pm-seg { display: flex; gap: 2px; padding: 3px; border-radius: 9px; background: var(--dsw-alias-bg-layer-1); border: 1px solid var(--dsw-alias-border-l1); flex-wrap: wrap; }
|
|
1738
|
+
.pm-seg-btn { appearance: none; border: 0; background: transparent; color: var(--pm-muted); font: inherit; font-size: 12px; font-weight: 620; padding: 5px 9px; border-radius: 6px; cursor: pointer; }
|
|
1739
|
+
.pm-seg-btn:hover { color: var(--dsw-alias-label-primary); }
|
|
1740
|
+
.pm-seg-btn-active { background: var(--dsw-alias-bg-base); color: var(--dsw-alias-label-primary); box-shadow: 0 1px 2px rgba(0,0,0,.1); }
|
|
1741
|
+
.pm-quick { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: -3px; }
|
|
1742
|
+
.pm-quick-btn { appearance: none; border: 1px solid var(--dsw-alias-border-l1); background: var(--dsw-alias-bg-layer-1); color: var(--pm-muted); font: inherit; font-size: 11.5px; padding: 3px 9px; border-radius: 99px; cursor: pointer; }
|
|
1743
|
+
.pm-quick-btn:hover { border-color: var(--dsw-alias-border-l2); color: var(--dsw-alias-label-primary); }
|
|
1744
|
+
.pm-quick-btn-active { color: var(--dsw-alias-label-primary); border-color: var(--dsw-alias-border-l2); }
|
|
1745
|
+
.pm-more { border-top: 1px dashed var(--dsw-alias-border-l1); padding-top: 10px; margin-top: 2px; }
|
|
1746
|
+
.pm-more summary { cursor: pointer; font-size: 11.5px; color: var(--pm-muted); list-style: none; user-select: none; }
|
|
1747
|
+
.pm-more summary::-webkit-details-marker { display: none; }
|
|
1748
|
+
.pm-more summary:hover { color: var(--dsw-alias-label-primary); }
|
|
1749
|
+
.pm-more[open] summary { margin-bottom: 10px; }
|
|
1750
|
+
.pm-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; display: flex; align-items: center; gap: 12px; background: var(--dsw-alias-bg-overlay); color: var(--dsw-alias-label-primary); border: 1px solid var(--dsw-alias-border-l2); border-radius: 11px; padding: 9px 12px 9px 14px; font-size: 12.5px; box-shadow: 0 12px 34px rgba(0,0,0,.22); animation: pmRise .18s ease; max-width: calc(100vw - 32px); }
|
|
1751
|
+
.pm-toast-text { min-width: 0; }
|
|
1752
|
+
.pm-toast-action { appearance: none; border: 0; background: transparent; color: var(--dsw-alias-link); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; padding: 2px 4px; border-radius: 5px; flex: none; }
|
|
1753
|
+
.pm-toast-action:hover { background: var(--dsw-alias-bg-layer-2); }
|
|
1754
|
+
.pm-muted { color: var(--pm-muted); }
|
|
1090
1755
|
.pm-settings { padding: 4px 0 10px; }
|
|
1091
1756
|
.pm-settings h3 { margin: 0 0 5px; font-size: 14px; }
|
|
1092
1757
|
.pm-settings p { margin: 0 0 12px; font-size: 12px; line-height: 1.6; }
|
|
1093
|
-
.pm-settings-grid { display: flex; gap: 10px; margin: 12px 0; }
|
|
1758
|
+
.pm-settings-grid { display: flex; gap: 10px; margin: 12px 0; flex-wrap: wrap; }
|
|
1094
1759
|
.pm-settings-grid > div { border: 1px solid var(--dsw-alias-border-l1); background: var(--dsw-alias-bg-layer-1); border-radius: 10px; padding: 9px 12px; min-width: 82px; display: flex; flex-direction: column; gap: 2px; }
|
|
1095
1760
|
.pm-settings-grid strong { font-size: 19px; }
|
|
1096
|
-
.pm-settings-grid span { color: var(--
|
|
1761
|
+
.pm-settings-grid span { color: var(--pm-muted); font-size: 11px; }
|
|
1097
1762
|
.pm-settings-actions { display: flex; gap: 8px; flex-wrap: wrap; }
|
|
1098
|
-
.pm-btn-danger { color: var(--dsw-alias-state-error-primary); border-color: color-mix(in srgb, var(--dsw-alias-state-error-primary) 28%, var(--dsw-alias-border-l1)); background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 8%, var(--dsw-alias-bg-layer-1)); }
|
|
1099
|
-
.pm-btn-danger:hover { background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 14%, var(--dsw-alias-bg-layer-1)); border-color: color-mix(in srgb, var(--dsw-alias-state-error-primary) 48%, var(--dsw-alias-border-l1)); }
|
|
1100
1763
|
.pm-radio { display: flex; align-items: flex-start; gap: 9px; padding: 11px 12px; border: 1px solid var(--dsw-alias-border-l1); border-radius: 10px; background: var(--dsw-alias-bg-layer-1); cursor: pointer; }
|
|
1101
1764
|
.pm-radio input { margin-top: 2px; accent-color: var(--dsw-alias-brand-primary); }
|
|
1102
1765
|
.pm-radio div { display: flex; flex-direction: column; gap: 3px; }
|
|
1103
1766
|
.pm-radio strong { font-size: 12.5px; }
|
|
1104
|
-
.pm-radio span { color: var(--
|
|
1105
|
-
@media (max-width:
|
|
1106
|
-
.pm-wrap { padding:
|
|
1107
|
-
.pm-header { align-items: flex-start; flex-direction: column; gap:
|
|
1767
|
+
.pm-radio span { color: var(--pm-muted); font-size: 11.5px; line-height: 1.5; }
|
|
1768
|
+
@media (max-width: 720px) {
|
|
1769
|
+
.pm-wrap { padding: 20px 16px 60px; }
|
|
1770
|
+
.pm-header { align-items: flex-start; flex-direction: column; gap: 12px; }
|
|
1108
1771
|
.pm-header-actions { width: 100%; justify-content: flex-end; }
|
|
1109
|
-
.pm-
|
|
1772
|
+
.pm-views { width: 100%; overflow-x: auto; }
|
|
1773
|
+
.pm-view { flex: none; }
|
|
1110
1774
|
.pm-filters { width: 100%; }
|
|
1111
|
-
.pm-search { flex: 1;
|
|
1775
|
+
.pm-search { flex: 1; }
|
|
1112
1776
|
.pm-search input { width: 100%; }
|
|
1113
|
-
.pm-
|
|
1114
|
-
.pm-
|
|
1777
|
+
.pm-item-actions { opacity: 1; }
|
|
1778
|
+
.pm-focus-title { font-size: 16.5px; }
|
|
1779
|
+
.pm-item-title { white-space: normal; }
|
|
1115
1780
|
}
|
|
1116
1781
|
`;
|
|
1117
1782
|
|