Skip to content

dim-viewed-files - New feature - #10172

Merged
fregante merged 35 commits into
refined-github:mainfrom
xremix:feat/dim-viewed-files
Oct 19, 2026
Merged

fregante merged 35 commits into
refined-github:mainfrom
xremix:feat/dim-viewed-files

Conversation

@xremix

@xremix xremix commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Adds dim-viewed-files: dims files marked as "Viewed" in the PR file tree, plus folders whose files are all viewed, so unreviewed files stand out.

  • File rows are dimmed via a class set by JS, based on each diff's "Viewed" state (new React view and legacy checkboxes).
  • Folders are dimmed in CSS only, via :has(); only the folder's own row is dimmed to avoid compounding opacity on nested items.

Test URLs

https://github.com/refined-github/refined-github/pull/10172/changes

Screenshot

image

@xremix
xremix marked this pull request as ready for review October 6, 2026 09:33

@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.

Thanks for the PR! This has been requested at least once before (#9993)

If we can keep it simple and lightweight I think it might be useful.

Comment thread source/features/dim-viewed-files.css Resolved
Comment thread source/refined-github.ts Resolved
Comment thread source/features/dim-viewed-files.tsx Resolved
Comment thread source/features/dim-viewed-files.tsx Resolved
Comment thread source/features/dim-viewed-files.tsx Resolved
Comment thread source/features/dim-viewed-files.tsx Resolved
xremix and others added 10 commits October 10, 2026 10:53
Scope folder selectors to the labeled file tree without relying on the legacy files_bucket container.

Co-authored-by: Copilot App <[email protected]>
Remove legacy selectors and redundant viewed-state checks. Use diff IDs, aria-pressed, and modern tree items directly.

Co-authored-by: Copilot App <[email protected]>
Avoid marking unviewed buttons as seen before aria-pressed becomes true.

Co-authored-by: Copilot App <[email protected]>

@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.

It looks like a small feature now ☺️

Comment thread source/features/dim-viewed-files.tsx Resolved
Comment thread source/features/dim-viewed-files.tsx Resolved
Comment thread source/features/dim-viewed-files.tsx Resolved
Comment thread readme.md Resolved
Comment thread source/features/dim-viewed-files.css Resolved
@fregante fregante changed the title dim-viewed-files - Dim viewed files in the PR file tree dim-viewed-files - New feature Oct 10, 2026
@fregante

Copy link
Copy Markdown
Member

I'm not seeing the feature, did GitHub already break it?

Screenshot 11

@fregante
fregante marked this pull request as draft October 15, 2026 06:08
@xremix

xremix commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

@fregante I updated the code. It did work on one PR but not on another, but I found what was missing. Good catch, thanks for checking. I think this should be good now.

@xremix
xremix marked this pull request as ready for review October 15, 2026 20:13
@fregante

Copy link
Copy Markdown
Member

Neato!

flash

@fregante
fregante merged commit de00602 into refined-github:main Oct 19, 2026
14 checks passed
@ad08fee3

Copy link
Copy Markdown

Oh yay! I'm happy to see this built-in!

I just started using Refined Github, and have been building Userscripts for Greasmonkey/ViolentMonkey as well to add further features. I'm kinda wanting to see if some of them could live in Refined GitHub instead. 🙂

I had the idea to dim files too:
https://github.com/ad08fee3/userscripts/blob/main/userscripts/githubFileTreeColors/README.md

If I could suggest one tweak to this implementation of the feature, then I could deprecate my userscript entirely:

What would you think of doing strikethrough if it's viewed, and grayed out if it's simply collapsed? Like so:
image

Light mode:
image

When reviewing PRs I like to collapse files if I haven't gotten to them yet, and having a way to distinguish between "collapsed" and "viewed" in the file tree is very handy.

I'd be happy to add this in a new PR if it's reasonable 🙂

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

Development

Successfully merging this pull request may close these issues.

3 participants