fix: preserve YAML comments/order in capa add (#93) and pointer cursor on buttons (#92)#96
Merged
Conversation
… buttons Fixes #93: `capa add` re-serialized the entire capabilities file via js-yaml dump(), discarding user comments and rearranging keys. Add a comment-preserving appendCapabilityEntry() backed by the round-trip `yaml` parser and route all `capa add` write paths through it, so new entries are appended in place without touching the rest of the file. Fixes #92: buttons in the web UI had no pointer cursor on hover. Add a global base-layer rule giving interactive elements cursor:pointer (and not-allowed when disabled). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ea58179 to
70c5ea6
Compare
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
Fixes the two most severe open bugs:
capa addre-serialized the entirecapabilities.yamlthroughjs-yaml'sdump(), which deleted user comments and rearranged keys. Introduces a comment-preservingappendCapabilityEntry()(backed by the round-tripyamlparser) and routes everycapa addwrite path (registry skill/plugin,--plugin, default skill) through it. New entries are appended in place; the rest of the file is left byte-for-byte intact. JSON files keep their existing parse/stringify path.button/[role=button]/label[for]/summarycursor: pointer, andnot-allowedwhen disabled — covering all buttons since there's no shared Button component.Changes
src/shared/capabilities.ts— newappendCapabilityEntry()usingyamlparseDocumentfor round-trip preservation.src/cli/commands/add.ts— all write sites now append in place instead of full re-dump.web-ui/src/index.css— global cursor rules for interactive elements.yamldependency.Test plan
capabilities.test.tsassert comments + key order survive, missing sections are created, and JSON append works.bun test→ 1019 pass / 0 fail.bunx tsc --noEmitclean.bun run build:websucceeds (CSS compiles).🤖 Generated with Claude Code