@akira-yylm/session-calendar 1.1.1 → 1.1.2
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 +6 -0
- package/README.en.md +1 -1
- package/README.md +1 -1
- package/client.js +82 -21
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.1.2
|
|
4
|
+
|
|
5
|
+
- **空状态文案跟随分组规则**:按「最近」看时,某天没有会话显示「这一天没有进行对话」;按「首次」看仍然是「这一天没有创建会话」。日期格的无障碍标签同理(「有 N 个会话进行了对话」/「创建了 N 个会话」)。
|
|
6
|
+
- **工作区分组可折叠**:每个工作区的标题行变成可点的折叠条(左侧三角随开合旋转、`aria-expanded` 同步),折叠后只留标题和条数;折叠状态会记住(同一次运行内再打开日历仍保持)。
|
|
7
|
+
- 中英两套文案同步。
|
|
8
|
+
|
|
3
9
|
## 1.1.1
|
|
4
10
|
|
|
5
11
|
- **修复:卡片头部的「‹」「›」「今天」「×」偶发点了没反应**。根因有两个:① 悬停高亮只靠 CSS `:hover`,快速划过时浏览器不一定会重绘;② 月份标题作为弹性项占掉了头部约 40% 宽度,那是一段完全不可点的宽区块,鼠标常落在上面。现在悬停改为**按指针实际位置判定**(文档级 `pointermove` + `elementFromPoint`,命中哪个控件就给哪个加 `.sc-hot`,幂等、不依赖 enter/leave 配对),并把月份标题移出控件行。
|
package/README.en.md
CHANGED
|
@@ -20,7 +20,7 @@ Clicking a row opens that session, and the switch remembers your last choice.
|
|
|
20
20
|
3. **Switching rules**: under the month title sits a full-width **First / Latest** segmented switch (about 160px per segment); it re-groups in place, the choice is remembered, and pressing the sidebar button again dismisses the card.
|
|
21
21
|
4. A day with sessions is framed in **the colours of the workspaces involved under the active rule** (solid for one, a gradient for several), with one dot per workspace below; hovering names them and their counts.
|
|
22
22
|
5. `‹` / `›` page months (landing on that month's earliest day with sessions); **Today** returns. With focus inside the card the **arrow keys** work as well: `←` `→` for a day, `↑` `↓` for a week, following the month when needed.
|
|
23
|
-
6. Sessions are grouped in sidebar workspace order; the group glyph and every row's hairline use that workspace's colour, and each row shows title plus the time the active rule uses. The list header names the rule (by first prompt / by latest).
|
|
23
|
+
6. Sessions are grouped in sidebar workspace order, and each group heading folds its rows when clicked (the fold state is remembered); the group glyph and every row's hairline use that workspace's colour, and each row shows title plus the time the active rule uses. The list header names the rule (by first prompt / by latest).
|
|
24
24
|
7. Click a row to open that session in the conversation area; **the calendar stays open**, so you can keep picking from the same day.
|
|
25
25
|
8. Dismiss with the active button again, a click outside, `Esc`, or a window resize.
|
|
26
26
|
|
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
3. **切换规则**:月份标题下面有一整行 **「首次|最近」** 分段开关(每格约 160px 宽),点它就地重排(窗口不动),选择会记住;再点侧栏那个按钮才收起。
|
|
21
21
|
4. 有会话的日期,**边框就是当天(按当前规则)涉及的工作区颜色**(只有一个工作区是纯色;多个工作区是一条渐变色边框),下面还按工作区各有一个圆点;鼠标悬停能看到「工作区 · 条数」。点日期即可查看当天会话。
|
|
22
22
|
5. `‹` `›` 翻月(会自动落到该月最早有会话的那一天),「今天」回到当天。焦点在小窗里时也可以用**键盘方向键**:`←` `→` 前后一天、`↑` `↓` 前后一周(跨月自动翻月)。
|
|
23
|
-
6.
|
|
23
|
+
6. 下方按工作区顺序分组,每组标题是该工作区的名字(**标题行可点击折叠/展开该组**,折叠状态会被记住),组图标和每行的描边也用它自己的颜色;每条显示会话标题和时间(左边是首次对话时间、右边是最近对话时间),当前是哪条规则看顶部那枚开关就行。
|
|
24
24
|
7. 点某条会话即在右侧对话区打开它,**小窗保持打开**,可以接着点同一天的下一条。
|
|
25
25
|
8. 关掉小窗:再点侧栏那个按钮、点小窗外面、按 `Esc`,或改变窗口大小。
|
|
26
26
|
|
package/client.js
CHANGED
|
@@ -200,9 +200,13 @@ window.__ModuleLoader__.load({
|
|
|
200
200
|
retry: '重试',
|
|
201
201
|
untitled: '未命名会话',
|
|
202
202
|
unknownWorkspace: '未归属工作区',
|
|
203
|
+
'emptyDay.first': '这一天没有创建会话',
|
|
204
|
+
'emptyDay.last': '这一天没有进行对话',
|
|
203
205
|
emptyDay: '这一天没有创建会话',
|
|
204
206
|
monthLabel: '{year}年{month}月',
|
|
205
207
|
dayLabel: '{month}月{day}日 周{weekday}',
|
|
208
|
+
'dayWithCount.first': '{month}月{day}日,创建了 {count} 个会话',
|
|
209
|
+
'dayWithCount.last': '{month}月{day}日,有 {count} 个会话进行了对话',
|
|
206
210
|
dayWithCount: '{month}月{day}日,创建了 {count} 个会话',
|
|
207
211
|
dayCount: '共 {count} 个会话',
|
|
208
212
|
'weekday.0': '日',
|
|
@@ -243,9 +247,13 @@ window.__ModuleLoader__.load({
|
|
|
243
247
|
retry: 'Retry',
|
|
244
248
|
untitled: 'Untitled session',
|
|
245
249
|
unknownWorkspace: 'No workspace',
|
|
250
|
+
'emptyDay.first': 'No sessions were created on this day',
|
|
251
|
+
'emptyDay.last': 'No conversation took place on this day',
|
|
246
252
|
emptyDay: 'No sessions were created on this day',
|
|
247
253
|
monthLabel: '{monthName} {year}',
|
|
248
254
|
dayLabel: '{weekday}, {monthName} {day}',
|
|
255
|
+
'dayWithCount.first': '{count} sessions were created on {monthName} {day}',
|
|
256
|
+
'dayWithCount.last': '{count} sessions had conversations on {monthName} {day}',
|
|
249
257
|
dayWithCount: '{count} sessions were created on {monthName} {day}',
|
|
250
258
|
dayCount: '{count} sessions',
|
|
251
259
|
'weekday.0': 'Sun',
|
|
@@ -295,6 +303,9 @@ window.__ModuleLoader__.load({
|
|
|
295
303
|
*/
|
|
296
304
|
let lastMode = 'first'
|
|
297
305
|
|
|
306
|
+
/** Workspace groups the reader folded shut, by group key. */
|
|
307
|
+
const collapsedGroups = new Set()
|
|
308
|
+
|
|
298
309
|
|
|
299
310
|
let shared = { open: false, anchor: null, trigger: null }
|
|
300
311
|
const listeners = new Set()
|
|
@@ -726,6 +737,15 @@ window.__ModuleLoader__.load({
|
|
|
726
737
|
lastMode = next
|
|
727
738
|
setMode(next)
|
|
728
739
|
}
|
|
740
|
+
const [collapsed, setCollapsed] = React.useState(() => new Set(collapsedGroups))
|
|
741
|
+
const toggleGroup = (key) => {
|
|
742
|
+
const next = new Set(collapsed)
|
|
743
|
+
if (next.has(key)) next.delete(key)
|
|
744
|
+
else next.add(key)
|
|
745
|
+
collapsedGroups.clear()
|
|
746
|
+
for (const value of next) collapsedGroups.add(value)
|
|
747
|
+
setCollapsed(next)
|
|
748
|
+
}
|
|
729
749
|
|
|
730
750
|
const days = React.useMemo(
|
|
731
751
|
() => indexDays(created.rows, sessionList, workspaceSnapshot, t, mode),
|
|
@@ -1023,7 +1043,7 @@ window.__ModuleLoader__.load({
|
|
|
1023
1043
|
className: classes.join(' '),
|
|
1024
1044
|
'aria-pressed': key === selected ? 'true' : 'false',
|
|
1025
1045
|
'aria-label': count > 0
|
|
1026
|
-
? t('dayWithCount', {
|
|
1046
|
+
? t('dayWithCount.' + mode, {
|
|
1027
1047
|
month: date.getMonth() + 1,
|
|
1028
1048
|
day: date.getDate(),
|
|
1029
1049
|
count,
|
|
@@ -1076,11 +1096,14 @@ window.__ModuleLoader__.load({
|
|
|
1076
1096
|
'div',
|
|
1077
1097
|
{ className: 'sc-list' },
|
|
1078
1098
|
groups.length === 0
|
|
1079
|
-
? h('div', { className: 'sc-note' }, h('span', null, t('emptyDay')))
|
|
1080
|
-
: groups.map((group) =>
|
|
1099
|
+
? h('div', { className: 'sc-note' }, h('span', null, t('emptyDay.' + mode)))
|
|
1100
|
+
: groups.map((group) => {
|
|
1101
|
+
const groupKey = group.key === '' ? '__none__' : group.key
|
|
1102
|
+
const folded = collapsed.has(groupKey)
|
|
1103
|
+
return h(
|
|
1081
1104
|
'section',
|
|
1082
1105
|
{
|
|
1083
|
-
key:
|
|
1106
|
+
key: groupKey,
|
|
1084
1107
|
// The Workspace's own colour drives the group glyph and
|
|
1085
1108
|
// the hairline around each of its rows, so the day list
|
|
1086
1109
|
// and the calendar dots speak one colour language.
|
|
@@ -1088,25 +1111,39 @@ window.__ModuleLoader__.load({
|
|
|
1088
1111
|
style: { '--sc-accent': colorOf(group.colorIndex) },
|
|
1089
1112
|
},
|
|
1090
1113
|
h(
|
|
1091
|
-
'div',
|
|
1092
|
-
{ className: 'sc-groupHead' },
|
|
1093
|
-
h(FolderGlyph, { size: 13 }),
|
|
1094
|
-
h('span', { className: 'sc-groupTitle', title: group.title }, group.title),
|
|
1095
|
-
h('span', { className: 'sc-groupCount' }, String(group.items.length)),
|
|
1096
|
-
),
|
|
1097
|
-
group.items.map((item) => h(
|
|
1098
1114
|
'button',
|
|
1099
1115
|
{
|
|
1100
|
-
key: item.id,
|
|
1101
1116
|
type: 'button',
|
|
1102
|
-
className: 'sc-
|
|
1103
|
-
|
|
1104
|
-
|
|
1117
|
+
className: 'sc-groupHead',
|
|
1118
|
+
'aria-expanded': folded ? 'false' : 'true',
|
|
1119
|
+
title: group.title,
|
|
1120
|
+
onClick: () => { toggleGroup(groupKey) },
|
|
1105
1121
|
},
|
|
1106
|
-
h(
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1122
|
+
h(
|
|
1123
|
+
'span',
|
|
1124
|
+
{ className: folded ? 'sc-groupChevron sc-groupChevronFolded' : 'sc-groupChevron' },
|
|
1125
|
+
h(ChevronGlyph, { size: 12, direction: 'right' }),
|
|
1126
|
+
),
|
|
1127
|
+
h(FolderGlyph, { size: 13 }),
|
|
1128
|
+
h('span', { className: 'sc-groupTitle' }, group.title),
|
|
1129
|
+
h('span', { className: 'sc-groupCount' }, String(group.items.length)),
|
|
1130
|
+
),
|
|
1131
|
+
folded
|
|
1132
|
+
? null
|
|
1133
|
+
: group.items.map((item) => h(
|
|
1134
|
+
'button',
|
|
1135
|
+
{
|
|
1136
|
+
key: item.id,
|
|
1137
|
+
type: 'button',
|
|
1138
|
+
className: 'sc-row',
|
|
1139
|
+
title: item.title,
|
|
1140
|
+
onClick: () => { openFromList(item.id) },
|
|
1141
|
+
},
|
|
1142
|
+
h('span', { className: 'sc-rowTitle' }, item.title),
|
|
1143
|
+
h('span', { className: 'sc-rowTime' }, clockOf(item.time)),
|
|
1144
|
+
)),
|
|
1145
|
+
)
|
|
1146
|
+
}),
|
|
1110
1147
|
),
|
|
1111
1148
|
),
|
|
1112
1149
|
)
|
|
@@ -1562,6 +1599,7 @@ window.__ModuleLoader__.load({
|
|
|
1562
1599
|
Workspace, used by the group glyph and its rows' hairlines. */
|
|
1563
1600
|
/* The Workspace heading stays pinned while its own rows scroll past, so
|
|
1564
1601
|
a busy day never loses track of which group you are reading. */
|
|
1602
|
+
/* The heading folds its group, like a workspace row in the sidebar. */
|
|
1565
1603
|
.sc-groupHead {
|
|
1566
1604
|
position: sticky;
|
|
1567
1605
|
top: 0;
|
|
@@ -1569,11 +1607,34 @@ window.__ModuleLoader__.load({
|
|
|
1569
1607
|
display: flex;
|
|
1570
1608
|
align-items: center;
|
|
1571
1609
|
gap: 5px;
|
|
1572
|
-
|
|
1610
|
+
width: 100%;
|
|
1611
|
+
padding: 6px 7px 3px;
|
|
1612
|
+
border: 0;
|
|
1613
|
+
border-radius: 6px;
|
|
1614
|
+
background: var(--dsw-specific-menu, var(--dsw-alias-bg-layer-1));
|
|
1573
1615
|
color: var(--dsw-alias-label-secondary);
|
|
1616
|
+
font: inherit;
|
|
1574
1617
|
font-size: 12px;
|
|
1575
1618
|
font-weight: 600;
|
|
1576
|
-
|
|
1619
|
+
text-align: left;
|
|
1620
|
+
cursor: pointer;
|
|
1621
|
+
}
|
|
1622
|
+
.sc-groupHead:hover {
|
|
1623
|
+
color: var(--dsw-alias-label-primary);
|
|
1624
|
+
}
|
|
1625
|
+
.sc-groupHead:focus-visible {
|
|
1626
|
+
outline: 2px solid var(--dsw-focus-ring-color, var(--sc-calendar-accent));
|
|
1627
|
+
outline-offset: -2px;
|
|
1628
|
+
}
|
|
1629
|
+
.sc-groupChevron {
|
|
1630
|
+
flex: none;
|
|
1631
|
+
display: inline-flex;
|
|
1632
|
+
color: var(--dsw-alias-label-tertiary);
|
|
1633
|
+
transform: rotate(90deg);
|
|
1634
|
+
transition: transform 120ms ease;
|
|
1635
|
+
}
|
|
1636
|
+
.sc-groupChevronFolded {
|
|
1637
|
+
transform: rotate(0deg);
|
|
1577
1638
|
}
|
|
1578
1639
|
.sc-groupHead svg {
|
|
1579
1640
|
color: var(--sc-accent, currentColor);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akira-yylm/session-calendar",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Session calendar: a month calendar beside the sidebar listing every session created on the selected day, grouped by workspace.",
|
|
6
6
|
"license": "MIT",
|