Skip to content

refactor: rename DrawObject to Renderable#3

Merged
nberlette merged 12 commits intomainfrom
refactor/renderables
Feb 16, 2026
Merged

refactor: rename DrawObject to Renderable#3
nberlette merged 12 commits intomainfrom
refactor/renderables

Conversation

@nberlette
Copy link
Copy Markdown
Owner

  • 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

Copilot AI review requested due to automatic review settings February 16, 2026 19:05
@nberlette nberlette added the feature New feature or request label Feb 16, 2026
@nberlette nberlette self-assigned this Feb 16, 2026
@nberlette nberlette merged commit 428f638 into main Feb 16, 2026
4 of 6 checks passed
@nberlette nberlette deleted the refactor/renderables branch February 16, 2026 19:06
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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/DrawObjectOptions to Renderable/RenderableOptions in the canvas layer.
  • Update components to use the new “renderable” terminology in helper methods (e.g., #fill*Renderables).
  • Update deno.json exports 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.

Comment on lines 7 to 11
"./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",
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

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

./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.

Copilot uses AI. Check for mistakes.
* DrawObject that's responsible for rendering text.
* Renderable that's responsible for rendering text.
*
* Keep in mind its not designed to render mutliline text!
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

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

Typo in the doc comment: "mutliline" should be "multiline".

Suggested change
* Keep in mind its not designed to render mutliline text!
* Keep in mind its not designed to render multiline text!

Copilot uses AI. Check for mistakes.
* DrawObject that's responsible for rendering text.
* Renderable that's responsible for rendering text.
*
* Keep in mind its not designed to render mutliline text!
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

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

Grammar in the doc comment: "its not" should be "it's not".

Suggested change
* Keep in mind its not designed to render mutliline text!
* Keep in mind it's not designed to render multiline text!

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants