refactor: rename DrawObject to Renderable#3
Conversation
nberlette
commented
Feb 16, 2026
- chore: fmt
- refactor(component)!: rename DrawObject to Renderable
- refactor(canvas)!: rename DrawObject to Renderable
- refactor(canvas)!: rename DrawObject to Renderable
- refactor(canvas)!: rename DrawObject to Renderable
- refactor(canvas)!: rename DrawObject to Renderable
- refactor(components)!: rename DrawObject to Renderable
- refactor(components)!: rename DrawObject to Renderable
- refactor(components)!: rename DrawObject to Renderable
- refactor(components)!: rename DrawObject to Renderable
- chore(canvas): delete old draw_object.ts file
- config: update exports in deno.json
There was a problem hiding this comment.
Pull request overview
Refactors the canvas/component rendering API by renaming the core DrawObject abstraction to Renderable, propagating the rename across canvas primitives and UI components, and updating package exports accordingly.
Changes:
- Rename
DrawObject/DrawObjectOptionstoRenderable/RenderableOptionsin the canvas layer. - Update components to use the new “renderable” terminology in helper methods (e.g.,
#fill*Renderables). - Update
deno.jsonexports and apply small formatting changes.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/components/textbox.ts | Renames internal update helper to #updateLineRenderables. |
| src/components/table.ts | Renames data-cell fill/pop helpers to *Renderables. |
| src/components/progressbar.ts | Renames smooth-progress fill/pop helpers to *Renderables. |
| src/components/label.ts | Renames text fill/pop helpers to *Renderables. |
| src/component.ts | Updates DrawnObjects typing to use Renderable. |
| src/canvas/text.ts | Switches TextObject base type/options to Renderable. |
| src/canvas/renderable.ts | Introduces/renames the base class and options to Renderable. |
| src/canvas/canvas.ts | Updates canvas collections and signatures to use Renderable. |
| deno.json | Updates public export map to expose ./canvas/renderable. |
| .github/FUNDING.yml | Formatting-only update. |
Comments suppressed due to low confidence (1)
src/canvas/renderable.ts:35
- The class doc comment still refers to "draw objects" even though the type has been renamed to
Renderable. Updating the wording here would keep the documentation consistent with the new API terminology.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "./canvas": "./src/canvas/mod.ts", | ||
| "./canvas/box": "./src/canvas/box.ts", | ||
| "./canvas/core": "./src/canvas/canvas.ts", | ||
| "./canvas/draw-object": "./src/canvas/draw_object.ts", | ||
| "./canvas/renderable": "./src/canvas/renderable.ts", | ||
| "./canvas/text": "./src/canvas/text.ts", |
There was a problem hiding this comment.
./canvas is still exported via ./src/canvas/mod.ts. That module currently re-exports ./draw_object.ts, which appears to be removed in this refactor, so consumers importing @nick/tui/canvas will get a resolution/build error. Update src/canvas/mod.ts to export ./renderable.ts (and remove the draw_object.ts export), or adjust the ./canvas export to point to a module that no longer references draw_object.ts.
| * DrawObject that's responsible for rendering text. | ||
| * Renderable that's responsible for rendering text. | ||
| * | ||
| * Keep in mind its not designed to render mutliline text! |
There was a problem hiding this comment.
Typo in the doc comment: "mutliline" should be "multiline".
| * Keep in mind its not designed to render mutliline text! | |
| * Keep in mind its not designed to render multiline text! |
| * DrawObject that's responsible for rendering text. | ||
| * Renderable that's responsible for rendering text. | ||
| * | ||
| * Keep in mind its not designed to render mutliline text! |
There was a problem hiding this comment.
Grammar in the doc comment: "its not" should be "it's not".
| * Keep in mind its not designed to render mutliline text! | |
| * Keep in mind it's not designed to render multiline text! |