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

Reduce gap on profile page #1512

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

2S00B5
Copy link

@2S00B5 2S00B5 commented Jan 12, 2025

I have tried to reduce the gap between the user name and the succeeding text. Hope it's what you're looking for. And I have tested the changes in the inspect element on the webpage.

Fixes #1480.

@ArtOfCode- ArtOfCode- linked an issue Jan 12, 2025 that may be closed by this pull request
Copy link
Member

@ArtOfCode- ArtOfCode- left a comment

Choose a reason for hiding this comment

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

Firstly, welcome! Thanks for your first contribution.

Has this been tested? I'm not sure this will work as it currently stands - the element that you've added that tries to reduce the margin is before the element that the margin is on.

Regardless, attempting to fix this by adding more markup/CSS isn't ideal - this can and should be fixed using the existing styles available. I'd suggest looking at the design framework to see what's available. In this case, adding a h-m-b-0 to the h1 and changing h-p-t-2 to h-p-t-0 on the profile container should resolve this without any additions.

@2S00B5
Copy link
Author

2S00B5 commented Jan 12, 2025

Thank you for your feedback, I'll take a look at it again asap.

@Oaphi
Copy link
Member

Oaphi commented Jan 12, 2025

Do note that the extra gap (likely an artifact of how things had looked before #1440 was fixed) is not caused by the header itself, but by the content that follows it (see other tabs for reference):

Screenshot from 2025-01-12 21-06-46

@cellio cellio changed the title Issue resolved Reduce gap on profile page Jan 12, 2025
@Oaphi
Copy link
Member

Oaphi commented Jan 13, 2025

While we are at it, can you please take a look at filtering out the empty paragraph from from the profile description if the user doesn't have neither website, Twitter, or Discord link added (not an issue with your PR, but we might as well address it here)? This results in a an empty <p> element - while it doesn't cause a layout shift, it's best we remove it.

<p>
<% if @user.website.present? %>
<% unless !user_signed_in? && !@user.community_user.privilege?('unrestricted') %>
<span class="h-m-r-4">
<i class="fas fa-link"></i>
<%= link_to @user.website_domain, @user.website, rel: 'nofollow',
'aria-label': "Visit website of #{rtl_safe_username(@user)} at #{@user.website_domain}" %>
</span>
<% end %>
<% end %>
<% if @user.twitter.present? %>
<span class="h-m-r-4">
<i class="fab fa-twitter"></i> <%= link_to @user.twitter, "https://twitter.com/#{@user.twitter}",
'aria-label': "Visit twitter account of #{rtl_safe_username(@user)}" %>
</span>
<% end %>
<% if @user.discord.present? %>
<span class="h-m-r-4">
<i class="fab fa-discord h-m-r-1"></i> <%= @user.discord %>
</span>
<% end %>
</p>

@Oaphi
Copy link
Member

Oaphi commented Jan 13, 2025

More on point, even with the changes the misalignment is still present, some further tweaking is needed - it's not as simple of a fix as just reducing the top padding (we should probably remove the padding on the left of the activity column as well while we are tweaking the layout as it's causes an additional visual shift).

For reference, compare the updated version form the new PR (might look better with profile links filled in, but many users do not have those):

Screenshot from 2025-01-13 16-57-46

To how the header looks like on the "Vote Summary" tab:

Screenshot from 2025-01-13 16-57-49

@2S00B5
Copy link
Author

2S00B5 commented Jan 13, 2025

Yes while editing I thought of removing the side padding but then thought it might be unnecessary! Sure I will implement the changes. Please let me know if I need to look into any other parts. Thank you so much.

@Oaphi
Copy link
Member

Oaphi commented Jan 13, 2025

@2S00B5 doesn't seem like there's anything else for now, thanks! Left padding is optional, probably will need more thought put to it (don't recall the reason why it's there)

Comment on lines 26 to 30
<<<<<<< Updated upstream
<div class="h-p-6 h-p-t-2">
=======
<div class="h-p-0 h-p-t-0">
>>>>>>> Stashed changes
Copy link
Member

@Oaphi Oaphi Jan 14, 2025

Choose a reason for hiding this comment

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

Note that you've committed with merge conflict marker active (note the system tests failing due to syntax errors). Suggested fix is to reset the branch to our upstream develop branch, manually reapply the changes, and force-push - looks like a stash apply has gone wrong.

Copy link
Author

Choose a reason for hiding this comment

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

I apologize, this is my first time contributing to an open source project, so I followed the instructions for merging available online. Must not have worked out fine.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry for the hassles. Git can be a little finicky with merges sometimes. I needed some help from more experienced devs when I came here too. Please don't be discouraged; unfortunately it's kind of normal.

Comment on lines 46 to 50
.reducegap {
font-weight: bold;
margin-bottom:-20px;
}

Copy link
Member

@Oaphi Oaphi Jan 14, 2025

Choose a reason for hiding this comment

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

That (as well as its usage) seems like an artifact of updating the branch - hasn't @ArtOfCode- already review this and asked not to rely on overrides but use the design system instead?

Copy link
Author

Choose a reason for hiding this comment

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

Yes I had removed that in the second branch, as I said I was just learning to force push in previous branch, that must have been missed out.

@2S00B5
Copy link
Author

2S00B5 commented Jan 14, 2025

I have implemented the changes in the individual files manually for the gap removal.

Copy link
Member

Choose a reason for hiding this comment

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

Not sure how this has ended up here - there should be no dist folder here at all. The following git commands should amend your commits to remove it:

  1. Checkout a new temporary branch from this one. Make sure you're on this branch, then git checkout -b temp-branch
  2. Switch back to this branch: git checkout 2S00B5/1480/large-textheader-gap
  3. Reset back to the commit that added this file: git reset --hard b65c61d
  4. Remove the folder: rm -r app/assets/stylesheets/dist
  5. Add the change: git add app/assets/stylesheets/dist
  6. Amend the commit: git commit -m "Implemented review" --amend
  7. Cherry-pick the subsequent commits back to this branch: git cherry-pick 28562e2^..4be3438

You can then delete the temporary branch and force-push to this one, which should solve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Large gap between name and text on profile page
4 participants