Skip to content

Restore releases-tab in "Repository refresh" beta - #3186

Merged
fregante merged 6 commits into
refined-github:masterfrom
FloEdelmann:restore-releases-tab
Jun 8, 2020
Merged

fregante merged 6 commits into
refined-github:masterfrom
FloEdelmann:restore-releases-tab

Conversation

@FloEdelmann

Copy link
Copy Markdown
Member

Relates to #3081.

With feature preview enabled:

Screenshot_2020-06-06_13-59-03

With feature preview disabled:

Screenshot_2020-06-06_13-59-31

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

parseCountFromDom looks fine, but I'm hesitant to merge code this way if there's so much difference between the 2 implementations.

I'd prefer:

+ if is new version
+ 	const releasesTab = (new tab style);
+ 	appendBefore(...)
+ 	// Update "selected" tab mark
+ else
	const releasesTab = (old style tab style);
	appendBefore(...)
	// Update "selected" tab mark

This way it's easy to keep track of what's new and what's old; it's also easier to delete the entire condition once "the old" disappears from GitHub Enterprise.

This preference of course only applies if the implementation changes this much; if the new version only needed a couple of new classes it's easier to add just those.

Note: no need to create a function for each version. The point of this is to make it easier to delete code in the (near) future, not making it look pretty.

Comment thread source/features/releases-tab.tsx Resolved
Comment thread source/features/releases-tab.tsx Resolved
@fregante fregante changed the title Restore releases-tab in GitHub's repository redesign Restore releases-tab in "Repository refresh" beta Jun 6, 2020
@FloEdelmann
FloEdelmann requested a review from fregante June 6, 2020 14:16
@fregante
fregante merged commit 6e28e2b into refined-github:master Jun 8, 2020
@FloEdelmann
FloEdelmann deleted the restore-releases-tab branch June 8, 2020 06:46
@yakov116

yakov116 commented Jun 8, 2020 •

Copy link
Copy Markdown
Member

This PR broke the releases tab when not on isRepoRoot when in any issue or PR

❌ Refined GitHub → releases-tab → TypeError: Cannot read property 'append' of null
    at init (refined-github.js:13858)
    at async runFeature (refined-github.js:10346)
    at async setupPageLoad (refined-github.js:10360) 
Search issue: https://github.com/sindresorhus/refined-github/issues?q=is%3Aissue+Cannot%20read%20property%20'append'%20of%20null

Open an issue: https://github.com/sindresorhus/refined-github/issues/new?labels=bug&template=bug_report.md&title=%60releases-tab%60%3A%20Cannot%20read%20property%20'append'%20of%20null

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants