@akira-yylm/session-calendar 1.1.0 → 1.1.1
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 +14 -0
- package/README.en.md +7 -7
- package/README.md +7 -7
- package/client.js +222 -68
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.1.1
|
|
4
|
+
|
|
5
|
+
- **修复:卡片头部的「‹」「›」「今天」「×」偶发点了没反应**。根因有两个:① 悬停高亮只靠 CSS `:hover`,快速划过时浏览器不一定会重绘;② 月份标题作为弹性项占掉了头部约 40% 宽度,那是一段完全不可点的宽区块,鼠标常落在上面。现在悬停改为**按指针实际位置判定**(文档级 `pointermove` + `elementFromPoint`,命中哪个控件就给哪个加 `.sc-hot`,幂等、不依赖 enter/leave 配对),并把月份标题移出控件行。
|
|
6
|
+
- 月份这一行的四个按钮(`‹` `›` `今天` `×`)改成和下面「首次/最近」完全同一套样式:同一个描边轨道(1px 边框 + 6px 圆角 + 5% 墨色底)、内部 2px 间距、按钮 6px 圆角无边框、悬停同为 9% 中性底。
|
|
7
|
+
- **头部重排**:月份标题单独一行居中;下面四个控件(`‹` `›` `今天` `×`)**等分整行**,每个约 76×36px,控件之间只剩 6px 缝,没有大段死区。
|
|
8
|
+
- **「首次 / 最近」切换器改为独立整行**:两格各约 160px 宽、26px 高,取代原来挤在头部右侧的小胶囊。
|
|
9
|
+
- 悬停反馈从宿主的中性色(深色主题下几乎看不见)改为**品牌蓝淡底**,一眼可见。
|
|
10
|
+
- 「今天」不再有 `disabled` 态(之前显示当前月且选中今天时它既无悬停也不响应点击)。
|
|
11
|
+
- 卡片去掉 `backdrop-filter`:它会提升为独立合成层,快速划过时背景变化可能错过那一帧。
|
|
12
|
+
- **选中的日期改用当天配色的底色**:不再是统一的 16% 蓝底,而是铺当天涉及的工作区颜色——单工作区是纯色,多工作区是以**格子中心为圆心**的**角度渐变**(每个工作区占一个扇区),透明度 **50%**(这个数值留作后续调整);没有会话的日子仍是蓝色淡底。选中格里的圆点加了一圈发丝描边,免得同色系底上糊成一片。
|
|
13
|
+
- **日期格彩色边框也改成角度渐变**:多工作区的边框原来是 135° 斜向渐变,现在同样以格子中心为圆心,每个工作区占一个扇区,和选中底色同一套方向。
|
|
14
|
+
- **「今天」的日期数字改用正文色**(深色主题下是白色、浅色主题下是墨色)并加粗,不再用品牌蓝——蓝字压在卡片底色上不好读;「今天」的标记改由日期下方一条品牌蓝下划线承担,有会话的格子也照样能看出来。
|
|
15
|
+
- **新增键盘方向键**:焦点在小窗里时,`←` `→` 选前一天/后一天,`↑` `↓` 选上一周/下一周;跨月会自动翻到对应月份,列表跟着更新。焦点在对话输入框里时不拦截方向键。
|
|
16
|
+
|
|
3
17
|
## 1.1.0
|
|
4
18
|
|
|
5
19
|
- **日历圆点改为工作区颜色**:某天创建过会话时,日期下方按工作区各画一个 4px 圆点(颜色 = 下方分组的工作区色),同一天几个工作区就几个点;鼠标悬停可直接读到「工作区 · 条数」。
|
package/README.en.md
CHANGED
|
@@ -16,10 +16,10 @@ Clicking a row opens that session, and the switch remembers your last choice.
|
|
|
16
16
|
## Usage
|
|
17
17
|
|
|
18
18
|
1. Under **New session** / **Free session** sits **one `Session calendar` button** — transparent with a neutral hairline while closed, a 15% brand-blue wash plus a 45% hairline while open, spanning the row width; it becomes a 36px icon button in the collapsed rail.
|
|
19
|
-
2. Clicking it opens the calendar to the right of the sidebar, **vertically centred** in the window (about 360px wide, 38px day cells). Its height is fixed (up to 720px), so switching days scrolls only the list and never shifts the grid under your pointer; on a busy day the list scrolls with each group heading pinned.
|
|
20
|
-
3. **Switching rules**:
|
|
19
|
+
2. Clicking it opens the calendar to the right of the sidebar, **vertically centred** in the window (about 360px wide, 38px day cells). Its first row is the month title; the second row is four evenly split buttons — `‹` `›` `Today` `×`. Its height is fixed (up to 720px), so switching days scrolls only the list and never shifts the grid under your pointer; on a busy day the list scrolls with each group heading pinned.
|
|
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
|
-
5. `‹` / `›` page months (landing on that month's earliest day with sessions); **Today** returns.
|
|
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
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).
|
|
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.
|
|
@@ -29,8 +29,8 @@ Clicking a row opens that session, and the switch remembers your last choice.
|
|
|
29
29
|
The calendar dots, each day's frame, the group glyph, and each session row's hairline share **one colour per workspace**, so the month grid itself says which workspace created sessions on which day.
|
|
30
30
|
|
|
31
31
|
- One workspace that day: the frame is that solid colour.
|
|
32
|
-
- Several workspaces: the frame is
|
|
33
|
-
- **Today** is marked by an accent
|
|
32
|
+
- Several workspaces: the frame is an angular gradient centred on the cell, one wedge per workspace in workspace order.
|
|
33
|
+
- **Today** is marked by a bolder date number in the primary text colour plus an accent underline (the blue number was hard to read on the card), and **the picked day** by a 50% wash of that day's own colour scheme (solid for one workspace, an angular run centred on the cell, one wedge per workspace, for several) plus bolder type; neither overrides the data colour.
|
|
34
34
|
|
|
35
35
|
Eight base colours, in family order:
|
|
36
36
|
|
|
@@ -67,10 +67,10 @@ An npm install gains a **Versions** section in the plugin page, so upgrades are
|
|
|
67
67
|
To bypass npm, or to pin an exact commit, install from the repository instead:
|
|
68
68
|
|
|
69
69
|
```sh
|
|
70
|
-
github:Akira-yylm/dsh-session-calendar#v1.1.
|
|
70
|
+
github:Akira-yylm/dsh-session-calendar#v1.1.1
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
To let Plugin Manager treat the install as an **updatable** Git plugin, replace the tag with the full 40-char commit SHA (`git rev-parse v1.1.
|
|
73
|
+
To let Plugin Manager treat the install as an **updatable** Git plugin, replace the tag with the full 40-char commit SHA (`git rev-parse v1.1.1`); a tag or branch also installs, but never follows updates.
|
|
74
74
|
|
|
75
75
|
> Git installs can be very slow from mainland China; prefer the npm method above.
|
|
76
76
|
|
package/README.md
CHANGED
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
## 怎么用
|
|
17
17
|
|
|
18
18
|
1. 左侧导航「新会话」「免费会话」下方是**一个「会话日历」按钮**:收起时背景透明但保留中性细描边、只有蓝色日历图标;打开后铺一层 15% 品牌蓝 + 45% 淡蓝描边(宽度与上面那行一致,折叠成细栏时变成 36px 图标按钮)。
|
|
19
|
-
2. 点它:小窗出现在左侧栏右边、并在窗口内**纵向居中**(约 360px 宽、日期格 38px
|
|
20
|
-
3.
|
|
19
|
+
2. 点它:小窗出现在左侧栏右边、并在窗口内**纵向居中**(约 360px 宽、日期格 38px 高)。顶部第一行是月份标题,第二行是 `‹` `›` `今天` `×` 四个均分整行的按钮。高度固定(最多 720px),所以换日期时只有列表在滚动,月历格子不会跳动;会话很多时列表内部滚动,分组标题吸顶跟随。
|
|
20
|
+
3. **切换规则**:月份标题下面有一整行 **「首次|最近」** 分段开关(每格约 160px 宽),点它就地重排(窗口不动),选择会记住;再点侧栏那个按钮才收起。
|
|
21
21
|
4. 有会话的日期,**边框就是当天(按当前规则)涉及的工作区颜色**(只有一个工作区是纯色;多个工作区是一条渐变色边框),下面还按工作区各有一个圆点;鼠标悬停能看到「工作区 · 条数」。点日期即可查看当天会话。
|
|
22
|
-
5. `‹` `›`
|
|
22
|
+
5. `‹` `›` 翻月(会自动落到该月最早有会话的那一天),「今天」回到当天。焦点在小窗里时也可以用**键盘方向键**:`←` `→` 前后一天、`↑` `↓` 前后一周(跨月自动翻月)。
|
|
23
23
|
6. 下方按工作区顺序分组,每组标题是该工作区的名字,组图标和每行的描边也用它自己的颜色;每条显示会话标题和时间(左边是首次对话时间、右边是最近对话时间),当前是哪条规则看顶部那枚开关就行。
|
|
24
24
|
7. 点某条会话即在右侧对话区打开它,**小窗保持打开**,可以接着点同一天的下一条。
|
|
25
25
|
8. 关掉小窗:再点侧栏那个按钮、点小窗外面、按 `Esc`,或改变窗口大小。
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
圆点、日期格边框、分组图标、以及每条会话行的描边用的是**同一套工作区颜色**,所以从月历上就能读出「哪天、哪个工作区创建过会话」。
|
|
30
30
|
|
|
31
31
|
- 当天只有 1 个工作区:日期格是一圈纯色边框。
|
|
32
|
-
-
|
|
33
|
-
-
|
|
32
|
+
- 当天有多个工作区:日期格边框取这几个工作区的颜色,以格子中心为圆心铺成角度渐变,每个工作区占一个扇区。
|
|
33
|
+
- 「今天」用**加粗的正文色日期 + 一条蓝色下划线**标记(不再用蓝字,深色主题下看不清),「选中」铺**当天的配色**(单工作区纯色、多工作区以格子中心为圆心的角度渐变,每个工作区一个扇区,透明度 50%)+ 加粗;两者都不会覆盖数据色边框。
|
|
34
34
|
|
|
35
35
|
基础色阶 8 色(按色相排列):
|
|
36
36
|
|
|
@@ -67,10 +67,10 @@
|
|
|
67
67
|
不想经过 npm、或者想锁死某个提交时,用 GitHub 地址:
|
|
68
68
|
|
|
69
69
|
```sh
|
|
70
|
-
github:Akira-yylm/dsh-session-calendar#v1.1.
|
|
70
|
+
github:Akira-yylm/dsh-session-calendar#v1.1.1
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
想让 Plugin Manager 把它识别为**可更新**的 Git 安装,把 tag 换成完整的 40 位 commit SHA(`git rev-parse v1.1.
|
|
73
|
+
想让 Plugin Manager 把它识别为**可更新**的 Git 安装,把 tag 换成完整的 40 位 commit SHA(`git rev-parse v1.1.1` 可查);写 tag 或分支名也能装,但不会跟随更新。
|
|
74
74
|
|
|
75
75
|
> 中国大陆网络下 Git 直装可能很慢,建议优先用上面的 npm 方式。
|
|
76
76
|
|
package/client.js
CHANGED
|
@@ -137,12 +137,31 @@ window.__ModuleLoader__.load({
|
|
|
137
137
|
* The paint for one day's frame: the single colour when only one Workspace
|
|
138
138
|
* created sessions that day, otherwise a gradient stopping at each of them.
|
|
139
139
|
*/
|
|
140
|
+
/**
|
|
141
|
+
* The picked day is filled with the same colours its frame uses — a solid
|
|
142
|
+
* wash for one Workspace, an angular run around the cell's centre through
|
|
143
|
+
* all of them when the day touches several — at this alpha.
|
|
144
|
+
*/
|
|
145
|
+
function dayFill(colors) {
|
|
146
|
+
if (colors.length === 0) return undefined
|
|
147
|
+
const wash = (color) => 'color-mix(in srgb, ' + color + ' 50%, transparent)'
|
|
148
|
+
if (colors.length === 1) return wash(colors[0])
|
|
149
|
+
const step = 360 / colors.length
|
|
150
|
+
const stops = colors.map((color, index) => wash(color) + ' ' + Math.round(index * step) + 'deg')
|
|
151
|
+
stops.push(wash(colors[0]) + ' 360deg')
|
|
152
|
+
return 'conic-gradient(from 0deg at 50% 50%, ' + stops.join(', ') + ')'
|
|
153
|
+
}
|
|
154
|
+
|
|
140
155
|
function dayRing(colors) {
|
|
141
156
|
if (colors.length === 0) return undefined
|
|
142
157
|
if (colors.length === 1) return colors[0]
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
158
|
+
// A thin frame sits at one radius, so a radial run would show a single
|
|
159
|
+
// colour there. Centring an angular gradient on the same point gives each
|
|
160
|
+
// Workspace its own wedge around the cell instead.
|
|
161
|
+
const step = 360 / colors.length
|
|
162
|
+
const stops = colors.map((color, index) => color + ' ' + Math.round(index * step) + 'deg')
|
|
163
|
+
stops.push(colors[0] + ' 360deg')
|
|
164
|
+
return 'conic-gradient(from 0deg at 50% 50%, ' + stops.join(', ') + ')'
|
|
146
165
|
}
|
|
147
166
|
|
|
148
167
|
/** Distinct Workspace colour indexes a day needs dots for, in one row. */
|
|
@@ -276,6 +295,7 @@ window.__ModuleLoader__.load({
|
|
|
276
295
|
*/
|
|
277
296
|
let lastMode = 'first'
|
|
278
297
|
|
|
298
|
+
|
|
279
299
|
let shared = { open: false, anchor: null, trigger: null }
|
|
280
300
|
const listeners = new Set()
|
|
281
301
|
|
|
@@ -754,6 +774,43 @@ window.__ModuleLoader__.load({
|
|
|
754
774
|
}
|
|
755
775
|
}, [])
|
|
756
776
|
|
|
777
|
+
/**
|
|
778
|
+
* Header hover, driven by the pointer's own position.
|
|
779
|
+
*
|
|
780
|
+
* A quick pass over these controls could end with a `:hover`
|
|
781
|
+
* recalculation one frame behind, so the highlight never showed. Asking
|
|
782
|
+
* the document what is really under the pointer on every move is
|
|
783
|
+
* idempotent: whichever control the pointer is over carries the class,
|
|
784
|
+
* and a missed enter/leave cannot leave it stuck.
|
|
785
|
+
*/
|
|
786
|
+
React.useEffect(() => {
|
|
787
|
+
const card = cardRef.current
|
|
788
|
+
if (card === null || card === undefined) return
|
|
789
|
+
const selector = '.sc-navBtn, .sc-today, .sc-seg'
|
|
790
|
+
let current = null
|
|
791
|
+
const clear = () => {
|
|
792
|
+
if (current === null) return
|
|
793
|
+
current.classList.remove('sc-hot')
|
|
794
|
+
current = null
|
|
795
|
+
}
|
|
796
|
+
const onMove = (event) => {
|
|
797
|
+
const top = document.elementFromPoint(event.clientX, event.clientY)
|
|
798
|
+
const hit = top !== null && typeof top.closest === 'function' ? top.closest(selector) : null
|
|
799
|
+
const next = hit !== null && card.contains(hit) ? hit : null
|
|
800
|
+
if (next === current) return
|
|
801
|
+
clear()
|
|
802
|
+
if (next !== null) {
|
|
803
|
+
next.classList.add('sc-hot')
|
|
804
|
+
current = next
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
document.addEventListener('pointermove', onMove, true)
|
|
808
|
+
return () => {
|
|
809
|
+
document.removeEventListener('pointermove', onMove, true)
|
|
810
|
+
clear()
|
|
811
|
+
}
|
|
812
|
+
}, [])
|
|
813
|
+
|
|
757
814
|
React.useEffect(() => {
|
|
758
815
|
const onPointerDown = (event) => {
|
|
759
816
|
const card = cardRef.current
|
|
@@ -784,6 +841,39 @@ window.__ModuleLoader__.load({
|
|
|
784
841
|
}
|
|
785
842
|
}, [])
|
|
786
843
|
|
|
844
|
+
/**
|
|
845
|
+
* Arrow keys walk the selection: left/right by a day, up/down by a week.
|
|
846
|
+
* When the new date falls outside the shown month the month follows, so
|
|
847
|
+
* the keyboard never gets stuck at a month boundary. Keys are only taken
|
|
848
|
+
* while focus sits inside the card, so the conversation's own editor keeps
|
|
849
|
+
* its arrow keys.
|
|
850
|
+
*/
|
|
851
|
+
React.useEffect(() => {
|
|
852
|
+
const onArrow = (event) => {
|
|
853
|
+
if (event.defaultPrevented || event.metaKey || event.ctrlKey || event.altKey) return
|
|
854
|
+
const card = cardRef.current
|
|
855
|
+
if (card === null || card === undefined) return
|
|
856
|
+
const active = document.activeElement
|
|
857
|
+
const inCard = active !== null && (active === card || card.contains(active))
|
|
858
|
+
if (!inCard) return
|
|
859
|
+
if (active instanceof HTMLElement
|
|
860
|
+
&& (active.tagName === 'INPUT' || active.tagName === 'TEXTAREA' || active.isContentEditable)) return
|
|
861
|
+
const step = event.key === 'ArrowLeft' ? -1
|
|
862
|
+
: event.key === 'ArrowRight' ? 1
|
|
863
|
+
: event.key === 'ArrowUp' ? -7
|
|
864
|
+
: event.key === 'ArrowDown' ? 7
|
|
865
|
+
: 0
|
|
866
|
+
if (step === 0) return
|
|
867
|
+
event.preventDefault()
|
|
868
|
+
const parts = selected.split('-')
|
|
869
|
+
const next = new Date(Number(parts[0]), Number(parts[1]) - 1, Number(parts[2]) + step)
|
|
870
|
+
setSelected(dayKeyOf(next))
|
|
871
|
+
if (!sameMonth(month, next)) setMonth(monthStartOf(next))
|
|
872
|
+
}
|
|
873
|
+
document.addEventListener('keydown', onArrow)
|
|
874
|
+
return () => { document.removeEventListener('keydown', onArrow) }
|
|
875
|
+
}, [selected, month])
|
|
876
|
+
|
|
787
877
|
const cells = React.useMemo(() => buildGrid(month), [month])
|
|
788
878
|
const bucket = days.get(selected)
|
|
789
879
|
const groups = bucket === undefined ? [] : bucket.list
|
|
@@ -837,6 +927,7 @@ window.__ModuleLoader__.load({
|
|
|
837
927
|
height: geometry.height + 'px',
|
|
838
928
|
},
|
|
839
929
|
},
|
|
930
|
+
h('div', { className: 'sc-title' }, monthLabel),
|
|
840
931
|
h(
|
|
841
932
|
'header',
|
|
842
933
|
{ className: 'sc-head' },
|
|
@@ -851,7 +942,6 @@ window.__ModuleLoader__.load({
|
|
|
851
942
|
},
|
|
852
943
|
h(ChevronGlyph, { direction: 'left' }),
|
|
853
944
|
),
|
|
854
|
-
h('span', { className: 'sc-monthLabel' }, monthLabel),
|
|
855
945
|
h(
|
|
856
946
|
'button',
|
|
857
947
|
{
|
|
@@ -863,28 +953,11 @@ window.__ModuleLoader__.load({
|
|
|
863
953
|
},
|
|
864
954
|
h(ChevronGlyph, { direction: 'right' }),
|
|
865
955
|
),
|
|
866
|
-
h(
|
|
867
|
-
'div',
|
|
868
|
-
{ className: 'sc-mode', role: 'group', 'aria-label': t('mode.switch') },
|
|
869
|
-
['first', 'last'].map((value) => h(
|
|
870
|
-
'button',
|
|
871
|
-
{
|
|
872
|
-
key: value,
|
|
873
|
-
type: 'button',
|
|
874
|
-
className: 'sc-modeBtn',
|
|
875
|
-
'aria-pressed': mode === value ? 'true' : 'false',
|
|
876
|
-
title: t('mode.switch'),
|
|
877
|
-
onClick: () => { changeMode(value) },
|
|
878
|
-
},
|
|
879
|
-
t('mode.' + value),
|
|
880
|
-
)),
|
|
881
|
-
),
|
|
882
956
|
h(
|
|
883
957
|
'button',
|
|
884
958
|
{
|
|
885
959
|
type: 'button',
|
|
886
960
|
className: 'sc-today',
|
|
887
|
-
disabled: sameMonth(month, new Date()) && selected === todayKey,
|
|
888
961
|
onClick: goToday,
|
|
889
962
|
},
|
|
890
963
|
t('today'),
|
|
@@ -901,6 +974,21 @@ window.__ModuleLoader__.load({
|
|
|
901
974
|
h(CloseGlyph),
|
|
902
975
|
),
|
|
903
976
|
),
|
|
977
|
+
h(
|
|
978
|
+
'div',
|
|
979
|
+
{ className: 'sc-modes', role: 'group', 'aria-label': t('mode.switch') },
|
|
980
|
+
['first', 'last'].map((value) => h(
|
|
981
|
+
'button',
|
|
982
|
+
{
|
|
983
|
+
key: value,
|
|
984
|
+
type: 'button',
|
|
985
|
+
className: 'sc-seg',
|
|
986
|
+
'aria-pressed': mode === value ? 'true' : 'false',
|
|
987
|
+
onClick: () => { changeMode(value) },
|
|
988
|
+
},
|
|
989
|
+
t('mode.' + value),
|
|
990
|
+
)),
|
|
991
|
+
),
|
|
904
992
|
h(
|
|
905
993
|
'div',
|
|
906
994
|
{ className: 'sc-weekRow' },
|
|
@@ -915,7 +1003,12 @@ window.__ModuleLoader__.load({
|
|
|
915
1003
|
const entry = days.get(key)
|
|
916
1004
|
const count = entry === undefined ? 0 : entry.count
|
|
917
1005
|
const dotIndexes = entry === undefined ? [] : dayColorIndexes(entry.list)
|
|
918
|
-
const
|
|
1006
|
+
const dayColors = dotIndexes.map((index) => colorOf(index))
|
|
1007
|
+
const ring = dayRing(dayColors)
|
|
1008
|
+
const fill = key === selected ? dayFill(dayColors) : undefined
|
|
1009
|
+
const style = {}
|
|
1010
|
+
if (ring !== undefined) style['--sc-ring'] = ring
|
|
1011
|
+
if (fill !== undefined) style.background = fill
|
|
919
1012
|
const classes = ['sc-cell']
|
|
920
1013
|
if (count > 0) classes.push('sc-cellFilled')
|
|
921
1014
|
// Today and the picked day are independent marks, so a picked
|
|
@@ -941,7 +1034,7 @@ window.__ModuleLoader__.load({
|
|
|
941
1034
|
title: entry === undefined
|
|
942
1035
|
? undefined
|
|
943
1036
|
: entry.list.map((group) => group.title + ' · ' + group.items.length).join('\n'),
|
|
944
|
-
style:
|
|
1037
|
+
style: Object.keys(style).length === 0 ? undefined : style,
|
|
945
1038
|
onClick: () => { setSelected(key) },
|
|
946
1039
|
},
|
|
947
1040
|
h('span', { className: 'sc-dayNum' }, String(date.getDate())),
|
|
@@ -1134,8 +1227,12 @@ window.__ModuleLoader__.load({
|
|
|
1134
1227
|
box-sizing: border-box;
|
|
1135
1228
|
border: 0;
|
|
1136
1229
|
border-radius: 16px;
|
|
1230
|
+
/* No backdrop-filter here: it promotes the card to its own composited
|
|
1231
|
+
layer, and a quick hover's background change can then miss the frame
|
|
1232
|
+
that paints before the pointer leaves — the control looks inert when
|
|
1233
|
+
the pointer moves fast. The menu token is already 94% opaque, so the
|
|
1234
|
+
blur bought nothing visible. */
|
|
1137
1235
|
background: var(--dsw-specific-menu, var(--dsw-alias-bg-overlay, var(--dsw-alias-bg-layer-1)));
|
|
1138
|
-
backdrop-filter: var(--dsw-menu-backdrop-filter, none);
|
|
1139
1236
|
--dsw-elevation-stroke-color: var(--dsw-alias-border-l1);
|
|
1140
1237
|
box-shadow: var(--dsw-elevation-prominent);
|
|
1141
1238
|
--dsh-scrollbar-thumb: var(--dsw-alias-scrollbar-bg-l2);
|
|
@@ -1146,34 +1243,46 @@ window.__ModuleLoader__.load({
|
|
|
1146
1243
|
overflow: hidden;
|
|
1147
1244
|
outline: none;
|
|
1148
1245
|
}
|
|
1149
|
-
|
|
1246
|
+
/* The month is a heading; the four controls below split the row evenly,
|
|
1247
|
+
so there is no dead stretch between them to miss. */
|
|
1248
|
+
.sc-title {
|
|
1150
1249
|
flex: none;
|
|
1151
|
-
|
|
1152
|
-
align-items: center;
|
|
1153
|
-
gap: 2px;
|
|
1154
|
-
padding: 10px 10px 4px;
|
|
1155
|
-
}
|
|
1156
|
-
.sc-monthLabel {
|
|
1157
|
-
flex: 1 1 auto;
|
|
1158
|
-
min-width: 0;
|
|
1159
|
-
overflow: hidden;
|
|
1160
|
-
text-overflow: ellipsis;
|
|
1161
|
-
white-space: nowrap;
|
|
1250
|
+
padding: 8px 10px 2px;
|
|
1162
1251
|
text-align: center;
|
|
1163
1252
|
font-size: 14px;
|
|
1164
|
-
|
|
1253
|
+
font-weight: 600;
|
|
1254
|
+
line-height: 1.5;
|
|
1165
1255
|
color: var(--dsw-alias-label-primary);
|
|
1256
|
+
overflow: hidden;
|
|
1257
|
+
text-overflow: ellipsis;
|
|
1258
|
+
white-space: nowrap;
|
|
1166
1259
|
}
|
|
1167
|
-
|
|
1260
|
+
/* The month row is dressed exactly like the rule switch below it: one
|
|
1261
|
+
outlined track holding two-pixel-apart segments. */
|
|
1262
|
+
.sc-head {
|
|
1168
1263
|
flex: none;
|
|
1264
|
+
display: flex;
|
|
1265
|
+
align-items: stretch;
|
|
1266
|
+
gap: 2px;
|
|
1267
|
+
margin: 0 10px 4px;
|
|
1268
|
+
padding: 2px;
|
|
1269
|
+
min-height: 30px;
|
|
1270
|
+
box-sizing: border-box;
|
|
1271
|
+
border: 1px solid var(--dsw-alias-border-l2, rgba(0, 0, 0, 0.1));
|
|
1272
|
+
border-radius: 8px;
|
|
1273
|
+
background: color-mix(in srgb, var(--dsw-alias-label-primary) 5%, transparent);
|
|
1274
|
+
user-select: none;
|
|
1275
|
+
}
|
|
1276
|
+
.sc-navBtn {
|
|
1277
|
+
flex: 1 1 0;
|
|
1169
1278
|
display: inline-flex;
|
|
1170
1279
|
align-items: center;
|
|
1171
1280
|
justify-content: center;
|
|
1172
|
-
|
|
1173
|
-
height:
|
|
1281
|
+
height: auto;
|
|
1282
|
+
min-height: 26px;
|
|
1174
1283
|
padding: 0;
|
|
1175
1284
|
border: 0;
|
|
1176
|
-
border-radius:
|
|
1285
|
+
border-radius: 6px;
|
|
1177
1286
|
background: transparent;
|
|
1178
1287
|
color: var(--dsw-alias-label-secondary);
|
|
1179
1288
|
cursor: pointer;
|
|
@@ -1187,14 +1296,20 @@ window.__ModuleLoader__.load({
|
|
|
1187
1296
|
outline-offset: -2px;
|
|
1188
1297
|
}
|
|
1189
1298
|
@media (hover: hover) {
|
|
1190
|
-
.sc-navBtn:hover
|
|
1191
|
-
|
|
1299
|
+
.sc-navBtn:hover,
|
|
1300
|
+
.sc-today:hover {
|
|
1301
|
+
background: color-mix(in srgb, var(--dsw-alias-label-primary) 9%, transparent);
|
|
1192
1302
|
color: var(--dsw-alias-label-primary);
|
|
1193
1303
|
}
|
|
1194
|
-
|
|
1304
|
+
/* Both segments react to the pointer: the resting one lifts, the
|
|
1305
|
+
pressed one deepens, so a click never reads as "nothing happened". */
|
|
1306
|
+
.sc-seg:not([aria-pressed='true']):hover {
|
|
1195
1307
|
background: var(--dsw-alias-interactive-bg-hover);
|
|
1196
1308
|
color: var(--dsw-alias-label-primary);
|
|
1197
1309
|
}
|
|
1310
|
+
.sc-seg[aria-pressed='true']:hover {
|
|
1311
|
+
background: color-mix(in srgb, var(--sc-calendar-accent) 22%, transparent);
|
|
1312
|
+
}
|
|
1198
1313
|
.sc-cell:hover {
|
|
1199
1314
|
background: color-mix(in srgb, var(--sc-calendar-accent) 10%, transparent);
|
|
1200
1315
|
}
|
|
@@ -1205,55 +1320,87 @@ window.__ModuleLoader__.load({
|
|
|
1205
1320
|
background: var(--dsw-alias-interactive-bg-hover);
|
|
1206
1321
|
}
|
|
1207
1322
|
}
|
|
1208
|
-
/*
|
|
1209
|
-
|
|
1323
|
+
/* Pointer-driven twins of the header hover rules: a class change is a
|
|
1324
|
+
guaranteed repaint, so the controls answer on every entry. */
|
|
1325
|
+
.sc-navBtn.sc-hot {
|
|
1326
|
+
background: var(--dsw-alias-interactive-bg-hover);
|
|
1327
|
+
color: var(--dsw-alias-label-primary);
|
|
1328
|
+
}
|
|
1329
|
+
.sc-today.sc-hot {
|
|
1330
|
+
background: var(--dsw-alias-interactive-bg-hover);
|
|
1331
|
+
color: var(--dsw-alias-label-primary);
|
|
1332
|
+
}
|
|
1333
|
+
/* The grouping switch gets its own full-width row: two big segments,
|
|
1334
|
+
impossible to miss with the pointer. */
|
|
1335
|
+
.sc-modes {
|
|
1210
1336
|
flex: none;
|
|
1211
1337
|
display: flex;
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
padding:
|
|
1338
|
+
gap: 2px;
|
|
1339
|
+
margin: 0 10px 6px;
|
|
1340
|
+
padding: 2px;
|
|
1215
1341
|
box-sizing: border-box;
|
|
1216
1342
|
border: 1px solid var(--dsw-alias-border-l2, rgba(0, 0, 0, 0.1));
|
|
1217
|
-
border-radius:
|
|
1343
|
+
border-radius: 8px;
|
|
1218
1344
|
background: color-mix(in srgb, var(--dsw-alias-label-primary) 5%, transparent);
|
|
1219
1345
|
}
|
|
1220
|
-
.sc-
|
|
1221
|
-
|
|
1222
|
-
|
|
1346
|
+
.sc-seg {
|
|
1347
|
+
flex: 1 1 0;
|
|
1348
|
+
display: flex;
|
|
1349
|
+
align-items: center;
|
|
1350
|
+
justify-content: center;
|
|
1351
|
+
min-width: 0;
|
|
1352
|
+
height: 26px;
|
|
1353
|
+
padding: 0 8px;
|
|
1223
1354
|
border: 0;
|
|
1224
|
-
border-radius:
|
|
1355
|
+
border-radius: 6px;
|
|
1225
1356
|
background: transparent;
|
|
1226
1357
|
color: var(--dsw-alias-label-secondary);
|
|
1227
1358
|
font: inherit;
|
|
1228
|
-
font-size:
|
|
1229
|
-
line-height:
|
|
1359
|
+
font-size: 12px;
|
|
1360
|
+
line-height: 1;
|
|
1230
1361
|
cursor: pointer;
|
|
1231
1362
|
}
|
|
1232
|
-
.sc-
|
|
1363
|
+
.sc-seg[aria-pressed='true'] {
|
|
1233
1364
|
background: color-mix(in srgb, var(--sc-calendar-accent) 16%, transparent);
|
|
1234
1365
|
color: var(--dsw-alias-label-primary);
|
|
1235
1366
|
font-weight: 600;
|
|
1236
1367
|
}
|
|
1237
|
-
.sc-
|
|
1368
|
+
.sc-seg:active {
|
|
1369
|
+
background: color-mix(in srgb, var(--sc-calendar-accent) 26%, transparent);
|
|
1370
|
+
}
|
|
1371
|
+
.sc-seg:focus-visible {
|
|
1238
1372
|
outline: 2px solid var(--dsw-focus-ring-color, var(--sc-calendar-accent));
|
|
1239
1373
|
outline-offset: -1px;
|
|
1240
1374
|
}
|
|
1375
|
+
.sc-navBtn.sc-hot,
|
|
1376
|
+
.sc-today.sc-hot {
|
|
1377
|
+
background: color-mix(in srgb, var(--dsw-alias-label-primary) 9%, transparent);
|
|
1378
|
+
color: var(--dsw-alias-label-primary);
|
|
1379
|
+
}
|
|
1380
|
+
.sc-seg.sc-hot {
|
|
1381
|
+
background: color-mix(in srgb, var(--dsw-alias-label-primary) 9%, transparent);
|
|
1382
|
+
color: var(--dsw-alias-label-primary);
|
|
1383
|
+
}
|
|
1384
|
+
.sc-seg[aria-pressed='true'].sc-hot {
|
|
1385
|
+
background: color-mix(in srgb, var(--sc-calendar-accent) 22%, transparent);
|
|
1386
|
+
}
|
|
1241
1387
|
.sc-today {
|
|
1242
|
-
flex:
|
|
1243
|
-
|
|
1388
|
+
flex: 1 1 0;
|
|
1389
|
+
display: flex;
|
|
1390
|
+
align-items: center;
|
|
1391
|
+
justify-content: center;
|
|
1392
|
+
height: auto;
|
|
1393
|
+
min-height: 26px;
|
|
1244
1394
|
padding: 0 8px;
|
|
1245
|
-
border: 0
|
|
1246
|
-
border-radius:
|
|
1395
|
+
border: 0;
|
|
1396
|
+
border-radius: 6px;
|
|
1247
1397
|
background: transparent;
|
|
1248
1398
|
color: var(--dsw-alias-label-secondary);
|
|
1249
1399
|
font: inherit;
|
|
1250
1400
|
font-size: 12px;
|
|
1401
|
+
line-height: 1;
|
|
1251
1402
|
cursor: pointer;
|
|
1252
1403
|
}
|
|
1253
|
-
.sc-today:disabled {
|
|
1254
|
-
opacity: 0.45;
|
|
1255
|
-
cursor: default;
|
|
1256
|
-
}
|
|
1257
1404
|
.sc-weekRow {
|
|
1258
1405
|
flex: none;
|
|
1259
1406
|
display: grid;
|
|
@@ -1329,9 +1476,16 @@ window.__ModuleLoader__.load({
|
|
|
1329
1476
|
.sc-cellToday:not(.sc-cellFilled) {
|
|
1330
1477
|
border-color: color-mix(in srgb, var(--sc-calendar-accent) 62%, transparent);
|
|
1331
1478
|
}
|
|
1479
|
+
/* Today's number stays plain text — white in the dark theme, ink in the
|
|
1480
|
+
light one — because the brand blue on the card was hard to read. The
|
|
1481
|
+
underline carries the "today" mark instead. */
|
|
1332
1482
|
.sc-cellToday .sc-dayNum {
|
|
1333
|
-
color: var(--
|
|
1334
|
-
font-weight:
|
|
1483
|
+
color: var(--dsw-alias-label-primary);
|
|
1484
|
+
font-weight: 700;
|
|
1485
|
+
text-decoration: underline;
|
|
1486
|
+
text-decoration-color: color-mix(in srgb, var(--sc-calendar-accent) 70%, transparent);
|
|
1487
|
+
text-decoration-thickness: 1.5px;
|
|
1488
|
+
text-underline-offset: 2px;
|
|
1335
1489
|
}
|
|
1336
1490
|
.sc-cellSelected {
|
|
1337
1491
|
background: color-mix(in srgb, var(--sc-calendar-accent) 16%, transparent);
|
package/locale/en.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"meta": {
|
|
3
3
|
"title": "Session calendar",
|
|
4
|
-
"description": "Adds **one button, 'Session calendar'** (rounded, a faint brand-blue wash with the calendar mark) below the 'Free session' row; it opens a small calendar beside the sidebar with a **First / Latest switch**
|
|
4
|
+
"description": "Adds **one button, 'Session calendar'** (rounded, a faint brand-blue wash with the calendar mark) below the 'Free session' row; it opens a small calendar beside the sidebar with a full-width **First / Latest switch** under the month title — First files a session on the day its first conversation happened, Latest on the day you last messaged it, and the choice is remembered. A day lists its sessions grouped by their workspaces, and the day frames and dots take the workspace colours involved (a gradient when several). Clicking a row opens that session and leaves the calendar open. Entry: the 'Session calendar' button in the left sidebar; inside the calendar use ‹ › to page months, 'Today' to return, and × to close, and (with focus in the card) the arrow keys to move a day or a week. Usage: click a date, read the day's sessions grouped in sidebar order (title plus the active rule's time), then click any row to open it; clicking outside or pressing Esc also dismisses. Turning the plugin off removes the button and the window and leaves DSH sessions, workspaces, and their order untouched. Data: reads only bounded slices of this machine's session logs (the session object's creation time and the first user message at the head); 'Latest' reuses DSH's own session summary `updatedAt`; titles and grouping come from the page's existing session and workspace data, nothing is uploaded, no session is written, and command or status records are excluded from ordering; days follow the browser's local time zone; subagent, blank, and archived sessions are hidden by the sidebar's rules; workspace colours are assigned in registry order from an eight-colour family; the button follows the New-session row's visibility."
|
|
5
5
|
}
|
|
6
6
|
}
|
package/locale/zh.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"meta": {
|
|
3
3
|
"title": "会话日历",
|
|
4
|
-
"description": "在左侧导航「免费会话」下面增加**一个按钮「会话日历」**(圆角、品牌蓝淡底 +
|
|
4
|
+
"description": "在左侧导航「免费会话」下面增加**一个按钮「会话日历」**(圆角、品牌蓝淡底 + 日历图标),点开后在左侧栏右边弹出小窗日历:月份标题下面有「首次|最近」分段开关(整行、每格约 160px 宽)——首次 = 按会话第一次对话时间归日,最近 = 按你最近一次发消息的时间归日,开关的选择会记住。某一天的会话按各自所属的工作区分组列出,日期格边框与圆点是当天涉及的工作区颜色(多个工作区为渐变);点条目直接打开该会话且小窗保持打开。入口:左侧导航「会话日历」;小窗内用 ‹ › 翻月、「今天」回到当天、右上角 × 关闭;焦点在日历里时可用方向键(← → 前后一天、↑ ↓ 前后一周)。使用:点日期 → 下方按工作区顺序分组列出当天会话(标题 + 当前规则的时间)→ 点任意一条即打开;点小窗外面或按 Esc 也能收起。关闭插件后按钮与小窗消失,DSH 的会话、工作区和会话顺序都不受影响。数据:只读本机会话日志的有界切片(对象创建时间、开头第一条用户消息),「最近」直接用 DSH 会话摘要里的 `updatedAt`;标题与分组取自页面已有的会话/工作区数据,不上传、不改写任何会话;命令/状态类事件不计入排序;日期按浏览器本地时区划分;子代理会话、空白会话与已归档会话按左侧栏同样的规则隐藏;工作区颜色按注册表顺序从 8 色阶分配;入口跟随「新会话」那一行显隐。"
|
|
5
5
|
}
|
|
6
6
|
}
|
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.1",
|
|
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",
|