Open
Conversation
…tMate grammar Bootstraps the Hexfield Text VS Code extension with all Phase 1 deliverables: - package.json: extension manifest declaring the hexfield-markdown language ID, wiring the TextMate grammar, activation events (onLanguage:markdown + onStartupFinished), esbuild/TypeScript/ESLint/Prettier toolchain - tsconfig.json: strict TypeScript config targeting ES2022 / Node16 modules - esbuild.js: production + watch build script (output: dist/extension.js) - language-configuration.json: bracket/autoclosing pairs mirroring markdown - syntaxes/hexfield-deck.tmLanguage.json: TextMate grammar scoped exclusively to hexfield-markdown; covers project tags (#word), due date brackets ([YYYY-MM-DD]), priority markers (!!!/!!/!), time estimates (est:Xh/Xm), in-progress checkbox ([/]), and frontmatter keys; includes text.html.markdown to preserve all built-in markdown features - src/extension.ts: activate() registers listeners for onDidOpenTextDocument, onDidChangeTextDocument, and onDidChangeActiveTextEditor; reads YAML frontmatter, calls setTextDocumentLanguage to promote/demote between markdown and hexfield-markdown based on type: hexfield-planner - src/decorators/: Phase 2 stubs (DueDateDecorator) to establish directory structure for dynamic due date proximity coloring - .eslintrc.json, .prettierrc, .vscodeignore, .gitignore: project tooling config https://claude.ai/code/session_01B6NVinrGSL5KzskFxSi31G
Adds the DueDateDecorator class and wires it into the extension activation
to provide runtime date-proximity colorization that mirrors Hexfield Deck's
board badge colors exactly.
DueDateDecorator (src/decorators/dueDateDecorator.ts):
- Scans documents for [YYYY-MM-DD] tokens using a global regex
- Computes proximity of each date to today (evaluated at call time, never stale)
- Buckets dates into four proximity categories:
overdue (date < today) → Red (#F44747)
today (date === today) → Orange (#CE9178)
soon (1–3 days from now) → Yellow (#CCA700)
future (> 3 days from now) → Gray (#858585)
- Holds four TextEditorDecorationType instances (one per bucket)
- Implements vscode.Disposable — all decoration types cleaned up on deactivation
extension.ts updates:
- Imports and instantiates DueDateDecorator; registers it in context.subscriptions
- Decorates the active editor immediately on activation if already hexfield-markdown
- Calls decorator.decorate() after language promotion so dates color on first open
- Debounces re-decoration at 500ms on onDidChangeTextDocument (per spec)
- Calls decorator.decorate() on onDidChangeActiveTextEditor for tab switches
- Fixes FRONTMATTER_RE: \A is not a valid JS regex anchor; corrected to ^ with
no multiline flag (anchors to start of the sliced string head)
https://claude.ai/code/session_01B6NVinrGSL5KzskFxSi31G
Adds .github/workflows/ci.yml that runs on every push to main and claude/** branches and on pull requests to main. Enforces project standards and produces a downloadable .vsix artifact for beta distribution. Steps: 1. pnpm/action-setup@v4 — installs pnpm 9 2. actions/setup-node@v4 — pins Node 20.11.0 (matches Volta config) 3. pnpm install — installs all devDependencies 4. format:check — prettier --check to verify formatting without modifying files 5. lint — eslint across src/ 6. typecheck — tsc --noEmit to catch type errors without emitting files 7. build — esbuild production bundle → dist/extension.js 8. package — vsce package --no-dependencies → hexfield-text-<version>.vsix 9. Upload artifact — stored for 30 days, downloadable by any repo collaborator Also adds two scripts to package.json: typecheck: tsc --noEmit (used by CI step 6 and convenient locally) format:check: prettier --check (CI-safe counterpart to format --write) https://claude.ai/code/session_01B6NVinrGSL5KzskFxSi31G
… run Two problems with the previous workflow: 1. `cache: 'pnpm'` in actions/setup-node@v4 requires pnpm-lock.yaml to exist in the repo (it hashes it for the cache key). Without it the step errors: "Dependencies file is not found ... for pnpm". Removed that option and replaced it with explicit pnpm store path caching via actions/cache@v4, which gracefully falls back when no lockfile exists yet. 2. No lockfile was committed, so installs were non-deterministic and the store cache had no stable key. Added a "Commit lockfile if newly generated" step: after the first `pnpm install` on GitHub Actions generates pnpm-lock.yaml, the step commits and pushes it back to the branch under github-actions[bot]. Commits from that bot do not re-trigger CI, so there is no loop. Subsequent runs will have a locked, cacheable install. permissions bumped to contents: write on the job (needed for the bot push). https://claude.ai/code/session_01B6NVinrGSL5KzskFxSi31G
Two lint/format failures: 1. .eslintrc.json — eslint:recommended enables no-unused-vars as an error. When combined with @typescript-eslint/no-unused-vars the base rule also runs, but it does not understand TypeScript type-only constructs (e.g. `type Proximity = ...` used solely in type positions). The standard fix is to turn the base rule off and let @typescript-eslint/no-unused-vars handle everything — it is type-aware and handles the same cases correctly. 2. dueDateDecorator.ts — PROXIMITY_COLORS used hand-aligned comment padding (extra spaces before //) to keep the comments in a visual column. Prettier normalises all inline comments to a single space, so prettier --check rejected the file. Removed the alignment spaces. https://claude.ai/code/session_01B6NVinrGSL5KzskFxSi31G
eslint:recommended enables no-undef as an error. When combined with the
TypeScript ESLint parser, Node.js globals like setTimeout and clearTimeout
are not always recognised as defined — the scope manager's ambient global
handling is not guaranteed for all TypeScript/tseslint version combinations.
Two targeted fixes (both recommended by the TypeScript ESLint docs):
- "env": { "node": true } — explicitly tells ESLint that Node.js globals
(setTimeout, clearTimeout, process, Buffer, etc.) are in scope
- "no-undef": "off" — TypeScript itself enforces undefined-variable checks
with stricter accuracy; running the base ESLint rule in a TypeScript
project is redundant and prone to false positives
https://claude.ai/code/session_01B6NVinrGSL5KzskFxSi31G
Prettier collapses multi-line function calls when the single-line version fits within printWidth (100). The call: vscode.languages.setTextDocumentLanguage(document, HEXFIELD_LANGUAGE_ID) is exactly 100 characters at its indentation level, so Prettier keeps it on one line. The multi-line form I had written did not match Prettier's output, causing the format:check step to fail. https://claude.ai/code/session_01B6NVinrGSL5KzskFxSi31G
…rkdown scopes Top-level include of text.html.markdown claimed entire list items before hexfield-inline patterns could match within them. Split into two grammar files: hexfield-deck.tmLanguage.json retains frontmatter + markdown embedding; hexfield-inline-injection.tmLanguage.json uses injectionSelector L:text.hexfield.markdown to run within already-tokenized markdown scopes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Decorator: - Expand DueDateDecorator to cover all inline tokens via Decoration API (project tags, priorities HIGH/MED/LOW, time estimates, in-progress checkbox) so colors are absolute and not overridden by active theme - Project tags get pill styling: colored border with borderRadius - hexToRgba helper derives pill border color from configured tag color - All 10 token colors (6 static + 4 due-date proximity) user-configurable via hexfield-text.colors.* settings; changes apply live without reload Extension: - onDidChangeConfiguration watcher rebuilds decoration types on color change - Add onLanguage:hexfield-markdown activation event Package: - contributes.configuration with all 10 color settings - Bump version to 1.0.0 Dev: - .vscode/launch.json, tasks.json, settings.json, extensions.json - examples/weekly-planner.md for manual testing - CHANGELOG.md with v0.1.0, v0.2.0, v1.0.0 entries - .vscodeignore excludes dev/source files from VSIX Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Renames all hexfield-text.colors.* configuration keys to hexfield.colors.* so Hexfield Deck can adopt the same namespace and both extensions share a single settings group (per jimblom/Hexfield-Deck#19). Breaking change: users with customized colors need to rename their settings.json keys accordingly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Project tags (#name) now read hexfield-deck.projects.<name>.color to apply a per-project pill border color, matching Hexfield Deck's tag color system. Tags without a configured color fall back to the default hexfield.colors.projectTag value. Per-project TextEditorDecorationType instances are cached by color and lazily created on first use. They are disposed on refreshColors() and on extension deactivation. The onDidChangeConfiguration watcher now also reacts to hexfield-deck.projects changes, triggering a re-decorate so tag colors update live when project config changes in Hexfield Deck. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Frames Hexfield Text as one component in a growing ecosystem anchored to a shared file format and shared configuration namespace. Documents the design principles (independently installable, loosely coupled, same file different views) and the current component roster alongside a reference for Hexfield Deck to mirror. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.mdfiles withtype: hexfield-plannerin YAML frontmatter are automatically promoted tohexfield-markdownlanguage mode (and demoted on removal, live, no reload)#project-tagtokens readhexfield-deck.projects.<name>.colorfrom VS Code settings; pill border rendered in the configured colorhexfield.colors.*, shared with Hexfield DeckTest plan
examples/weekly-planner.md— language mode shows Hexfield Markdown#hexfield→ blue)!!!red,!!yellow,!greenest:2h,est:30m)[/])type: hexfield-plannerfrom frontmatter — language mode reverts to Markdown, colors gone, no reload neededtype: hexfield-planner— language mode promotes back, colors returnhexfield.colors.*setting — colors update live with no reload🤖 Generated with Claude Code