Add collapsible filter panel, multi-select filters, and TH-CPL badges#1
Merged
zay002 merged 1 commit intoJun 15, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR adds a new THCPL venue ranking database and updates the filtering UI/logic to support multi-select ranks, panel collapsing, and optional badge visibility based on selected tags.
Changes:
- Add
data/thcplRankSources.jsand wire it into the extension + rank resolution. - Extend filter settings/state to support
selectedRanks, panel collapse, and “selected tags only” badge visibility. - Update/add tests to cover new rank source and new filter behaviors/settings.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| test/rankSources.test.js | Loads THCPL source and asserts tag resolution/text for a known venue. |
| test/filter.test.js | Adds coverage for selectedRanks, new settings fields, rank-source signal parsing, and badge visibility toggling. |
| package.json | Includes the new THCPL data file in format:check. |
| manifest.json | Loads the new THCPL data file as part of the content script bundle. |
| js/rankSources.js | Registers thcplRankSources as an additional database for venue resolution. |
| js/i18n.js | Adds new strings for panel collapsing and “selected tags only” UI. |
| js/filter.js | Implements multi-select rank filtering and badge visibility logic + settings persistence. |
| data/thcplRankSources.js | Adds THCPL source metadata and venue records. |
| css/style.css | Adds a distinct style for THCPL badges. |
| css/filter.css | Adds styles for collapsed panel header/actions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| this.settings = this.loadSettings(this.siteConfig); | ||
| this.currentFilter = this.settings.defaultFilter; | ||
| this.currentFilter = this.settings.selectedRanks[0] || "ALL"; |
Comment on lines
687
to
+696
| defaultFilter: siteConfig.defaultFilter, | ||
| hideUnranked: siteConfig.hideUnranked, | ||
| language: "zh", | ||
| selectedRanks: [], | ||
| selectedSignals: [], | ||
| signalMode: "any", | ||
| deepTargetCount: 60, | ||
| panelPosition: null, | ||
| panelCollapsed: false, | ||
| showSelectedTagsOnly: true, |
Comment on lines
+614
to
+633
| if (!this.settings?.showSelectedTagsOnly) { | ||
| document.querySelectorAll(badgeSelector).forEach((badge) => { | ||
| badge.style.display = ""; | ||
| }); | ||
| return; | ||
| } | ||
|
|
||
| const visibleSignals = new Set([ | ||
| ...selectedRanks.map((rank) => `ccf${rank}`), | ||
| ...selectedSignals, | ||
| ]); | ||
|
|
||
| document.querySelectorAll(badgeSelector).forEach((badge) => { | ||
| const badgeSignals = this.getBadgeSignalIds(badge); | ||
| badge.style.display = badgeSignals.some((signal) => | ||
| visibleSignals.has(signal), | ||
| ) | ||
| ? "" | ||
| : "none"; | ||
| }); |
Comment on lines
+229
to
+234
| filterDiv.querySelectorAll("[data-rank]").forEach((button) => { | ||
| button.classList.toggle( | ||
| "active", | ||
| this.settings.selectedRanks.includes(button.dataset.rank), | ||
| ); | ||
| }); |
Comment on lines
+1019
to
+1035
| const rank = e.target.dataset.rank; | ||
| if (rank === "ALL") { | ||
| this.settings.selectedRanks = this.settings.selectedRanks.includes( | ||
| "ALL", | ||
| ) | ||
| ? [] | ||
| : ["ALL"]; | ||
| } else if (this.settings.selectedRanks.includes(rank)) { | ||
| this.settings.selectedRanks = this.settings.selectedRanks.filter( | ||
| (item) => item !== rank, | ||
| ); | ||
| } else { | ||
| this.settings.selectedRanks = this.settings.selectedRanks | ||
| .filter((item) => item !== "ALL") | ||
| .concat(rank); | ||
| } | ||
| this.currentFilter = this.settings.selectedRanks[0] || "ALL"; |
Comment on lines
+10
to
+11
| title: "ACM Transactlons on Computer Systems", | ||
| aliases: ["TOCS"], |
Comment on lines
+30
to
+31
| title: "IEEE Transactlons on Computers", | ||
| aliases: ["TC"], |
Comment on lines
+151
to
+152
| title: | ||
| "International Conference on Archltectural Support for Programming Languages and Operating Systems", |
| ], | ||
| }, | ||
| { | ||
| title: "USENIX Annul Technical Conference", |
| }); | ||
| } | ||
| this.updateStats(this.calculateStats(entries)); | ||
| this.applyBadgeVisibility(); |
fb1711f to
8c207dd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Title
Add collapsible filter panel, multi-select filters, selected-tag display, and TH-CPL badges
Summary
This PR improves the floating filter panel and expands venue tagging support:
navigator.clipboard.writeText()fails, copying falls back totextarea+document.execCommand("copy").Details
selectedRanks.selectedSignals.data/thcplRankSources.jsand loaded throughrankSources.getDatabases().THCPLis available in the open badge selector and displays asTHCPL A/THCPL B.NotAllowedErrorfailures when the document is not focused.Test
npm testnpm run format:check