[Draft/PoC] Architecture for async loadingtablelist (via jobservice)#936
Draft
SuperCoolPencil wants to merge 1 commit into
Draft
[Draft/PoC] Architecture for async loadingtablelist (via jobservice)#936SuperCoolPencil wants to merge 1 commit into
SuperCoolPencil wants to merge 1 commit into
Conversation
Signed-off-by: SuperCoolPencil <thesupercoolpencil@gmail.com>
1d45631 to
c07666a
Compare
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.
This PR introduces the
harbor jobservice(orharbor js) command suite, bringing the functionality of the Harbor Jobservice UI Dashboard directly to the terminal.While implementing these commands, I noticed some UX bottlenecks inherent to synchronous API calls in CLI applications. To resolve this, this PR introduces two new unified TUI abstractions (
loadingtableandlogviewer) that handle asynchronous data fetching, ensuring the terminal never freezes on slow network requests.I noticed there is already an active PR for the jobservice feature (#796), which is great! I am applying for the LFX TUI refactor mentorship, so instead of competing with that PR, I used the jobservice commands as a sandbox to build a Proof of Concept for the loadingtablelist abstraction mentioned in the LFX roadmap.
Technical Achievements:
loadingtable(pkg/views/base/loadingtable)A reusable async table component for Bubble Tea views. Key improvements include:
api.Get...calls.tea.Cmd, allowing the TUI to start instantly with a loading spinner while data is fetched in the background.queue clear) can now reuse the same component instead of switching between different views.logviewer(pkg/views/base/logviewer)A new async log viewer built on top of Charm’s
viewport.Model. Improvements include:for { time.Sleep() }loop used for streaming logs.--followmode now polls asynchronously usingtea.Tick.tea.WindowSizeMsg), and clean exits (Ctrl+C/q).Other Improvements:
JobActionconstants and type aliases for improved maintainability.This POC demonstrates how we can eliminate terminal blocking across the entire CLI by adopting this async pattern.