modscode / Gallery / tasknotes-preview
tasknotes-preview
Show Obsidian TaskNotes tasks from a .base view as a board, list, agenda or dependency graph in a Claude Desktop side pane
What it does
- Draws a pane, toasts
- Adds /taskboard
- Watches mcp__tasknotes-preview__open calls
- Hooks session.start
- Keeps its own state between turns
Good points
- No network calls
- Written in TypeScript
- Has a desktop-specific branch
- 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 tasknotes-preview by BRNCX (pane, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/cbruyndoncx-tasknotes-preview/
// 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: "Tasks · ‹viewName›" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Text, Select, Button } = $.ui.resolve(e)
const rel = '…'
const view = '…'
const LAYOUT_LABEL = '…'
const name = '…'
const caption = '…'
const length = '…'
const tasksFolder = '…'
const archiveFolder = '…'
const count = '…'
const warnings = '…'
return (
<Box flexDirection="column" gap={1}>
<Text bold wrap="truncate-middle">
{rel}
</Text>
<Box flexDirection="row" gap={2} alignItems="center" flexWrap="wrap">
<Select label="View" value={`${view}`} />
<Button label={`${LAYOUT_LABEL}`} />
<Button label={`${LAYOUT_LABEL}`} />
<Button label={`${LAYOUT_LABEL}`} />
<Button label="Refresh" />
<Button label="Open in Obsidian" />
</Box>
<Text dimColor>
{name}
{" · "}
{caption}
</Text>
<Text dimColor>
{`Filters run over the ${length} notes in ${tasksFolder} and ${archiveFolder}, not the whole vault.`}
</Text>
<Box flexDirection="row" flexWrap="wrap" gap={1} alignItems="center">
<Text dimColor>
Projects
</Text>
<Button label={`${name} ${count}`} />
<Button label={`${name} ${count}`} />
<Button label={`${name} ${count}`} />
<Button label="Fewer" dimColor />
</Box>
<Box flexDirection="row" flexWrap="wrap" gap={1} alignItems="center">
<Text dimColor>
Contexts
</Text>
<Button label={`@${name} ${count}`} />
<Button label={`@${name} ${count}`} />
<Button label={`@${name} ${count}`} />
<Button label="Fewer" dimColor />
</Box>
<Button label="Clear filters" dimColor />
<Text dimColor italic>
Note: skipped what this renderer cannot read (
{length}
{"): "}
{warnings}
; …
</Text>
</Box>
)
})
on('session.start', async ($, e, next) => {
const rel = '…'
const openInObsidian = '…'
const errorText = '…'
await $.ui.toast(`Opened ${rel} in Obsidian (${openInObsidian})`)
await $.ui.toast(`Could not open Obsidian: ${errorText}`)
return next(e)
})
}
The mod's own code
Shown under the mod's licence (MIT); its text is below. Keep the notice if you copy these lines.
hooks/register.tsx lines 468–627 · Pane
on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
const ref = memberOf(TARGET, e)
const { value: t } = await $.state.get(ref)
const patch = (change: Partial<TasksTarget>) => update($, ref, cur => (cur ? { ...cur, ...change, rev: cur.rev + 1 } : cur))
const open = async (rel: string) => {
if (!t) return
const target: Target = { rel, real: joinPath(t.root, rel), ...(t.vault ? { vault: t.vault } : {}) }
try {
$.ui.toast(`Opened ${rel} in Obsidian (${await openInObsidian($, target)})`)
} catch (err) {
$.ui.toast(`Could not open Obsidian: ${errorText(err)}`)
}
}
const empty = 'No tasks open. Run /taskboard, or /taskboard kanban, or /taskboard <file.base>.'
let drawn: Drawn | undefined
let failure: string | undefined
if (t) {
try {
drawn = await evaluate($, t)
} catch (err) {
failure = errorText(err)
}
}
if (e.surface === 'terminal') {
const { Box, Text } = $.ui.resolve(e)
return (
<Box flexDirection="column">
<Text>{t ? t.rel : empty}</Text>
{drawn && <Text>{summarize(drawn, t as TasksTarget)}</Text>}
{failure && <Text color="red">{failure}</Text>}
<Text dimColor>The board, agenda and graph are drawn in the Desktop Code tab.</Text>
</Box>
)
}
const elements = $.ui.resolve(e)
const { Box, Text, Button, Svg } = elements
const Select = 'Select' in elements ? elements.Select : undefined
if (!t) return <Text dimColor>{empty}</Text>
if (!drawn) return <Text color="red">Cannot show {t.rel}: {failure}</Text>
const { model, all, config, vault, layout, now } = drawn
const filters = filtersOf(t)
const filtering = filters.projects.length + filters.contexts.length > 0
const settings = vault.settings
const isExpanded = (key: string) => t.expanded.includes(`${layout}:${key}`)
const expand = (key: string) => patch({ expanded: [...t.expanded, `${layout}:${key}`] })
const collapse = (key: string) => patch({ expanded: t.expanded.filter(k => k !== `${layout}:${key}`) })
// The popup a card or agenda row shows while the pointer is on it: every property of the
// task and an Open in Obsidian button. A hover reveal runs no hook, so it costs no redraw;
// it is drawn display:none, absolute (moves nothing) and lit by the keyed Box around it.
const taskIndexOf = memo(`${drawn.key}|index`, () => taskIndex(vault.tasks))
const taskByPath = memo(`${drawn.key}|byPath`, () => new Map(vault.tasks.map(task => [task.file.path, task])))
const popup = (path: string, place: { top: number; left: number }) => {
const task = taskByPath.get(path)
if (!task) return undefined
return (
<Box
position="absolute"
top={place.top}
left={place.left}
right={0}
display="none"
hover={{ display: 'flex' }}
flexDirection="column"
borderStyle="round"
borderColor={task.statusDef?.color ?? 'gray'}
backgroundColor="#1e1e1e"
paddingX={1}
>
<Text bold color="white" wrap="wrap">{task.title}</Text>
{detailOf(task, taskIndexOf, now).map((m, k) => (
<Text key={`pop:${path}:${k}`} color={m.color ?? 'white'} {...(k === 0 || m.color ? {} : { dimColor: true })} wrap="wrap">{m.text}</Text>
))}
{t.vault && <Button key={`pop-open:${path}`} label="Open in Obsidian" variant="primary" onPress={() => open(path)} />}
</Box>
)
}
const cardView = (card: Card, compact: boolean) => (
<Box key={`card:${card.key}`} flexDirection="column" borderStyle="round" borderColor={card.color ?? 'gray'} paddingX={1} marginBottom={compact ? 0 : 1}>
{popup(card.path, { top: 0, left: 0 })}
<Box flexDirection="row" gap={1} alignItems="flex-start">
<Text color={card.color ?? 'gray'}>●</Text>
<Box flexGrow={1} flexShrink={1}>
<Text bold={!card.done} strikethrough={card.done} dimColor={card.done} wrap="wrap">{card.title}</Text>
</Box>
<Button key={`open:${card.path}`} label="↗" plain dimColor onPress={() => open(card.path)} />
</Box>
{card.meta.length > 0 && (
<Box flexDirection="row" flexWrap="wrap" columnGap={2}>
{card.meta.map((m, k) => (
<Text key={`${card.key}:m${k}`} {...(m.color ? { color: m.color } : { dimColor: true })}>{m.text}</Text>
))}
</Box>
)}
</Box>
)
const more = (key: string, total: number) =>
total > CAP && (isExpanded(key)
? <Button key={`less:${key}`} label="Show fewer" dimColor onPress={() => collapse(key)} />
: <Button key={`more:${key}`} label={`Show all ${total}`} dimColor onPress={() => expand(key)} />)
const columnView = (col: Column, board: boolean) => {
const shown = isExpanded(col.key) ? col.cards : col.cards.slice(0, CAP)
return (
<Box key={`col:${col.key}`} flexDirection="column" flexGrow={1} flexShrink={1} {...(board ? { minWidth: 30, width: 34 } : {})}>
<Box flexDirection="row" gap={1}>
<Text color={col.color ?? 'gray'}>●</Text>
<Text bold>{col.label}</Text>
<Text dimColor>{col.cards.length}</Text>
</Box>
{col.cards.length === 0 && <Text dimColor italic>No tasks</Text>}
{shown.map(card => cardView(card, false))}
{more(col.key, col.cards.length)}
</Box>
)
}
const agendaRow = (item: AgendaItem, k: number, overdue: boolean) => {
const status = item.task.statusDef
const kind = item.kind === 'recurring' ? '↻' : item.kind === 'due' ? 'due' : 'sched'
return (
<Box key={`ag:${item.task.file.path}:${item.date}:${k}`} flexDirection="row" gap={1}>
{popup(item.task.file.path, { top: 1, left: 2 })}
<Text color={status?.color ?? 'gray'}>●</Text>
<Text {...(overdue ? { color: '#d62728' } : { dimColor: true })}>{overdue ? dayLabel(item.date, now) : kind}</Text>
<Box flexGrow={1} flexShrink={1}>
<Text wrap="wrap">{item.task.title}</Text>
</Box>
{item.task.priorityDef && item.task.priority !== 'none' && <Text color={item.task.priorityDef.color}>{item.task.priorityDef.label}</Text>}
<Button key={`open:${item.task.file.path}:${item.date}`} label="↗" plain dimColor onPress={() => open(item.task.file.path)} />
</Box>
)
}
// Pills: the projects and contexts of the whole view, most used first. A press toggles one;
// several in a row widen (any of them), the two rows narrow each other (both must hold).
const facetsOf = memo(`${drawn.key}|facets`, () => facets(all.tasks))
const PILLS = 10
const pillRow = (kind: 'project' | 'context', label: string, list: Facet[], selected: string[], prefix: string) => {
if (!list.length) return undefined
const chosen = selected.map(s => s.toLowerCase())
const field = kind === 'project' ? 'projects' : 'contexts'
const toggle = (name: string) =>
patch({ [field]: chosen.includes(name.toLowerCase()) ? selected.filter(s => s.toLowerCase() !== name.toLowerCase()) : [...selected, name] } as Partial<TasksTarget>)
// Selected pills always show, even beyond the cap.
const visible = t.allPills ? list : list.filter((f, i) => i < PILLS || chosen.includes(f.name.toLowerCase()))
return (
<Box key={`pills-${kind}`} flexDirection="row" flexWrap="wrap" gap={1} alignItems="center">
<Text dimColor>{label}</Text>
{visible.map(f => (
<Button
key={`pill-${kind}:${f.name}`}
label={`${prefix}${f.name} ${f.count}`}
{...(chosen.includes(f.name.toLowerCase()) ? { variant: 'primary' as const } : { dimColor: true })}Licence text (MIT)
MIT License Copyright (c) 2026 Carine Bruyndoncx 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
runs programsreads filestool 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 61ab49cdff99 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.hooks/register.tsx |
| Parses | Every file parses as TypeScript or JavaScript.9 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.its repository's .claude-plugin/marketplace.json does not list it: no install line to give |
| 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.hooks/register.tsx:286 a program named at run time |
| 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's .claude-plugin/marketplace.json does not list it, so there is no install line to give. Read it as code, or follow its author's README.
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 "cbruyndoncx-tasknotes-preview" with its code and make me a pane like itSearch them from Claude: the MCP connector
Similar designs
-
Ask Claude…Xcodebuild · App · 31/3◐ Rendering App…Write↻ Re-render (r) r✦ Ask Claude (x) x◀ (h) h▶ (l) lOpen (o) o
-
Ask Claude…Skins0 Your promptadd rate limiting to the hub api0 Tool rows: finished, running, failedYour prompt Spinner0 Folded group of reads and searches●main · note 3 · note 3 · note 30 Edit diff cardDesktop only; the terminal keeps Claude Code's diff.0 Shell output cardDesktop only.0 Code block cardDesktop only; the terminal keeps Claude Code's markdown.0 TableAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentCopyAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentCopyAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentCopy0 SpinnerAccent SpinnerSpinnerSpinner… 2h 10m0 Band above the prompt: normal, then nudging to compact█████░░░ 42% build█████░░░ 42% build█████░░░ 42% buildContext is 42% full0 Compact now0 Band above a questionTable BashBashBash0 Turn footer (terminal)3 build in 2h 10m · Grep · +3 −3
-
Ask Claude…agent-discoverbuildbuildbuildRefreshMCP Browse/3Tab / shift+Tab move · Enter presses · ↑↓ scroll · Esc back to the promptBrowse...Audit asks:DeclineAcceptDeclineCancelAudit asks:DeclineAcceptDeclineCancelAudit asks:DeclineAcceptDeclineCancel
-
Ask Claude…Fanyi settingsOnAPI · OpusenOn this MacAPIHost src/ SaveKey K · paste a new one, Enter SaveOpus↻ RefreshCustom model model id, for an API that lists none UseFanyi settingsHostClose
-
Ask Claude…Commands●command-hubreading commands…+ create 3+ create 3+ create 3Prompt3 of 3 commandsReading the installed commands… they appear here in a moment.Save command/buildCommands/buildCommands/buildCommandsSave command/buildCommands/buildCommands/buildCommandsSave command/buildCommands/buildCommands/buildCommands
-
● pace Write · Park to1 park 12 dismiss 2pace: resume point 2h 10m · Fix login · 33 resume 34 discard 45 all 3 5pace: Park to resume point older than 7 days6 clear 6Ask Claude…