DEV Community

cychu42
cychu42

Posted on

Another Set Of Eyes: PR Review

Recently, I did some code review(1 2) for the Telescope Project.

I look at the issue and then the PR to understand the context and what the PR description is supposed to do, then I study the code to see what it's doing, and then run the issue branch to see what the result is. From those, I try to spot any error or place to improve.

Fixing Button Text

The first code review was a PR for fixing incorrect text for buttons, which then turned partially into adjusting the button style. Because I have some experience with the pages from some past PRs I did myself, I thought of the CSS used for the other buttons in the same UI and suggested that the person can adjust the CSS style to conform to other buttons. Because of those experience, I didn't have a hard time understanding what the relevant codes are about, especially that the fix isn't complicated in nature.
Toward end of the review, the assignee seem to have some issue rebasing and squashing commits, so I mention how I would do it and ask how he does it, in hope of helping him figure it out. It seems to have helped him figure some of it out.

Fixing Button Text

The second code review was about a PR that introduces theme selection to replace the old theme toggle (dark/light mode). This one is a lot more complicated than what I'm used to. There are still many parts of the Telescope Project I'm not very familiar with. This took me a while to understand how the codes work together.
Because I'm less experience with the code, most of my suggestion is focus on the result of the code, such as making sure simple text doesn't appear as clickable and having the colour scheme be friendly to users.

Learning

I definitely feel about reading code of similar complicity after doing the second code review and getting more used to it. From both, I have more understanding of how code can be written from reading other people's work, especially those above my own skill level. The experiences also got me more into the mind of code reviewers to think of PR from their perspective, like what to look for, how to ask communicate, what to focus on, and so on.

Top comments (0)