fix(plugin): make Tiny Actor preview use width-safe renderer and grid pipeline (#1303)#1314
Merged
Merged
Conversation
… pipeline (#1303) Replace manual _render_card_lines/_arrange_cards_horizontal with the display-width-safe render_card() + layout_grid() pipeline, eliminating naive string slicing and .center() that could break CJK/ANSI alignment. - Import render_card from tiny_actor_renderer and layout_grid from tiny_actor_grid - Remove 52 lines of duplicate rendering logic - Update test to use display_width() instead of len() for width assertion
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
JeremyDev87
commented
Apr 4, 2026
JeremyDev87
left a comment
Owner
Author
There was a problem hiding this comment.
Review: ✅ APPROVE
CI Status: ALL PASS
Code Quality:
- preview.py: Removed ~50 lines of manual rendering (_render_card_lines, _arrange_cards_horizontal)
- Pipeline integration: Now uses
render_card()→layout_grid()— proper width-safe pipeline - Tests: Updated width assertion from
len(line)todisplay_width(line)for Unicode correctness - Feature flag preserved: CODINGBUDDY_TINY_ACTORS behavior unchanged
Key improvement:
- Before: naive
center(width)+str[:width]slicing (breaks CJK/ANSI) - After:
render_card()+layout_grid()(display-width-safe)
✅ Preview now uses the full Tiny Actor rendering pipeline.
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
_render_card_lines()/_arrange_cards_horizontal()with the display-width-saferender_card()+layout_grid()pipelinedisplay_width()instead oflen()for correct Unicode width measurementCloses #1303
Test plan
python3 -m pytest tests/test_tiny_actor_preview.py -v— 14/14 passedpython3 -m pytest tests/ -v— 651/651 passedtsc --noEmit— cleanvitest run— 5893 passed