Skip to content

Make research topic chips keyboard-reachable teal buttons - #151

Merged
VatsalSy merged 2 commits into
mainfrom
rayleigh-cloud/research-topic-chips-teal-e4d7
Oct 19, 2026
Merged

VatsalSy merged 2 commits into
mainfrom
rayleigh-cloud/research-topic-chips-teal-e4d7

Conversation

@VatsalSy

@VatsalSy VatsalSy commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Summary

The topic filters on /research/ look clickable, but they are purple <span> chips. In dark mode the label is the raw #d99adc purple, and the spacing is raw pixels. A keyboard user cannot treat them as real controls, and the design system reserves teal (--c-accent-teal) for interactive accents. These chips are now <button type="button"> elements, styled only from tokens, with aria-pressed for the active filter. Enter and Space still filter the same tag list, including the ?tag= deep link.

Changes

  • Topic and paper tags in _research/index.md are buttons. Citation headings are unchanged.
  • Chip colour, padding, gap, type size, and radius come from --c-accent-teal, --s-*, --t-*, and --r-pill. Hover, selected, and :focus-visible states use that teal. The dark-mode #d99adc override is gone.
  • page-research.js sets aria-pressed on the active filter and still toggles the same papers. The command palette and the tag-page generator read both buttons and any leftover spans.
  • Homepage featured cards style cloned tag buttons so they do not fall back to the browser button.

Testing

  • ./scripts/lint-check.sh
  • npm test (28 suites, 214 tests)
  • npm run lint (existing warnings only, in search-manager.js and utils.js)
  • ./scripts/build.sh (Jekyll, 26 tag redirect pages, SEO metadata)
  • Local CodeRabbit CLI is not installed, so that pre-push pass was skipped.
  • Playwright on the built page: Enter on Bubbles sets ?tag=Bubbles, aria-pressed="true", and hides non-matching papers (12 visible, 18 hidden). Space clears the filter. Tab moves to Drops. Focus ring is 4px solid teal (rgb(37, 76, 74) light, rgb(106, 194, 189) dark). Before shots are the live site, where the same chip is a span in brand purple, dark label rgb(217, 154, 220).

Screenshots

Before, live /research/:

Before, 390px, light. Purple topic chips.
Before, 390px, dark. Purple topic chips.
Before, 1440px, light. Purple topic chips.
Before, 1440px, dark. Purple topic chips including raw purple labels.

After, local build:

After, 390px, light. Teal topic chips.
After, 390px, dark. Teal topic chips.
After, 1440px, light. Teal topic chips.
After, 1440px, dark. Teal topic chips.
After, 1440px, light, Bubbles chip focused with a teal ring.
After, 1440px, dark, Bubbles chip focused with a teal ring.

Open in Web Open in Cursor 

Summary by CodeRabbit

  • Accessibility
    • Research tags are now native buttons with pressed states, focus indicators and keyboard support.
  • Bug Fixes
    • Tag filtering and active styling now work with both buttons and legacy text labels.
  • Documentation
    • Updated research tag examples to show the new button controls.

Topic filters were purple spans, so the keyboard and the teal accent
never reached them. Real buttons keep the same tag filter and expose
pressed state.

Co-authored-by: Vatsal Sanjay | CoMPhy Lab <vatsal.sanjay@comphy-lab.org>
Copilot AI balanced review requested due to automatic review settings October 19, 2026 09:51

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

The button path left the span keyboard fallback untested, which
dropped statement coverage under the 80 percent gate.

Co-authored-by: Vatsal Sanjay | CoMPhy Lab <vatsal.sanjay@comphy-lab.org>
Copilot AI balanced review requested due to automatic review settings October 19, 2026 09:53

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@cursor

cursor Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

@coderabbitai review

@comphy-bot

comphy-bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

comphy-bot review status for comphy-lab/comphy-lab.github.io#151 at 3501c0ec: completed

Review completed for this exact pull request head.

@comphy-bot
comphy-bot self-requested a review October 19, 2026 10:05

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

Review: Make research topic chips keyboard-reachable teal buttons

Reviewed +166/-95 across 12 files at 3501c0ec43968ce5ccac9ab532095c9be906c48d.

No P0/P1 findings. The native-button migration is consistent across the research markup, filtering selectors, command-palette integration, tag-page discovery and featured-card styling. Pressed state is synchronized on activation and reset, while legacy spans retain their keyboard handling. No actionable security or complexity regression identified in the changed paths.

Verification: exact-head build, content-rules and PR-hygiene checks succeeded; deployment was skipped. Deterministic patch checks passed. Reviewed the updated filtering, deep-link, legacy-span and command-palette test changes statically; no PR code or test scripts were executed during this review. Native Enter/Space activation and visual focus/contrast were not independently exercised in a browser.

No peer review threads contained findings in the complete review snapshot.

@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 0859dc57-0be1-4948-b734-24c0eaa5b100
📥 Commits

Reviewing files that changed from the base of the PR and between 3a33efc and 3501c0e.

📒 Files selected for processing: 12
  • AGENTS.md
  • README.md
  • _layouts/research.html
  • _research/index.md
  • assets/css/research-v2.css
  • assets/css/styles.css
  • assets/js/command-data.js
  • assets/js/page-research.js
  • scripts/generate_filtered_research.rb
  • tests/command-actions-workflow.test.js
  • tests/command-data-actual.test.js
  • tests/research-filter.test.js

Included review availability: This review used your included allowance. 3 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

📜 Recent review details
🧰 Additional context used
📚 Code guidelines: 1
AGENTS.md — auto-discovered
📓 Path-based instructions: 5
Source excerpt: `command-palette.js` must load **before** `command-data.js` (dependency order; `scripts/fix-script-order.sh` enforces this).

📄 CodeRabbit inference engine (AGENTS.md)

Files:

  • assets/js/command-data.js
Source excerpt: Compose from `bridge.css` primitives where possible.

📄 CodeRabbit inference engine (AGENTS.md)

Files:

  • assets/css/styles.css
  • assets/css/research-v2.css
Source excerpt: Tags must use `
TagName
` in `_research/index.md`.

📄 CodeRabbit inference engine (AGENTS.md)

Files:

  • _research/index.md
Source excerpt: CSS variables in `:root` for light, overridden under `[data-theme="dark"]`.

📄 CodeRabbit inference engine (AGENTS.md)

Files:

  • assets/css/styles.css
  • assets/css/research-v2.css
Source excerpt: 80-char line limit for JavaScript.

📄 CodeRabbit inference engine (AGENTS.md)

Files:

  • tests/command-actions-workflow.test.js
  • assets/js/command-data.js
  • tests/command-data-actual.test.js
  • tests/research-filter.test.js
  • assets/js/page-research.js
🪛 ast-grep (0.45.3)
tests/command-data-actual.test.js

[warning] 125-129: Avoid assigning untrusted data to innerHTML/outerHTML or document.write
Context: document.body.innerHTML = <div class="tags"> <button type="button"></button> </div>
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

(inner-outer-html)

tests/research-filter.test.js

[warning] 9-18: Avoid assigning untrusted data to innerHTML/outerHTML or document.write
Context: document.body.innerHTML = <ul class="toc-list"></ul> <button class="r-theme__tag" data-filter-tag="Viscoelastic">Elasticity</button> <div class="research-content"> <h2>Published work</h2> <h3 id="24">Paper A</h3><div class="tags"><button type="button" aria-pressed="false">Viscoelastic</button></div> <p>Elastic material</p> <h3 id="23">Paper B</h3><div class="tags"><button type="button" aria-pressed="false">Newtonian</button></div> <h2 id="methods">Methods</h2><p>Methods text</p> </div>
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

(inner-outer-html)

[warning] 103-107: Avoid assigning untrusted data to innerHTML/outerHTML or document.write
Context: document.body.innerHTML = <div class="research-content"> <h3 id="24">Paper A</h3><div class="tags"><span>Viscoelastic</span></div> <h3 id="23">Paper B</h3><div class="tags"><span>Newtonian</span></div> </div>
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

(inner-outer-html)

assets/js/page-research.js

[warning] 100-100: Avoid using the initial state variable in setState
Context: setPressed(control, getTagText(control) === tagText)
Note: [CWE-710] Improper Adherence to Coding Standards. Security best practice.

(setstate-same-var)

[error] 100-100: React's useState should not be directly called
Context: setPressed(control, getTagText(control) === tagText)
Note: [CWE-710] Improper Adherence to Coding Standards. Security best practice.

(usestate-direct-usage)

[warning] 115-115: Avoid using the initial state variable in setState
Context: setPressed(control, false)
Note: [CWE-710] Improper Adherence to Coding Standards. Security best practice.

(setstate-same-var)

[error] 115-115: React's useState should not be directly called
Context: setPressed(control, false)
Note: [CWE-710] Improper Adherence to Coding Standards. Security best practice.

(usestate-direct-usage)

🔇 Additional comments: 14
AGENTS.md: 2

83-84: LGTM!

136-136: LGTM!

README.md: 1

348-348: LGTM!

Also applies to: 550-550

_research/index.md: 1

8-24: LGTM!

assets/js/command-data.js: 1

543-545: LGTM!

Also applies to: 661-661

assets/js/page-research.js: 1

79-81: LGTM!

Also applies to: 91-100, 115-115, 131-131, 149-162

scripts/generate_filtered_research.rb: 1

19-19: LGTM!

tests/command-actions-workflow.test.js: 1

105-109: LGTM!

Also applies to: 140-140

tests/command-data-actual.test.js: 1

127-130: LGTM!

tests/research-filter.test.js: 1

67-100: LGTM!

Also applies to: 101-109, 121-127

assets/css/research-v2.css: 2

536-578: LGTM!

566-570: 🩺 Stability & Availability

The focus outline is not clipped by any identified ancestor. The overflow: hidden rules apply to unrelated elements, and .toc-sidebar is a sibling with overflow-y: auto, not an ancestor. No change is required.

assets/css/styles.css: 1

1941-1943: LGTM!

Also applies to: 1956-1957

_layouts/research.html: 1

102-103: LGTM!

📝 Walkthrough

Research topic and publication tags now use buttons with pressed-state attributes. Filtering, tag discovery, styling, examples, and tests support buttons while retaining support for legacy span controls.

Changes: Research tag controls

Layer / File(s) Summary
Tag markup and examples
AGENTS.md, README.md, _research/index.md
Research topic and publication tags change from spans to buttons with aria-pressed="false". The Work in Progress tags appear together in one row. Documentation examples use the button markup.
Filtering and pressed-state handling
assets/js/page-research.js, assets/js/command-data.js, scripts/generate_filtered_research.rb, tests/*research*.test.js, tests/command-actions-workflow.test.js, tests/command-data-actual.test.js
Tag discovery and filtering include buttons and spans. Filtering updates button pressed states; legacy spans retain custom keyboard activation. Tests cover button filtering and legacy-span keyboard handling.
Tag button styling
_layouts/research.html, assets/css/research-v2.css, assets/css/styles.css
Tag styles apply to buttons and spans. The styles add button focus-visible and pressed states, and the layout selector includes pressed research tag buttons.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to 3501c

Research topic chips become keyboard-accessible buttons with pressed-state support and legacy span fallback. No actionable merge-blocking risk remains.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 6 files. (6 skipped: 6 … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: making research topic chips keyboard-reachable teal buttons.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 6 files. (6 skipped: 6 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
✨ Simplify code
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.

Comment @coderabbitai help to get the list of available commands.

@VatsalSy
VatsalSy merged commit a098f8b into main Oct 19, 2026
5 checks passed
@VatsalSy
VatsalSy deleted the rayleigh-cloud/research-topic-chips-teal-e4d7 branch October 19, 2026 10:47
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.

4 participants