-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Bug where one progress bar display is missing. #52
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,3 +27,4 @@ localstack | |
/cfn | ||
.envrc | ||
/t-rec* | ||
/s3hub-download |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -125,7 +125,13 @@ func (m *s3hubListBucketModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { | |||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||
m.sum = len(m.targetBuckets) + 1 | ||||||||||||||||||||||||||||||||
m.status = statusDownloading | ||||||||||||||||||||||||||||||||
return m, tea.Batch(m.spinner.Tick, downloadS3BucketCmd(m.ctx, m.app, m.targetBuckets[0])) | ||||||||||||||||||||||||||||||||
progressCmd := m.progress.SetPercent(float64(m.index) / float64(m.sum-1)) | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
return m, tea.Batch( | ||||||||||||||||||||||||||||||||
m.spinner.Tick, | ||||||||||||||||||||||||||||||||
progressCmd, | ||||||||||||||||||||||||||||||||
tea.Printf("%s %s", checkMark, m.targetBuckets[0]), | ||||||||||||||||||||||||||||||||
downloadS3BucketCmd(m.ctx, m.app, m.targetBuckets[0])) | ||||||||||||||||||||||||||||||||
Comment on lines
+129
to
+135
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The progress bar's percentage calculation does not account for the initial state before any download starts, potentially leading to an inaccurate display. Consider initializing the progress bar to reflect the starting state accurately. + m.index = 0 // Initialize index to 0 to accurately represent the starting state of progress.
progressCmd := m.progress.SetPercent(float64(m.index) / float64(m.sum-1)) Committable suggestion
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I Fix it. See 1fd8a10 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nao1215 Thank you for the update! To confirm the fix, please ensure that the If you found this review helpful, would you consider giving us a shout-out on X? |
||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||
case "D": | ||||||||||||||||||||||||||||||||
if m.status == statusBucketListed { | ||||||||||||||||||||||||||||||||
|
@@ -135,7 +141,12 @@ func (m *s3hubListBucketModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { | |||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||
m.sum = len(m.targetBuckets) + 1 | ||||||||||||||||||||||||||||||||
m.status = statusBucketDeleting | ||||||||||||||||||||||||||||||||
return m, tea.Batch(m.spinner.Tick, deleteS3BucketCmd(m.ctx, m.app, m.targetBuckets[0])) | ||||||||||||||||||||||||||||||||
progressCmd := m.progress.SetPercent(float64(m.index) / float64(m.sum-1)) | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
return m, tea.Batch(m.spinner.Tick, | ||||||||||||||||||||||||||||||||
progressCmd, | ||||||||||||||||||||||||||||||||
tea.Printf("%s %s", checkMark, m.targetBuckets[0]), | ||||||||||||||||||||||||||||||||
deleteS3BucketCmd(m.ctx, m.app, m.targetBuckets[0])) | ||||||||||||||||||||||||||||||||
Comment on lines
+146
to
+151
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The progress bar's percentage calculation does not account for the initial state before any deletion starts, potentially leading to an inaccurate display. Consider initializing the progress bar to reflect the starting state accurately. + m.index = 0 // Initialize index to 0 to accurately represent the starting state of progress.
progressCmd := m.progress.SetPercent(float64(m.index) / float64(m.sum-1)) Committable suggestion
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I Fix it. See 1fd8a10 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nao1215, thank you for addressing the feedback and making the necessary changes. To ensure everything is in order, could you please confirm if the initialization of the progress bar's index to accurately represent the starting state before any deletion starts has been added as suggested? If you've followed the suggestion accurately, then everything should be set correctly. 🐇 If you found this review helpful, would you consider giving us a shout-out on X? |
||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||
case "enter": | ||||||||||||||||||||||||||||||||
if m.status == statusReturnToTop || m.status == statusDownloaded || m.status == statusBucketDeleted { | ||||||||||||||||||||||||||||||||
|
@@ -432,7 +443,12 @@ func (m *s3hubListS3ObjectModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { | |||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||
m.sum = len(m.targetS3Keys) + 1 | ||||||||||||||||||||||||||||||||
m.status = statusDownloading | ||||||||||||||||||||||||||||||||
return m, tea.Batch(m.spinner.Tick, downloadS3ObjectsCmd(m.ctx, m.app, m.bucket, m.targetS3Keys[0])) | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
progressCmd := m.progress.SetPercent(float64(m.index) / float64(m.sum-1)) | ||||||||||||||||||||||||||||||||
return m, tea.Batch(m.spinner.Tick, | ||||||||||||||||||||||||||||||||
progressCmd, | ||||||||||||||||||||||||||||||||
tea.Printf("%s %s", checkMark, m.targetS3Keys[0]), | ||||||||||||||||||||||||||||||||
downloadS3ObjectsCmd(m.ctx, m.app, m.bucket, m.targetS3Keys[0])) | ||||||||||||||||||||||||||||||||
Comment on lines
+449
to
+454
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The progress bar's percentage calculation does not account for the initial state before any download starts, potentially leading to an inaccurate display. Consider initializing the progress bar to reflect the starting state accurately. + m.index = 0 // Initialize index to 0 to accurately represent the starting state of progress.
progressCmd := m.progress.SetPercent(float64(m.index) / float64(m.sum-1)) Committable suggestion
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I Fix it. See 1fd8a10 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nao1215, I've reviewed the changes in commit
Analysis chainScripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Fetch the changes made in the commit 1fd8a10 for the file ui/s3hub/list.go
git show 1fd8a10:ui/s3hub/list.go
Length of output: 19950 If you found this review helpful, would you consider giving us a shout-out on X? |
||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||
case "D": | ||||||||||||||||||||||||||||||||
if m.status == statusS3ObjectListed { | ||||||||||||||||||||||||||||||||
|
@@ -442,7 +458,12 @@ func (m *s3hubListS3ObjectModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { | |||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||
m.sum = len(m.targetS3Keys) + 1 | ||||||||||||||||||||||||||||||||
m.status = statusS3ObjectDeleting | ||||||||||||||||||||||||||||||||
return m, tea.Batch(m.spinner.Tick, deleteS3ObjectCmd(m.ctx, m.app, m.bucket, m.targetS3Keys[0])) | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
progressCmd := m.progress.SetPercent(float64(m.index) / float64(m.sum-1)) | ||||||||||||||||||||||||||||||||
return m, tea.Batch(m.spinner.Tick, | ||||||||||||||||||||||||||||||||
progressCmd, | ||||||||||||||||||||||||||||||||
tea.Printf("%s %s", checkMark, m.targetS3Keys[0]), | ||||||||||||||||||||||||||||||||
deleteS3ObjectCmd(m.ctx, m.app, m.bucket, m.targetS3Keys[0])) | ||||||||||||||||||||||||||||||||
Comment on lines
+465
to
+470
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The progress bar's percentage calculation does not account for the initial state before any deletion starts, potentially leading to an inaccurate display. Consider initializing the progress bar to reflect the starting state accurately. + m.index = 0 // Initialize index to 0 to accurately represent the starting state of progress.
progressCmd := m.progress.SetPercent(float64(m.index) / float64(m.sum-1)) Committable suggestion
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I Fix it. See 1fd8a10 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nao1215, I've reviewed the changes in commit (_/) Analysis chainScripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Fetch the changes made in the specified commit and filter for the relevant file.
git show 1fd8a10a17eb59152e43982e6ba4f25f1bc7c8f3 -- ui/s3hub/list.go
Length of output: 1950 New Learnings Added
If you found this review helpful, would you consider giving us a shout-out on X? |
||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||
case "enter": | ||||||||||||||||||||||||||||||||
if m.status == statusReturnToTop || m.status == statusDownloaded || m.status == statusS3ObjectDeleted { | ||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The progress bar's percentage calculation does not account for the initial state before any deletion starts, potentially leading to an inaccurate display. Consider initializing the progress bar to reflect the starting state accurately.
+ m.index = 0 // Initialize index to 0 to accurately represent the starting state of progress. progressCmd := m.progress.SetPercent(float64(m.index) / float64(m.sum-1))
Committable suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I Fix it. See 1fd8a10
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nao1215 Thank you for addressing the feedback and making the necessary changes. To ensure the fix is correctly implemented, please verify that the
m.index = 0
initialization is placed accurately before the progress bar's percentage calculation in theui/s3hub/delete.go
file. This adjustment is crucial for accurately reflecting the starting state of the progress bar before any deletion begins. If everything is in order, this should resolve the issue with the progress bar's display accuracy.