Skip to content

docs: Canvas Candy full class catalogue — gap analysis#32

Open
LeslieOA wants to merge 1 commit into
developfrom
docs/canvas-candy-catalogue
Open

docs: Canvas Candy full class catalogue — gap analysis#32
LeslieOA wants to merge 1 commit into
developfrom
docs/canvas-candy-catalogue

Conversation

@LeslieOA

Copy link
Copy Markdown
Member

Summary

Adds docs/canvas-candy-catalogue.md (~180 lines). Resolves the research portion of #19. The doc enumerates every cc-* class the upstream TfTHacker/obsidian-canvas-candy plugin defines, compares against our baseline implementation, marks each as already supported / gap / deliberate-skip, and proposes a 4-issue split for the residual code work.

This PR is not a commitment to start coding. It's the research output that lets you decide which gaps are worth closing and which to leave skipped.

Headline finding

#19 was sized L because most of the cost was research. After cataloguing, the residual code work is:

Sub-issue Size
cc-shape-parallelogram alias XS
cc-image-cover for text / file nodes S
cc-image-clip (new render primitive) M
Doc: skipped callout-zone classes XS

Total ≈ S. Not L. The catalogue resolves most of the original sizing.

What's already supported (28 classes)

All shapes, all card fills, all 11 borders, every gradient angle (we use a regex; upstream documents only 8 specific angles), every rotation angle, text alignment. We're actually more permissive than upstream in three places (gradient, card rotation, text rotation) — see §6 of the doc.

What's a real gap (3 classes)

Class Effect Feasibility
cc-shape-parallelogram Alias for -left (probably) XS — one switch case
cc-image-cover Image fills container area S — reuses existing backgroundStyle:'cover' Skia path
cc-image-clip Image clipped to card outline M — new render primitive in SkiaImageRenderer

What's deliberate-skip (9 classes)

cc-header / cc-footer / cc-label-{left,right} and their -noborder variants. These are upstream's CSS-class mechanism for zone-style callouts; we already expose the same zones via block syntax in extensions/callouts.ts. Supporting both mechanisms for the same visual effect doubles the maintenance surface and confuses consumers about which to use.

Open question in the doc: is skip correct, or do you want both supported for import-compatibility with canvases authored in vanilla Obsidian?

Four open questions for you (full list in §8 of the doc)

  1. Confirm skip on the 9 callout-zone CSS classes (or want both mechanisms)?
  2. Verify cc-shape-parallelogram default direction matches our -left?
  3. Priority order on the 3 feature gaps?
  4. File sub-issues now or wait for consumer demand?

Verification

Note on #20 (file-node :has() design)

That's a separate issue tracking the architecturally distinct mechanism (frontmatter inside an embedded .md file referenced as a file-type node). The 9 callout-zone classes I'm marking as skip here are not the :has() mechanism — they're a parallel CSS-class path that overlaps with our block-syntax callouts. #20 stays its own thing.

Refs: #19

#19 was sized L because most of the cost was *research*: read the
upstream plugin, enumerate every cc-* class, compare against our
baseline, decide which are gaps worth closing. This commit does that
research as a single doc and proposes a sub-issue split that turns
the residual code work into S / XS chunks.

Source for the upstream catalogue:
github.com/TfTHacker/obsidian-canvas-candy — specifically
04 List of Decorations.md, the canonical class index.

Findings

Already supported (28 classes): all shapes, all card fill, all
borders, all 8 documented gradient degrees plus any integer via our
regex, all rotation classes plus any integer via our regex, text
alignment.

Net new gaps (3 classes worth implementing):

  cc-shape-parallelogram  — alias for -left, XS direct port
  cc-image-cover          — S direct port, reuses existing
                            backgroundStyle:'cover' Skia path
  cc-image-clip           — M new render primitive, needs card-shape
                            clip plumbed into SkiaImageRenderer

Deliberate-skip candidates (9 classes): cc-header / cc-footer /
cc-label-{left,right} and their -noborder variants. These are
upstream's CSS-class mechanism for zone-style callouts; we already
expose the same zones via block syntax in extensions/callouts.ts.
Supporting both mechanisms doubles the maintenance surface for the
same visual effect. Doc recommends documenting the mismatch and
optionally adding an import-time conversion pass rather than parallel
support — open question for the maintainer.

Where we're more permissive than upstream (no work needed):

  gradient deg     — upstream documents 8 multiples of 45°; we accept
                     any integer via regex
  card rotation    — upstream documents only -45; we accept any int
  text rotation    — upstream documents 8 multiples of 45°; we accept
                     any int plus an undocumented trailing 'l' variant

Open questions enumerated at the end of the doc:

  1. Confirm skip on 9 callout-zone CSS classes
  2. Verify cc-shape-parallelogram default direction (-left vs -right)
  3. Priority order for the 3 feature gaps
  4. File sub-issues now or wait for consumer demand?

Proposed sub-issue split (post-review):

  feat(candy): cc-shape-parallelogram alias                  XS
  feat(candy): cc-image-cover for text / file nodes          S
  feat(candy): cc-image-clip (card-shape image clipping)     M
  docs(candy): document skipped callout-zone classes         XS

Total code work is closer to S after split — most of #19's original
L sizing was this research, now resolved.

No code changes. Library checks pass on this branch (38/38 tests,
typecheck clean, lint exit 0).

Refs: #19

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant