feat: add progress_path helper with basic tests#232
feat: add progress_path helper with basic tests#232Gitkbc wants to merge 1 commit intolunarmodules:mainfrom
Conversation
eb1fdcd to
187b6d6
Compare
src/terminal/progress.lua
Outdated
|
|
||
| local percent_str = string.format("%3d%%", percent) | ||
|
|
||
| return "\27[K" .. bar .. " " .. percent_str |
There was a problem hiding this comment.
these hardcoded ansi sequences will mess with the stacks. ALso should we be displaying percentages? none of the others does that.
Maybe we can make that a higher level progress bar, something in the CLI namespace
187b6d6 to
de7dcda
Compare
|
Updated: removed the hardcoded ANSI sequence and percentage display. Fixed whitespace to match the rest of the spec file. |
Tieske
left a comment
There was a problem hiding this comment.
I have some doubt on this one. I like the idea, the graphical display.
But my doubts are on the design, it is completely different from the others. Take a look at the 'ticker' one, right below. That does a similar thing, but it generates a sequence that can be used like a sprite (similar to all others)
wdyt?
| -- progress_path(40, 20, "📍", "🚙") | ||
| -- | ||
| -- Output example: | ||
| -- 📍........🚙 40% |
There was a problem hiding this comment.
still showing percentage in example
| -- @tparam string start_icon icon at the start position | ||
| -- @tparam string runner_icon icon representing the runner/progress |
There was a problem hiding this comment.
these 2 are optional, but don't have their defaults documented
|
@Tieske Sir Thanks for the review! My original thinking: Refactoring it to return a sequence of frames (like ticker) makes it much more consistent and flexible. I am going to go ahead and refactor it in that direction so it matches the architecture. I'll also clean up the docstring (remove the old percentage example and document defaults) in the same update. |
Adds a simple
progress_pathhelper to render a left-to-right progress animation.Includes basic tests to verify:
Kept the implementation minimal (based on feedback from #226) & consistent with existing progress utilities.