Skip to content

show-names - Fix spacing for issues on narrow views#9622

Closed
SunsetTechuila wants to merge 1 commit into
mainfrom
show-names
Closed

show-names - Fix spacing for issues on narrow views#9622
SunsetTechuila wants to merge 1 commit into
mainfrom
show-names

Conversation

@SunsetTechuila

Copy link
Copy Markdown
Contributor

Fixes #9372

Test URLs

refined-github/sandbox#131

Screenshot

image

@github-actions github-actions Bot added the bug label May 26, 2026
@fregante

Copy link
Copy Markdown
Member

image

What's going on here? Is the screenshot edited?

@fregante

Copy link
Copy Markdown
Member

I'm really tired of seeing this type of bug with the parens, I need to find a way to fix the way text wraps so when it breaks it doesn't act so badly

@SunsetTechuila

SunsetTechuila commented May 26, 2026

Copy link
Copy Markdown
Contributor Author

What's going on here?

GitHub devs are going on here:

image image

Is the screenshot edited?

No

@fregante

Copy link
Copy Markdown
Member

GitHub plz

image

@SunsetTechuila

SunsetTechuila commented May 26, 2026

Copy link
Copy Markdown
Contributor Author

Somewhat fixable on our end:

image
div[class^='ActivityHeader'][class*='actionsWrapper'] {
	flex-wrap: wrap-reverse;
}
@container issueViewerContainer (max-width: 768px) {
	span[class^='MarkdownLastEditedBy-module__lastEditInfoContainer'] {
		font-size: 0;
		span[class^='MarkdownLastEditedBy-module__editorLogin']:before {
			content: 'Edited';
			font-size: 12px;
		}
	}
}

fregante
fregante previously approved these changes May 27, 2026
element.matches([
'[data-testid="avatar-link"]', // Commment on React-based views
'[data-testid="issue-body-header-author"]',
// TODO [2026-11-26]: Drop selectors that have :not(${narrowViewportWrapperSelector})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Those classes were kept for backward compatibility, since with the current issue body header component we don't need margin-leftt:

// Narrow viewport wrapper provides spacing by `column-gap`

// Place after the title section container for correct wrapping
// Info: https://github.com/refined-github/refined-github/issues/9372
= element.matches(narrowViewportWrapperSelector)

@fregante fregante dismissed their stale review May 27, 2026 06:04

too early

@fregante fregante left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I need to find a way to fix the way text wraps so when it breaks it doesn't act so badly

		<span className="color-fg-muted css-truncate d-inline-block rgh-show-names no-wrap">

This alone fixes the issue actually, so I think the rest of the changes in this PR are not needed:

Before After
Image Image

@fregante

Copy link
Copy Markdown
Member

Somewhat fixable on our end:

I opened a dedicated issue:

@SunsetTechuila

Copy link
Copy Markdown
Contributor Author

This alone fixes the issue actually, so I think the rest of the changes in this PR are not needed:

Sure:

image

@fregante

Copy link
Copy Markdown
Member

As you yourself showed earlier, it appears even without Refined GitHub, that's why I opened a dedicated github bug improvement:

Screenshot

The issue at hand is this:

Screenshot 2

@SunsetTechuila SunsetTechuila deleted the show-names branch May 27, 2026 06:59
@refined-github refined-github locked and limited conversation to collaborators May 31, 2026
@fregante

fregante commented Jun 1, 2026

Copy link
Copy Markdown
Member

(locked due to people possibly landing here for unrelated issues)

@SunsetTechuila the CSS you wrote earlier looks good and it fixes #9623, do you want to open a PR?

div[class^='ActivityHeader'][class*='actionsWrapper'] {
	flex-wrap: wrap-reverse;
}
@container issueViewerContainer (max-width: 768px) {
	span[class^='MarkdownLastEditedBy-module__lastEditInfoContainer'] {
		font-size: 0;
		span[class^='MarkdownLastEditedBy-module__editorLogin']:before {
			content: 'Edited';
			font-size: 12px;
		}
	}
}
[class*="^IssueBodyHeader-module__titleSection"] {
	display: contents;
}
Screenshot 7

@SunsetTechuila

SunsetTechuila commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

the CSS you wrote earlier looks good and it fixes #9623

The CSS I wrote doesn't fix that issue on its own. It only does when combined with this PR.

[class^="IssueBodyHeader-module__titleSection"] {
 	display: contents;
}

I don't like this addition. It breaks how GitHub's code works instead of integrating with it, only to achieve a worse result: extra spacing on the left.

do you want to open a PR?

No. I can reopen this PR and add the CSS from #9622 (comment) to it.

@fregante

fregante commented Jun 1, 2026

Copy link
Copy Markdown
Member

doesn't fix that issue on its own

I took a screenshot with that code I pasted, what do you mean?

extra spacing on the left.

It was a quick trial, surely we can make further adjustments. I thought about using contents so that the text breaks as if it's part of the same line of text. Not sure if it's good enough.

@fregante

fregante commented Jun 3, 2026

Copy link
Copy Markdown
Member

Sorry about what happened here, perhaps I moved the goalpost after opening the issue. But we can't fix minor layout issues with JS, same as #9176.

I opened #9682, which reused your earlier code from #9190

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Development

Successfully merging this pull request may close these issues.

show-names causes bad wrapping on mobile

2 participants