Skip to content

Add collapsible filter panel, multi-select filters, and TH-CPL badges#1

Merged
zay002 merged 1 commit into
zay002:masterfrom
dongyangli-del:feat/filter-panel-tags-thcpl
Jun 15, 2026
Merged

Add collapsible filter panel, multi-select filters, and TH-CPL badges#1
zay002 merged 1 commit into
zay002:masterfrom
dongyangli-del:feat/filter-panel-tags-thcpl

Conversation

@dongyangli-del

@dongyangli-del dongyangli-del commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

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:

  • Add a collapsible panel state so the filter UI can be reduced when it blocks page content.
  • Change the CCF filter buttons from single-select to multi-select.
  • Add a "Selected tags only" setting, enabled by default, so result badges can be limited to selected CCF ranks/open badges.
  • Add TH-CPL support as a new open badge source using the Tsinghua University Computer Science recommended conference and journal list.
  • Add a clipboard fallback: when navigator.clipboard.writeText() fails, copying falls back to textarea + document.execCommand("copy").

Details

  • The panel collapse state is persisted in site settings.
  • In collapsed mode, the language switch button is not rendered, leaving only the expand control.
  • CCF rank selection is stored as selectedRanks.
  • Existing source badge filtering still uses selectedSignals.
  • TH-CPL data is added as data/thcplRankSources.js and loaded through rankSources.getDatabases().
  • THCPL is available in the open badge selector and displays as THCPL A / THCPL B.
  • Clipboard fallback behavior is covered by tests to avoid unhandled NotAllowedError failures when the document is not focused.

Test

  • npm test
  • npm run format:check
  • Loaded unpacked extension locally in Chrome and verified:
    • panel collapse/expand
    • multi-select CCF filter buttons
    • selected-tag-only display behavior
    • TH-CPL badge matching and filtering

Copilot AI review requested due to automatic review settings June 14, 2026 17:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.js and 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.

Comment thread js/filter.js

this.settings = this.loadSettings(this.siteConfig);
this.currentFilter = this.settings.defaultFilter;
this.currentFilter = this.settings.selectedRanks[0] || "ALL";
Comment thread js/filter.js
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 thread js/filter.js
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 thread js/filter.js
Comment on lines +229 to +234
filterDiv.querySelectorAll("[data-rank]").forEach((button) => {
button.classList.toggle(
"active",
this.settings.selectedRanks.includes(button.dataset.rank),
);
});
Comment thread js/filter.js
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 thread data/thcplRankSources.js
Comment on lines +10 to +11
title: "ACM Transactlons on Computer Systems",
aliases: ["TOCS"],
Comment thread data/thcplRankSources.js
Comment on lines +30 to +31
title: "IEEE Transactlons on Computers",
aliases: ["TC"],
Comment thread data/thcplRankSources.js
Comment on lines +151 to +152
title:
"International Conference on Archltectural Support for Programming Languages and Operating Systems",
Comment thread data/thcplRankSources.js
],
},
{
title: "USENIX Annul Technical Conference",
Comment thread js/filter.js
});
}
this.updateStats(this.calculateStats(entries));
this.applyBadgeVisibility();
@dongyangli-del dongyangli-del force-pushed the feat/filter-panel-tags-thcpl branch from fb1711f to 8c207dd Compare June 14, 2026 18:05
@zay002 zay002 merged commit f3a0e94 into zay002:master Jun 15, 2026
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.

3 participants