modscode / Gallery / todo-calendar
todo-calendar
TODO 週曆面板:在面板顯示一週任務,由 Claude 用工具新增與修改任務
What it does
- Draws a pane
- Adds /todo
- Watches mcp__todo-calendar__add_task, mcp__todo-calendar__list_tasks calls
- Hooks session.start
- Keeps its own state between turns
Good points
- No network calls
- Starts no processes
- Written in TypeScript
- Handles errors
Code to start from
Two kinds: a starter modscode writes from the design above, and the lines of the mod's own code that draw it.
Starter (register.tsx)
import type { Register } from 'claude-code'
// Drawn like todo-calendar by jacky (pane), as modscode read it from the mod's code:
// https://modscode.com/gallery/jaaaackielai-todo-calendar/
// Written by modscode from that reading, not copied from the mod: use it as you like.
// Each value below stands for one the mod works out at run time; put in your own.
export const register: Register = on => {
// the pane: open it with $.ui.open({ id: 'my-pane', title: "TODO 週曆" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Text, Button, Input } = $.ui.resolve(e)
const weekLabel = '…'
const length = '…'
const length2 = '…'
const title = '…'
const date = '…'
const error = '…'
return (
<Box flexDirection="column">
<Box flexDirection="row" justifyContent="space-between" flexWrap="wrap">
<Text bold>
{weekLabel}
</Text>
<Text dimColor>
{"共 "}
{length}
{" 項,完成 "}
{length2}
</Text>
</Box>
<Box flexDirection="row" gap={3} flexWrap="wrap" marginBottom={1}>
<Button plain hotkey="p" label="◀ 上週" />
<Button variant="primary" hotkey="t" label="本週" />
<Button plain hotkey="n" label="下週 ▶" />
</Box>
<Box flexDirection="row" gap={1} />
<Box flexDirection="column" borderStyle="round" borderColor="permission" paddingX={1} marginTop={1}>
<Input label="名稱 " value={`${title}`} autoFocus submitLabel="儲存" />
<Input label="日期 " value={`${date}`} placeholder="YYYY-MM-DD" submitLabel="儲存" />
<Text color="warning">
{error}
</Text>
<Box flexDirection="row" gap={2}>
<Button plain label="儲存" />
<Button plain label="取消" />
</Box>
</Box>
</Box>
)
})
}
The mod's own code
Shown under the mod's licence (MIT); its text is below. Keep the notice if you copy these lines.
plugins/todo-calendar/hooks/register.tsx lines 352–511 · Pane
on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
const elements = $.ui.resolve(e)
const { Box, Text, Button } = elements
// mobile 沒有 Input,那裡不提供編輯
const Input = e.surface !== 'mobile' && 'Input' in elements ? elements.Input : undefined
const tasks = await read($, tasksAtom)
const offset = await read($, weekOffsetAtom)
const today = (await read($, todayAtom)) || (await computeToday($))
const selection = await read($, selectionAtom)
const days = weekDays(today, offset)
const weekTasks = tasksBetween(tasks, days[0], days[6])
const isWide = e.props.bodyColumns >= WIDE_COLUMNS
// 橫排時七欄之間有 6 格空隙
const columnWidth = Math.floor((e.props.bodyColumns - 6) / 7)
const taskTitle = (task: Task) => {
if (task.done) {
return (
<Text dimColor strikethrough wrap="wrap">
{task.title}
</Text>
)
}
if (isOverdue(task, today)) {
return (
<Text color="error" wrap="wrap">
{task.title}
</Text>
)
}
return <Text wrap="wrap">{task.title}</Text>
}
const taskLine = (task: Task) => (
<Box key={`task-${task.id}`} flexDirection="row" gap={1}>
<Button
key={`check-${task.id}`}
plain
label={task.done ? '✓' : '○'}
dimColor={task.done}
onPress={() => changeTask($, task.id, { done: !task.done })}
/>
<Box flexGrow={1}>{taskTitle(task)}</Box>
<Button
key={`pick-${task.id}`}
plain
label="⋯"
dimColor={selection?.id !== task.id}
onPress={() =>
update($, selectionAtom, held =>
held?.id === task.id ? null : { id: task.id, mode: 'menu', title: task.title, date: task.date, error: '' },
)
}
/>
</Box>
)
const selected = tasks.find(task => task.id === selection?.id)
const close = () => update($, selectionAtom, () => null)
// 週末都用藍色,今天用深金黃,整個面板只有今天最搶眼
const headingColor = (date: string, isToday: boolean) => {
if (isToday) {
return TODAY_COLOR
}
const index = weekdayIndex(date)
return index >= 5 ? 'suggestion' : undefined
}
const day = (date: string) => {
const isToday = date === today
const list = tasksOn(tasks, date)
const color = headingColor(date, isToday)
return (
<Box
key={`day-${date}`}
flexDirection="column"
width={isWide ? columnWidth : undefined}
borderStyle={isWide || isToday ? 'round' : undefined}
borderColor={isToday ? TODAY_COLOR : undefined}
borderDimColor={!isToday}
paddingX={isWide || isToday ? 1 : 0}
>
{/* 星期幾、日期標籤、今天的記號,彼此空一格 */}
<Box flexDirection="row" flexWrap="wrap" alignItems="center" gap={1}>
<Text bold color={color}>
{WEEKDAY_NAMES[weekdayIndex(date)]}
</Text>
{/* 一行高的底色標籤:inverse 把字色當底色,平日用暗色底 */}
<Text bold inverse color={color} dimColor={color === undefined}>
{` ${shortDate(date)} `}
</Text>
{isToday && (
<Text bold color={color}>
● 今天
</Text>
)}
</Box>
{list.length === 0 ? <Text dimColor>—</Text> : list.map(taskLine)}
</Box>
)
}
const pickedLabel = (picked: Task) =>
`${picked.title}(${shortDate(picked.date)} ${WEEKDAY_NAMES[weekdayIndex(picked.date)]})`
const setDraft = (draft: Partial<Selection>) =>
update($, selectionAtom, held => (held === null ? null : { ...held, ...draft }))
/** 讀最新的草稿再存檔,避免用到畫面當下抓到的舊值 */
const saveDraft = async (draft: Partial<Selection> = {}) => {
const held = await read($, selectionAtom)
if (held === null) {
return
}
const title = (draft.title ?? held.title).trim()
const date = (draft.date ?? held.date).trim()
if (title === '') {
await setDraft({ ...draft, error: '名稱不可空白。' })
return
}
if (!isValidDate(date)) {
await setDraft({ ...draft, error: '日期要用 YYYY-MM-DD 格式,例如 2026-10-07。' })
return
}
await changeTask($, held.id, { title, date })
await close()
}
const actionBar = (picked: Task, held: Selection) => {
if (held.mode === 'edit' && Input !== undefined) {
return (
<Box flexDirection="column" borderStyle="round" borderColor="permission" paddingX={1} marginTop={1}>
<Input
key="edit-title"
label="名稱 "
value={held.title}
autoFocus
submitLabel="儲存"
onInput={(title: string) => setDraft({ title })}
onSubmit={(title: string) => saveDraft({ title })}
/>
<Input
key="edit-date"
label="日期 "
value={held.date}
placeholder="YYYY-MM-DD"
submitLabel="儲存"
onInput={(date: string) => setDraft({ date })}
onSubmit={(date: string) => saveDraft({ date })}
/>
{held.error !== '' && <Text color="warning">{held.error}</Text>}
<Box flexDirection="row" gap={2}>
<Button key="save" plain label="儲存" onPress={() => saveDraft()} />
<Button key="cancel" plain label="取消" onPress={close} />
</Box>
</Box>
)Licence text (MIT)
MIT License Copyright (c) 2026 jacky Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
What its code calls
writes filesenv varstool callsremembers
The design, read from code
Drawn from the mod's source at the commit read, not from a run: a list is drawn three times, a condition takes its first branch that draws in the desktop app, and a value only the run time knows is shown as a made-up sample (dotted underline) or left out. Colours and type are this site's.
What its code shows
Read from the source at commit c2406efc81e4 on 2026-10-06. The first group decides whether a mod is listed; the rest is for you to weigh. A later commit is not read until the next crawl.
| Decides the listing: code you can check | |
|---|---|
| Entry read | Every module hooks/hooks.json names was read.plugins/todo-calendar/hooks/register.tsx |
| Parses | Every file parses as TypeScript or JavaScript.2 files parsed |
| All its code is in the mod | Every import is a file of the mod or the engine's own module; no packages, no require.all its code is in the mod |
| Readable | No minified lines, no eval or new Function, no import of a computed path, no encoded blobs.no minified code, no eval, no encoded blobs |
| Calls in the open | Network and programs are reached as $.http.fetch and $.process.run in place, never passed around.every call outside goes through $ in the open |
| For you to weigh before installing | |
| Where it draws | The terminal, the desktop app, both, or nothing (hooks only: a guard or a prompt rewriter), as its code says. Shown, never a reason to leave a mod out.draws in the terminal and the desktop app, the same in both |
| Install line | Whether its repository's own .claude-plugin/marketplace.json lists it, so it installs from that marketplace with the lines on its page.listed in its repository's .claude-plugin/marketplace.json: installs from there |
| Programs on Windows | Whether every program it starts through $.process exists on Windows (tail, date, open, osascript, /usr/… do not).runs no program a Windows PC lacks |
| Network | Whether every fetch names its https host in the code.no network |
| Programs | Whether every program it starts is named in the code and is not a shell, an interpreter or a network tool.starts no programs |
| Reads and sends | Whether it both reads files or environment variables and reaches the network.reaches no network |
| Keys in the source | Whether the source holds what looks like an API key or a private key.no keys in the source |
| Licence | An open licence (MIT, Apache-2.0, BSD, ISC, Unlicense, 0BSD, CC0) with its text lets modscode show its code; otherwise the code is linked.MIT |
This is a reading of the code text, not a security review: it does not run the mod, and it cannot see what a program the mod starts does. The check before installing is yours. How mods are chosen
Install it
Check it yourself before you install it. Mods run unsandboxed, with your permissions, and modscode does not vouch for what this code does. Read the code below (or run claude plugin validate . in its folder), weigh what it reaches, and install the commit you read.
Its repository is its marketplace. Add that marketplace (in the terminal with these commands, or in the desktop app's plugin settings) and install the mod from it:
/plugin marketplace add jaaaackieLai/claude-mods/plugin install todo-calendar@claude-modsThis installs the marketplace's latest commit, which may not be the one read here (c2406efc81e4). Compare them before you install.
Ask Claude about it
With the modscode connector added, Claude can read this design, what its code reaches and its code, and build on them. Ask it like this:
Read the modscode design "jaaaackielai-todo-calendar" with its code and make me a pane like itSearch them from Claude: the MCP connector
Similar designs
-
Ask Claude…2h 10m · █████░░░✓ build ✓ build ✓ buildJavaKotlin3 Python■ ok 3 ■ ok 3 ■ ok 3 Razor proven 3 Razor proven 3 Razor proven 3Phases ──────── 3/3build Pythonbuild Pythonbuild Python… 3 more phasesLua ──────── 3/Kotlin■ the whole upgrade Ruby■ build build Ruby■ build build Ruby■ build build Ruby … 3 moreNext ──────── PythonRuby (by hand)Podsclick a button, or ctrl+x tab then Tab, EnterAttention ──────── 3! Scala ! Scala ! Scala … 3 moreSession ──────── okJava
-
Ask Claude…./rows.tsx●●●●●×./rows.tsxnothing loaded yet● Fix login● Fix login● Fix login● Fix login● Fix login● Fix login● Fix login● Fix login● Fix login./rows.tsxWorkspaceWorkspaceWorkspaceselected: build● open in Databricks
-
Ask Claude…build 3 app●●●◉●●okno Library app here yet; Library adds one●./rows.tsx./rows.tsxselected: Nerd
-
Ask Claude…Approved appsApproved appsComputer use can control these apps without asking.High riskAlways allowed (3)None. Allow one below.Not installed (3)This conversation (3)None.Allow an app App name, bundle id or path allowbuilda1b2c3dbuilda1b2c3dbuilda1b2c3d
-
Ask Claude…PulseFix loginRefresh (r) rResume (p) pokRefresh rResume pAAPL, BTC/USDT AddAddNot fetchedYour watchlist is empty. Add a ticker above.●Pulse$1.24—Remove$1.24—PulseCached quote · 3●Pulse$1.24—Remove$1.24—PulseCached quote · 3●Pulse$1.24—Remove$1.24—PulseCached quote · 3Yahoo Finance · Binance Spot · Stocks: regular session, exchange delays vary · Crypto: 24h change · Times are local · pulseticker.appTab: move between controls · Enter: activate · Esc: return to prompt
-
Ask Claude…great_cto: 3 gate waiting — /gatesGatesmy-app · 3 waiting · checked Gates UTCGates — Fix logina1b2c3dExpensive to undo. To approve, type Gates and press Enter.approve: Gates approveGates — Fix logina1b2c3dExpensive to undo. To approve, type Gates and press Enter.approve: Gates approveGates — Fix logina1b2c3dExpensive to undo. To approve, type Gates and press Enter.approve: Gates approve