Skip to content
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(ui): log button behaviors (#15848) #16098

Merged
merged 3 commits into from
Oct 25, 2023

Fixed lint-ui issues

84434ce
Select commit
Loading
Failed to load commit list.
Merged

fix(ui): log button behaviors (#15848) #16098

Fixed lint-ui issues
84434ce
Select commit
Loading
Failed to load commit list.
This check has been archived and is scheduled for deletion. Learn more about checks retention
Deleted GitHub App / Copilot for PRs succeeded Oct 25, 2023 in 2s

Analysis complete

Summary

Improved pod logs viewer UI and scrolling logic in pod-logs-viewer.tsx

Walkthrough

  • Import useRef hook from React to create a reference to the logs container element (link)

  • Declare logsContainerRef variable to store the reference (link)

  • Update useEffect hook to scroll the logs container element to the bottom if scrollToBottom state is true (link)

  • Define handleScroll function to handle the wheel event on the logs container element and set scrollToBottom state to false if user scrolls up (link)

  • Assign logsContainerRef to the ref prop and handleScroll to the onScroll prop of the logs container element (link, link)

  • Remove onWheel prop from the logs container element since it is redundant with onScroll prop (link)

    Poem

    To view pod logs with ease

We added a useRef hook, please
It helps us to scroll
To the end of the whole
Logs container when there are new entries

Emoji

🪝📜🚀

Include these descriptions in your pull request description by including the following marker tags:

  • copilot:all: all the content, in one go
  • copilot:summary: a one paragraph summary of the code changes
  • copilot:walkthrough: a step by step walkthrough of the code changes
  • copilot:poem: a poem about the code changes!
  • copilot:emoji: three emoji that capture the changes

Feedback is welcome. Simply add a comment to this PR of the form /copilot feedback [your comments here].

Details

Copilot for PRs is a limited technical preview from GitHub Next.

It's aim is to make it easier to write pull request descriptions by providing automatically generated suggestions based on the code changes.

To find out more go to https://githubnext.com/projects/copilot-for-pull-requests or come and chat with us on Discord

Progress:

File Status Duration
Summary & Walkthrough ✅ Finished 37.5 seconds
ui/src/app/applications/components/pod-logs-viewer/pod-logs-viewer.tsx ✅ Finished 25.8 seconds