Skip to content

Conversation

@ndeloof
Copy link
Contributor

@ndeloof ndeloof commented Jan 15, 2026

What I did
Rewrote tty progress UI to be more deterministic regarding terminal width and height.
New logic is:

  1. use lineData struct to collect data to be formatted on terminal
  2. compute line width requirements and truncate resource ID / details if needed
  3. compute status and timer padding
  4. render lines

note: sub task rendering (layers details during push/pull) has been removed to keep this beast (relatively) simple.

I tried to make the code bit more structured to get a more deterministic rendering, still this is all based on manual padding computation and string concatenations... We should look into an alternative TUI using https://github.com/charmbracelet/bubbles or comparable

Related issue
fixes #13474

also fixes #10256 by dropping extra lines if terminal height is too low

(not mandatory) A picture of a cute animal, if possible in relation to what you did

@KiGamji
Copy link

KiGamji commented Jan 15, 2026

@ndeloof do you mind if I make my own PR with your patch and my approach included, preserving your authorship? I started to work on my approach here

@ndeloof ndeloof force-pushed the fix_progress_again branch from 1175c65 to 80c34f6 Compare January 16, 2026 16:07
@ndeloof
Copy link
Contributor Author

ndeloof commented Jan 16, 2026

updated (with a fix) and some tests added

@KiGamji
Copy link

KiGamji commented Jan 16, 2026

updated (with a fix) and some tests added

great to hear, I'ma test it later this evening


image image

btw, do you think this could make it into a release?

@gothicVI
Copy link

This seems to work on a wide terminal but not on one where the line is longer than the terminal is wide (dual monitor setup with one vertical):

Screenshot from 2026-01-16 18-25-30

@ndeloof
Copy link
Contributor Author

ndeloof commented Jan 16, 2026

not on one where the line is longer than the terminal is wide

this is the exact issue this PR expect to fix :'(
I can see line is 1 char tool long with timer unit s missing on the right, sounds like I missed something computing ID max lenght

@ndeloof ndeloof force-pushed the fix_progress_again branch from 80c34f6 to 0974167 Compare January 16, 2026 17:55
@ndeloof
Copy link
Contributor Author

ndeloof commented Jan 16, 2026

Found (yet another) but computing, as status alignment was computed without considering other status strings may have a distinct length 😅 - test case added

@gothicVI
Copy link

gothicVI commented Jan 16, 2026

This no longer truncates or messes up lines. I'll check some more and be back :)

EDIT: pulling and running works - also for multiple images

$ ./docker-compose pull
[+] pull 2/2
 ✔ Image debian:latest Pulled                                                                                    7.4s

$ ./docker-compose run -it --rm debian bash
[+]  1/1te 1/1
 ✔ Network build_default Created                                                                                 0.0s
Container build-debian-run-a7d669391344 Creating 
Container build-debian-run-a7d669391344 Created 
root@22ae48ef1546:/# 
exit

$ ./docker-compose pull
[+] pull 4/4
 ✔ Image ubuntu:latest Pulled                                                                                    2.4s
 ✔ Image debian:12     Pulled                                                                                    7.5s

However, there's no progress anymore. There is progress when building though:

$ ./docker-compose build
[+] Building 25.2s (15/15) FINISHED                                                                                   
 => [internal] load local bake definitions                                                                       0.0s
 => => reading from stdin 485B                                                                                   0.0s
 => [internal] load build definition from Dockerfile                                                             0.0s
 => => transferring dockerfile: 696B                                                                             0.0s
 => [internal] load metadata for docker.io/library/python:3.11-alpine                                            0.9s
 => [internal] load .dockerignore                                                                                0.0s
 => => transferring context: 2B                                                                                  0.0s
 => [1/8] FROM docker.io/library/python:3.11-alpine@sha256:c825a02ff096b3dc3d362015f9e9f6527f66b73e11f9ad2db1f0  3.3s
 => => resolve docker.io/library/python:3.11-alpine@sha256:c825a02ff096b3dc3d362015f9e9f6527f66b73e11f9ad2db1f0  0.0s
 => => sha256:9486ad61224dfa1149f3c1d33baa971820444d726e8216f078aedbe63dd6ecf7 460.95kB / 460.95kB               0.5s
 => => sha256:dfee10dbf18a68769db3aaaa1de22ab448cb5cac6c1f872bdcb47fea9951837d 16.02MB / 16.02MB                 2.5s
 => => sha256:bfff5caeedf0c509afd4899ead785f2da8b15d99b0ce9710509b37d363cf5dfa 248B / 248B                       0.3s
 => => sha256:c825a02ff096b3dc3d362015f9e9f6527f66b73e11f9ad2db1f0da4e09ba7030 10.30kB / 10.30kB                 0.0s
 => => sha256:a4a7d333cabaae1024b62e3943f87065cf95271e44c3f0e74c212a9a9ec3f75e 1.74kB / 1.74kB                   0.0s
 => => sha256:25c2968770d5086249e0866482eb88c9b2eb4b0fc8918a933cc4898edec1cdb6 5.27kB / 5.27kB                   0.0s
 => => extracting sha256:9486ad61224dfa1149f3c1d33baa971820444d726e8216f078aedbe63dd6ecf7                        0.1s
 => => extracting sha256:dfee10dbf18a68769db3aaaa1de22ab448cb5cac6c1f872bdcb47fea9951837d                        0.5s
 => => extracting sha256:bfff5caeedf0c509afd4899ead785f2da8b15d99b0ce9710509b37d363cf5dfa                        0.0s
 => [internal] load build context                                                                                0.0s
 => => transferring context: 582B                                                                                0.0s
 => [2/8] RUN addgroup -S dash && adduser -S dash -G dash                                                        0.2s
 => [3/8] WORKDIR /home/dash                                                                                     0.1s
 => [4/8] COPY --chown=dash:dash requirements.txt ./                                                             0.0s
 => [5/8] RUN pip install --user --no-cache-dir --upgrade pip                                                    2.9s
 => [6/8] RUN pip install --user --no-cache-dir -r requirements.txt                                             16.3s 
 => [7/8] COPY --chown=dash:dash ./main.py ./                                                                    0.0s 
 => [8/8] COPY --chown=dash:dash ./components ./components                                                       0.0s 
 => exporting to image                                                                                           1.4s 
 => => exporting layers                                                                                          1.3s 
 => => writing image sha256:88b0484ae3216aaa05e873928b22a8c4672d2763e2054a68f6d8f5d4e6471ef0                     0.0s 
 => => naming to docker.io/library/test:latest                                                                   0.0s 
 => resolving provenance for metadata file                                                                       0.0s
[+] build 1/1
 ✔ Image test:latest Built                                                                                      25.3s

@ndeloof
Copy link
Contributor Author

ndeloof commented Jan 16, 2026

.. then found another issue in test due to len(string) not using runes but bytes, and making assertion wrong.
Getting closer to an actual fix with test coverage

@ndeloof ndeloof force-pushed the fix_progress_again branch from 0974167 to edbf4e3 Compare January 16, 2026 18:35
@KiGamji
Copy link

KiGamji commented Jan 16, 2026

This works for me, at least when the window is not resized.
Here's what is happening when I resize the window:
image

@KiGamji
Copy link

KiGamji commented Jan 16, 2026

image image

btw, do you think this could make it into a release as a different improved approach?

cc @ndeloof

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Pulling TUI mixes up lines [BUG] TUI spams lines when container count is larger than terminal height

3 participants