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

Add commit message length configuration border #1048

Merged
merged 23 commits into from
Mar 4, 2020

Conversation

jamessspanggg
Copy link
Contributor

@jamessspanggg jamessspanggg commented Feb 3, 2020

GitHub's maximum length of commit message's subject line
and body is defaulted at 50 and 72 characters respectively.

Commits panel does not show the indication of the maximum
lengths.

Let's add a dotted lines for commit message bodies at 72
characters and subject lines at 50 characters, these
lines indicate whether a commit message's subject
line or body exceed GitHub's maximum length.

@damithc
Copy link
Collaborator

damithc commented Feb 3, 2020

Let's add a dashed border for commit message bodies at 72
characters as well as scrollable boxes for subject line that
is fixed at 50 characters.

For this, I meant just draw a box behind the text so that we can see if the subject is longer than 50 chars. A scrollable box will require users to scroll, which is unnecessary work.

@jamessspanggg
Copy link
Contributor Author

Ok noted prof.

@jamessspanggg
Copy link
Contributor Author

@damithc since the commit message subject line is limited to 50 characters, should we change the font to monospace (currently it is "Titillium Web",sans-serif;) ? So that each font takes equal amount of space and it is easier to get the length of 50 characters.

Changing the font however, might introduce inconsistencies in font between commits panel and authorship panel.

@damithc
Copy link
Collaborator

damithc commented Feb 3, 2020

@damithc since the commit message subject line is limited to 50 characters, should we change the font to monospace (currently it is "Titillium Web",sans-serif;) ? So that each font takes equal amount of space and it is easier to get the length of 50 characters.

Changing the font however, might introduce inconsistencies in font between commits panel and authorship panel.

I think we should use the same monospace font for code, github commit message (subject and body) as all are code-like. Anyway, try it and post some screenshots to see how it looks.

@jamessspanggg
Copy link
Contributor Author

jamessspanggg commented Feb 3, 2020

I think we should use the same monospace font for code, github commit message (subject and body) as all are code-like. Anyway, try it and post some screenshots to see how it looks.

I have tried two ways of showing the 50 character limitation:

  1. With the box that wraps the text at 50 characters.
    Cons: looks slightly odd.

Screen Shot 2020-02-03 at 9 04 27 PM

  1. Using the ellipsis icon from the 50th character onwards:
    Cons: require user to hover over the link to see full commit subject line

Screen Shot 2020-02-03 at 9 28 32 PM

@damithc
Copy link
Collaborator

damithc commented Feb 3, 2020

We don't want to hide anything; just want to shame the ones that violate the limit. What if you show a vertical white dotted line after 50 chars. Subtle but makes the point.

@jamessspanggg
Copy link
Contributor Author

jamessspanggg commented Feb 3, 2020

@damithc switched both limit lines to be dotted. Are the dotted lines in the commit message title too subtle?

Screen Shot 2020-02-04 at 12 11 36 AM

Screen Shot 2020-02-04 at 12 14 16 AM

@damithc
Copy link
Collaborator

damithc commented Feb 4, 2020

@damithc switched both limit lines to be dotted. Are the dotted lines in the commit message title too subtle?

Yes. Use black, which is also consistent with what we do in the message body?

@jamessspanggg
Copy link
Contributor Author

Yes. Use black, which is also consistent with what we do in the message body?

Screen Shot 2020-02-04 at 10 30 52 AM

@jamessspanggg jamessspanggg marked this pull request as ready for review February 4, 2020 08:41
@@ -321,7 +333,7 @@ header {
}

&--button {
color: mui-color('grey', '700');
color: mui-color('grey');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modified to standardise with the icon colors in v_authorship

@jamessspanggg jamessspanggg requested a review from a team February 4, 2020 08:42
Copy link
Contributor

@0blivious 0blivious left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the message below, the dotted line appear in the middle of the PR number. For the commit title length, I feel we should not count the PR number as it is not input by the user.
image

@damithc
Copy link
Collaborator

damithc commented Feb 5, 2020

See the message below, the dotted line appear in the middle of the PR number. For the commit title length, I feel we should not count the PR number as it is not input by the user.

PR number is part of the subject line, added by the user. It's just a project convention, not automatic.

@jamessspanggg
Copy link
Contributor Author

Yep placing the PR number is a choice, not automatic.

@jamessspanggg jamessspanggg requested review from 0blivious and a team February 6, 2020 15:29
frontend/src/static/css/style.scss Outdated Show resolved Hide resolved
frontend/src/static/css/style.scss Outdated Show resolved Hide resolved
Copy link
Contributor

@Tejas2805 Tejas2805 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks good. Can you just add blank lines between the styles ?

@jamessspanggg
Copy link
Contributor Author

Perhaps the underline can be solid and the dashed line for the 72 characters can use lighter shade of grey? Do wait for @damithc 's input too.

Ok noted. Updated the previous comment with the UI.

@damithc
Copy link
Collaborator

damithc commented Feb 23, 2020

Perhaps the underline can be solid and the dashed line for the 72 characters can use lighter shade of grey? Do wait for @damithc 's input too.

hmm... After seeing both, I kind of prefer vertical lines; while it may not be nice to look at, a vertical line is a good visual cue to indicate 'it should end here'. Also for consistency, we should make make the two as similar as possible, given both have the same purpose. If both look the same, that should also alleviate the worry that users will mistake it as a glitch. What do you think?

@damithc
Copy link
Collaborator

damithc commented Feb 23, 2020

BTW, I believe there is an another ongoing PR that is trying to tweak the page background color, which has a bearing on the colors we choose for this feature.

@jamessspanggg
Copy link
Contributor Author

BTW, I believe there is an another ongoing PR that is trying to tweak the page background color, which has a bearing on the colors we choose for this feature.

I believe it's from this PR #1080, which modifies the code and commits panel to be white.

hmm... After seeing both, I kind of prefer vertical lines; while it may not be nice to look at, a vertical line is a good visual cue to indicate 'it should end here'. Also for consistency, we should make make the two as similar as possible, given both have the same purpose.

I agree that we should use vertical lines for both. Would grey vertical dashed lines be alright? Grey would look ok on white backgrounds, as shown in the commit message body.

Screen Shot 2020-02-23 at 4 31 55 PM

@eugenepeh
Copy link
Member

eugenepeh commented Feb 23, 2020

hmm... After seeing both, I kind of prefer vertical lines; while it may not be nice to look at, a vertical line is a good visual cue to indicate 'it should end here'. Also for consistency, we should make make the two as similar as possible, given both have the same purpose. If both look the same, that should also alleviate the worry that users will mistake it as a glitch. What do you think?

My concern on vertical line for the title is more on the inconsistency of presence (when the title is shorter than 50 chars, it won't appear), which is why it kind of give off the "glitch" look to me.

Though I agree that it may be easier to identify the 50 chars cut off point, but I personally feel that underline would probably look more professional because it looks similar to how people are writing beyond the allocated space on forms and etc.

@damithc
Copy link
Collaborator

damithc commented Feb 23, 2020

Though I agree that it may be easier to identify the 50 chars cut off point, but I personally feel that underline would probably look more professional because it looks similar to how people are writing beyond the allocated space on forms and etc.

I see what you mean. The form field analogy didn't occur to me because that behavior never happens in an online form, and in Web pages, underlines usually mean other things (such as links or tooltips). Let's stick with vertical lines for now. It will look a bit odd, but probably we can make it subtle enough to not to irritate the viewer. Or it may be OK for it to be irritating to the viewer in this instance because we are exposing an incorrect behavior of the commit author. The line will not even appear if the authors stuck to the standard. @jamessspanggg let's make both lines same thickness and same style, and if possible, same shade of grey.

@jinyao-lee
Copy link
Contributor

jinyao-lee commented Feb 23, 2020

What about this alternative instead of the dotted line:

Any commit subject that exceeds 50 char will have a ⚠️ sign or similar that states commit message exceeds 50 char upon being hovered?

@damithc
Copy link
Collaborator

damithc commented Feb 23, 2020

Any commit subject that exceeds 50 char will have a ⚠️ sign or similar that states commit message exceeds 50 char upon being hovered?

I feel that's beyond RepoSense's role. We should only provide a basis for the user to make their own judgement, without providing our own judgement.

Let's go with the current approach, dogfood for a while, and refine later if it doesn't work.

@jamessspanggg jamessspanggg requested review from damithc and removed request for damithc February 23, 2020 12:19
# Conflicts:
#	docs/images/commits-panel.png
#	docs/images/opening-commits-panel.gif
#	frontend/src/static/css/style.scss
#	frontend/src/tabs/zoom.pug
# Conflicts:
#	frontend/src/static/css/style.scss
@jamessspanggg jamessspanggg requested review from eugenepeh and removed request for eugenepeh February 29, 2020 07:45
@Tejas2805
Copy link
Contributor

@fzdy1914 Can merge this first? Another PR by @jamessspanggg on hold due to this.

@fzdy1914
Copy link
Member

fzdy1914 commented Mar 4, 2020

@jamessspanggg CI is failing, can you kindly recheck?

@fzdy1914 fzdy1914 merged commit 9725a25 into reposense:master Mar 4, 2020
Tejas2805 added a commit to Tejas2805/RepoSense that referenced this pull request Mar 6, 2020
* 'master' of https://github.com/reposense/RepoSense:
  [reposense#1047] v_summary: simplify toDisplay user logic (reposense#1051)
  [reposense#658] Modify checkstyle configuration (reposense#1094)
  Add commit message length configuration border (reposense#1048)
  [reposense#1061] build.gradle: remove unused dependency (reposense#1095)
  [reposense#1044] Update date hashes on reset date range (reposense#1068)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants