DEV Community 👩‍💻👨‍💻

Igor Montagner
Igor Montagner

Posted on

One PR a month: February and March

Since I did not publish a report in February, I am doing a joint February + March post using a couple PRs I recently sent.

One of the things I like about elementary is the care taken with UX. For instance, for less experienced users pasting random commands in the terminal is a sensitive operation, specially if these commands involve administrative privileges. For this reason, elementary's terminal app shows a warning when the user pastes commands involving sudo or with newlines.

Paste Protection dialog

Two issues were raised with this dialog:

  1. That details field did not exist (issue #562), so it was hard for the used to check the if the command being pasted was really dangerous
  2. Pressing Escape would paste the text anyway (issue #293).

Although both seem like very simple issues, everything is done taking into account these small details. This contributes to the polished feeling elementary has.

Fixing the first was really simple: the paste protection dialog inherits from Granite.MessageDialog. This class has a method show_error_details that creates the small collapsible text box. I just needed to call it with the appopriate text and call it a day: PR #563. It was almost instantly approved.

The second issue was also simple: the dialog returns 1 if the "Paste Anyway" button is pressed and 0 if the "Don't paste" button is pressed. The code that checked if pasting should be cancelled was akin to if (response == 0). I'm not sure what pressing Escape returns, but I'm pretty sure that text should only be pasted if response == 1. So I changed the condition and now pasting works. This was done in PR #569.

An important point of both PRs is that they are very simple. I used these to emphasize the contributing does not require superior ultra coding skills, just some pacience and a little effort. There are many issues that are easy and up for grabs not only in elementary but also in many other projects.

If you decide to take this challenge as well leave a comment. Or if you need help finding easy issues in elementary ;) Or anything , really.

Top comments (0)

🌚 Friends don't let friends browse without dark mode.

Sorry, it's true.