Skip to content

fixed cli mascots and horizontal formatting#20

Merged
Junaid2005 merged 16 commits into
Junaid2005:mainfrom
AbdulAaqib:main
Apr 7, 2026
Merged

fixed cli mascots and horizontal formatting#20
Junaid2005 merged 16 commits into
Junaid2005:mainfrom
AbdulAaqib:main

Conversation

@AbdulAaqib

@AbdulAaqib AbdulAaqib commented Apr 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Fixed CLI mascot display and responsive horizontal formatting in ccrewind-tui.ts
  • Converted generate-variants.js to generate-variants.ts with ES module imports to match ccrewind-tui.ts style
  • Reverted upload screen rename — component is back to UploadScreen.tsx with correct import in page.tsx
  • Added scripts/mascots-ansi.ts — pre-generated ANSI art bundled into the CLI at build time

AbdulAaqib and others added 12 commits April 3, 2026 22:22
…e fix

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds chafa-based ANSI art rendering to the character reveal section of
the TUI. Resolves the mascot PNG from public/mascots/ relative to the
bundle (works in both repo and npm-installed contexts). Gracefully
falls back to text-only layout when chafa is not installed.

Install chafa to enable: brew install chafa / sudo apt install chafa

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Convert all 9 character mascot PNGs to ANSI 256-color half-block art at
build time using PIL. The resulting ANSI strings are embedded statically
in mascots-ansi.ts and bundled into dist/ccrewind-tui.mjs.

- scripts/generate-mascot-art.py  — regenerates mascots-ansi.ts when mascots change
- scripts/mascots-ansi.ts         — auto-generated static ANSI art map (~60KB)
- renderCharacterReveal()         — directly reads from MASCOT_ART, no runtime deps

Bundle size: 42KB → 137KB (95KB added for all 9 images)
Zero runtime dependencies required.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Regenerated all 9 ANSI mascots at 70×35 (up from 46×22) with
auto-detected background transparency — pixels within euclidean
distance 30 of the sampled corner colour are treated as transparent,
so the mascot renders against the user's own terminal background.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Switched from 256-color palette to 24-bit RGB escape codes
(\x1b[38;2;R;G;Bm) — eliminates color banding entirely.
Increased resolution to 90×45 (up from 70×35).
Bundle: 170KB → 452KB.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace per-pixel distance check with a flood fill from all edge pixels.
Only pixels connected to the image border are treated as transparent —
dark interior pixels (shadows, clothing) are preserved even if they're
close to the background colour.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Keeps true-color 24-bit + flood-fill transparency, just smaller.
Bundle: 460KB → 210KB.

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>
…ropped mascot art

- TUI now fills terminal width (COL_WIDTH = process.stdout.columns)
- Table rows stacked: name on own line, bar + stats indented below
- Bar widths scale dynamically to fill available width
- Header/footer/section dividers all match terminal width
- One-liner wraps at terminal width
- Calendar day cells spaced out for readability
- Tool entries have blank line between each for breathing room
- Mascot art blank lines trimmed from top and bottom

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@AbdulAaqib
AbdulAaqib requested a review from Junaid2005 as a code owner April 5, 2026 23:16
@vercel

vercel Bot commented Apr 5, 2026

Copy link
Copy Markdown

@AbdulAaqib is attempting to deploy a commit to the junaid2005's projects Team on Vercel.

A member of the Team first needs to authorize it.

Comment thread next.config.ts Outdated
@@ -160,111 +160,61 @@ function PreviewCards() {
}

function TabContentNPM({ active }: { active: boolean }) {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

dont rename the file

send a picture of the change pls

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

image

there was no visual or feature changes, it just a filename thing

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

keep name to as it was orginally

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, i changed it to the original

Comment thread scripts/generate-mascot-art.py Outdated
@@ -0,0 +1,202 @@
#!/usr/bin/env python3

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

rewrite in ts pls

were adding a python dep (okay maybe the user has it) but then on top were adding a pillow dep - not a smooth ux if they dont have it

Comment thread scripts/generate-variants.js Outdated
@@ -0,0 +1,568 @@
const fs = require('fs');

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

rewrite in ts to match ccrewind-tui.ts

Comment thread scripts/mascots-ansi.ts Outdated
@@ -0,0 +1,95 @@
// AUTO-GENERATED by scripts/generate-mascot-art.py — do not edit manually

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

can this be done at runtime? is it needed to hardcode into the repo?

@Junaid2005

Copy link
Copy Markdown
Owner

add pr descriptions pls (or ai generate) or write concisely

AbdulAaqib and others added 2 commits April 7, 2026 02:21
… screen rename

- Convert generate-variants.js → generate-variants.ts (ES module imports, fileURLToPath)
- Rewrite generate-mascot-art.py → generate-mascot-art.ts using jimp (removes Python/Pillow dep)
- Update mascots-ansi.ts header comment to reference .ts script
- Add jimp as devDependency
- Revert UploadScreenV3.tsx rename back to UploadScreen.tsx, fix page.tsx import

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…pe annotations

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedjimp@​1.6.0981008582100

View full report

Comment thread tsconfig.json
"exclude": [
"node_modules"
"node_modules",
"scripts"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

why? the scripts dir is ts

Comment thread scripts/mascots-ansi.ts
@@ -0,0 +1,94 @@
// AUTO-GENERATED by scripts/generate-mascot-art.ts — do not edit manually

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

i thought this was going to be generated on runtime, doesnt need to be in pr

@Junaid2005
Junaid2005 merged commit 565bcdb into Junaid2005:main Apr 7, 2026
3 of 4 checks passed
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.

2 participants