Skip to content

logo: add openapi piece (fixes #35) - #41

Open
bluzername wants to merge 5 commits into
bas3line:mainfrom
bluzername:add-openapi-logo
Open

bluzername wants to merge 5 commits into
bas3line:mainfrom
bluzername:add-openapi-logo

Conversation

@bluzername

@bluzername bluzername commented Oct 9, 2026 •

Copy link
Copy Markdown

Fixes #35.

What this add

A new piece openapi, the OpenAPI Initiative gauge mark (green dial, dark pointer). It follow the same pattern as cloudflare.ts and python.ts: one shape grid, a palette index per cell, and the shared glint animation from those pieces.

How I made the art

I did not trace it by hand. I write a small script (not part of this PR, same as other pieces here) that sample the mark's own icon into a 46x23 grid. Each cell get a density character from how much ink cover it, and a colour index from the nearest of 4 colours taken from the image itself (dark pointer, two green, olive). The dark pointer is lifted for the dark page, same as how other pieces lift pure black so it is not lost on dark background.

Checks

  • npm run check - 217 pieces, all ok (one new)
  • npm run typecheck - clean
  • npm run build - clean
  • npm run gen - regenerated src/pieces/index.ts and src/library.ts

Before the piece file exist, node scripts/check.ts openapi fail with "no file src/pieces/openapi.ts". After I add it, it say "ok openapi logos 46x23 30fps" and --show render a dial with a pointer that look like the real logo, checked by eye.

One small gotcha I hit while building this: npm run check only checks the contract (size, charset, no randomness, deterministic frames). It does not check if the picture actually look right. I had a bug first where my background threshold was wrong and the whole grid came out solid - check still said "ok" for it. So I always look at --show output too, not only the check result.

The mark is a trademark of its owner. It is shown here only to name the specification, same note other pieces in this repo already have.

Happy to adjust resolution, colours or the note text if you want something different.

Summary by CodeRabbit

  • New Features
    • Added an OpenAPI logo that can be displayed on the canvas, with optional color and animated shine effects.

@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 471dd4c4-0036-4d9e-a773-47f43ff06a31
📥 Commits

Reviewing files that changed from the base of the PR and between 653e622 and 22edaa7.

📒 Files selected for processing (3)
  • src/library.ts
  • src/pieces/index.ts
  • src/pieces/openapi.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

Adds an OpenAPI logo piece with monochrome and colored frame output, optional animated glints, and library registration.

Changes

OpenAPI logo

Layer / File(s) Summary
Logo artwork and frame generation
src/pieces/openapi.ts
Adds OpenAPI logo metadata, monochrome and colored artwork, and frame generation. Positive shine values enable glints that cross the logo; nonpositive values disable them.
Piece registration
src/library.ts, src/pieces/index.ts
Adds openapi to the lazy-load registry, canvas-rendered piece set, and named exports.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Suggested reviewers: bas3line

Merge Risk: ⚪ Minimal · up to 22eda

The OpenAPI mark renders recognizably and is registered for library loading and canvas use; no material merge risk is established.

🚥 Pre-merge checks | ✅ 6 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (6 passed)
Check name Status Explanation
Title check Passed The title clearly identifies the main change: adding the OpenAPI piece. It is concise and references the linked issue.
Description check Passed The description explains the new piece, implementation approach, validation steps, and visual verification. It omits the exact "## Summary" and "## Risk and rollback" template sections, but it is othe…
Linked Issues check Passed The description references issue #35 with "Fixes #35," and the implementation directly addresses the requested OpenAPI logo piece.
Out of Scope Changes check Passed The changes are limited to adding the OpenAPI piece and registering its exports. They align with the pull request objective and do not indicate unrelated scope.
Linked Issues check Passed Issue #35 requests an OpenAPI logo piece. src/pieces/openapi.ts adds an OpenAPI gauge mark with logo metadata, a 46×23 frame, green and pointer colors, and the glint animation. src/pieces/index.ts…
Out of Scope Changes check Passed The reported changes are limited to the new openapi piece and its generated export and library registrations. The registrations support issue #35. No unrelated product or behavior changes are identi…
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Closes bas3line#35. Adds a new ascii.rest piece for the OpenAPI Initiative's
gauge mark: a green segmented dial with a dark pointer, following the
same drawing style as the existing company/logo pieces (cloudflare,
vercel, python): one shape grid, a per-cell palette index, and the
shared "glint" animation.

The art is not hand-traced. It is generated by sampling the mark's own
published icon onto a 46x23 grid: each cell gets a density character
from its ink coverage and the nearest of 4 colours sampled from the
source image (dark pointer, two greens, olive). The dark pointer is
lifted on a dark page the same way other pieces lift pure black, so it
does not sink into the background. Generation script is not part of
this PR, only its output, same as the rest of the pieces in this repo.

Testing: npm run check passes for all 217 pieces (one new), npm run
typecheck and npm run build are clean, and npm run gen regenerated
src/pieces/index.ts and src/library.ts for the new piece. Before this
change, npm run check -- openapi fails with "no file src/pieces/
openapi.ts"; after, it reports the piece ok with cols/rows/fps as
expected, and --show renders a recognizable dial and pointer.

The OpenAPI mark is a trademark of its owner, shown here only to name
the specification, same disclaimer as other company/logo pieces in
this repo.
@vercel

vercel Bot commented Oct 15, 2026

Copy link
Copy Markdown

@bluzername is attempting to deploy a commit to the Shubham Team on Vercel.

A member of the Team first needs to authorize it.

@bluzername

Copy link
Copy Markdown
Author

Rebase onto current main. No change to the piece itself, just regenerate library.ts and pieces/index.ts with npm run gen so it include openapi without losing the pieces added since. check/typecheck/build all still clean (237/237).

@greptile-apps

greptile-apps Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Make sure you do the changes Sensei

RetriggerView in GreptileConfidence Score: 4/5

[Low impact] The change adds one optional logo to the piece catalog.

The PR still needs the generated files under skills/ committed before it can pass CI.

Findings

  1. P1 Missing generated files fail CI ▶
Fix with agent prompt
### Issue 1
src/library.ts:undefined-159
Adding `openapi` without updating `skills/` makes CI fail. `npm run gen` also rebuilds the skill catalog and its piece count, but the committed catalog still skips from `ocaml` to `perl`. CI runs the generator and rejects any changes in `skills/`.

Run `npm run gen` on this branch and commit all generated files.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Adds the OpenAPI gauge logo as openapi.

  • Callers can display the OpenAPI gauge as text or colored canvas art.

Reviews (5) · Last reviewed commit: "Merge remote-tracking branch 'upstream/m..." · Reviewed by Greptile

Comment thread src/pieces/openapi.ts Resolved
rows was 23, but the MONO/ART/INK blocks give 25 lines after the
blank padding row above and below. render loop only read up to
row 22, so it draw the blank top row plus 21 content rows and skip
the last one. set rows to 25, same convention every other piece use.
@bluzername

Copy link
Copy Markdown
Author

Good catch, confirmed and fixed in d1f7b90. meta.rows was 23 but MONO/ART/INK give 25 line after the blank padding row above and below (same as every other piece in src/pieces, they all set rows to the exact line count). With rows at 23 the render loop only read up to the second-to-last content row, so the bottom of the dial never draw. Set rows to 25, no change to the artwork itself. check/typecheck/build all still clean (237/237), openapi now report 46x25.

@DavidBiesack

Copy link
Copy Markdown

Thanks for the contribution. I don't see this logo on ascii.rest nor does this snippet work.

<html>
<head> <script type="module" src="https://ascii.rest/ascii.js"></script> </head>
<body><ascii-art piece="openpi"></ascii-art></body>
</html>

Is deploying the web site (so the script tag gets the update) done through another repo or issue?

@bluzername

Copy link
Copy Markdown
Author

Thanks for check it. Two separate thing here I think:

  1. The piece name is openapi, not openpi - small typo in your snippet, one letter missing. With piece="openapi" it should draw.
  2. Even with correct name it will not show on ascii.rest site yet, because this PR is not merged. From .github/workflows/release.yml I see the site script (ascii.rest/ascii.js) come from the npm package, and that package only publish when a v* tag is pushed after merge. So new piece reach the live site after merge + next release tag, not from the PR branch itself. Same thing is probably true for 42 (charming) too.

This branch is also behind main now (few new pieces landed since Oct 15), so it need a rebase before merge - happy to do that once ready.

Comment thread src/pieces/index.ts Resolved
Comment thread src/library.ts
"ocaml": () => import("./pieces/ocaml.ts"),
"ocean-sunset": () => import("./pieces/ocean-sunset.ts"),
"omarchy": () => import("./pieces/omarchy.ts"),
"openapi": () => import("./pieces/openapi.ts"),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Missing generated files fail CI

Adding openapi without updating skills/ makes CI fail. npm run gen also rebuilds the skill catalog and its piece count, but the committed catalog still skips from ocaml to perl. CI runs the generator and rejects any changes in skills/.

Run npm run gen on this branch and commit all generated files.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/library.ts
Line: 158

Comment:
**Missing generated files fail CI**

Adding `openapi` without updating `skills/` makes CI fail. `npm run gen` also rebuilds the skill catalog and its piece count, but the committed catalog still skips from `ocaml` to `perl`. CI runs the generator and rejects any changes in `skills/`.

Run `npm run gen` on this branch and commit all generated files.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

@DavidBiesack

Copy link
Copy Markdown

Thanks for check it. Two separate thing here I think:

  1. The piece name is openapi, not openpi - small typo in your snippet, one letter missing. With piece="openapi" it should draw.

I fixed my snippet but it still does not show anything (and nothing in the console)

<html>
  <head>
    <title>ASCII.rest - openapi</title>
    <script type="module" src="https://ascii.rest/ascii.js"></script>
  </head>
<body><ascii-art piece="openapi"></ascii-art></body>
</html>

My HTML works if I use `piece="rust"` so it is just openapi that is failing.
I guess I need to wait for a new release to publish.

I suggest the `<ascii-art>` tag render an error (or a "no-such-piece") logo if it does not recognize the `piece=` attribute, so that it's clearer what is wrong.

@bluzername

Copy link
Copy Markdown
Author

Ah I see, sorry for confuse you. It is not a bug in the piece, it is because this PR is not merged yet, so ascii.rest (production) still serve the old bundle without openapi. The branch checks above also show it: Vercel preview deploy needs your team authorization to run (Authorization required to deploy), so there is no preview link to test against neither, only the production site which do not have this piece yet.

Once this get merged and a new version is published, piece="openapi" will draw same as piece="rust" does for you now. Nothing more to fix on my side here, just waiting on merge + release.

Your idea of a "no-such-piece" fallback render for unknown piece= values is a good one, separate from this PR though (it is a library-wide behavior, not specific to this piece) - happy to open that as its own small PR if you want it, so this one stays focused on just adding the logo.

This branch has not been deployed

No deployments
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.

logo: OpenAPI

2 participants