Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 11, 2025

Motivation

The assistant toggle button was not properly positioned on displays ≥1400px due to invalid CSS properties max-margin-right and max-right in the media query for large screens.

How to test the behavior?

  1. Build the documentation: cd docs && make html
  2. Open docs/_build/html/index.html in a browser
  3. Resize browser window to ≥1400px width
  4. Click "Open Assistant" button
  5. Verify the toggle button stays aligned with the assistant panel edge
  6. Resize to ≥2000px and verify panel width caps at 600px

Or test on the live dev docs at https://pynwb.readthedocs.io/en/dev/

Changes

Before: Used invalid CSS properties that browsers ignore

.assistant-container.show ~ .assistant-toggle {
    right: calc(100vw - 1140px);
    max-right: 600px;  /* Invalid property */
}

After: Use CSS min() function for proper constraint

.assistant-container.show ~ .assistant-toggle {
    right: min(calc(100vw - 1140px), 600px);
}

Applied same fix to width, margin-right, and right properties in the @media (min-width: 1400px) query.

Screenshots

1600px viewport - dynamic sizing:

2000px viewport - capped at 600px:

Checklist

  • Did you update CHANGELOG.md with your changes?
  • Have you checked our Contributing document?
  • Have you ensured the PR clearly describes the problem and the solution?
  • Is your contribution compliant with our coding style? This can be checked running ruff check . && codespell from the source directory.
  • Have you checked to ensure that there aren't other open Pull Requests for the same change?
Original prompt

This section details on the original issue you should resolve

<issue_title>[Bug]: Floating open/close assistant tab for wider displays</issue_title>
<issue_description>### What happened?

See comment in #2140 (comment).

Steps to Reproduce

Use the dev build of the documentation on a larger display: https://pynwb.readthedocs.io/en/dev/

Operating System

macOS

Python Executable

Conda

Python Version

3.9

Package Versions

No response

Code of Conduct

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Fix floating open/close assistant tab for wider displays Fix invalid CSS properties breaking assistant toggle on wide displays Dec 11, 2025
Copilot AI requested a review from rly December 11, 2025 00:31
@codecov
Copy link

codecov bot commented Dec 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.23%. Comparing base (7e100c2) to head (5335ceb).
⚠️ Report is 1 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #2151   +/-   ##
=======================================
  Coverage   95.23%   95.23%           
=======================================
  Files          29       29           
  Lines        2876     2876           
  Branches      740      740           
=======================================
  Hits         2739     2739           
  Misses         83       83           
  Partials       54       54           
Flag Coverage Δ
integration 74.44% <ø> (ø)
unit 84.94% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rly
Copy link
Contributor

rly commented Dec 11, 2025

@copilot Update the changelog with a link to this PR #2151

Copy link
Contributor Author

Copilot AI commented Dec 11, 2025

@copilot Update the changelog with a link to this PR #2151

Updated in commit dba2312.

@rly rly marked this pull request as ready for review December 11, 2025 20:17
@rly rly enabled auto-merge (squash) December 11, 2025 20:17
@rly rly requested a review from stephprince December 12, 2025 00:26
@rly rly merged commit 4c28a99 into dev Dec 12, 2025
25 checks passed
@rly rly deleted the copilot/fix-floating-assistant-tab branch December 12, 2025 00:42
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.

[Bug]: Floating open/close assistant tab for wider displays

3 participants