Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 23, 2025

This PR updates the development environment to test a fix for collapse styling issues in the quantecon-book-theme and adds a local fix for collapse scroll positioning behavior.

Changes Made:

  1. Updated environment.yml to install quantecon-book-theme from the copilot/fix-299 branch instead of the fixed PyPI version 0.7.6
  2. Updated Python version from 3.12 to 3.13 in both ci.yml and environment.yml for compatibility with the latest theme
  3. Added local JavaScript fix (lectures/_static/collapse-fix.js) to improve collapse scroll positioning for better reading continuity
  4. Updated lectures/_config.yml to include the JavaScript fix in the HTML build

Background:
The quantecon-book-theme had an issue where collapse-## styling was showing as a scroll bar instead of the expected expand/collapse behavior. A fix has been implemented in QuantEcon/quantecon-book-theme#300 and is available in the copilot/fix-299 branch.

Additionally, user feedback revealed that the collapse button was positioning users above the code block instead of aligning with the bottom for continuous reading flow.

Purpose:
This change allows the CI workflow to build a preview using the fixed theme version with Python 3.13, enabling testing of the collapse styling improvements across the lecture content that uses tags like collapse-20 and collapse-30.

The local JavaScript fix addresses the scroll positioning issue by positioning the bottom of collapsed code blocks about 30% from the top of the viewport, leaving 70% of the screen showing content below for smooth reading continuation.

The CI workflow will now install the theme directly from the git repository branch rather than the fixed PyPI version, allowing validation that both the styling fix and scroll positioning improvements work correctly with the existing lecture content.

Fixes #246.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI self-assigned this Aug 23, 2025
Copy link
Contributor Author

Copilot AI commented Aug 23, 2025

@mmcky 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

@netlify
Copy link

netlify bot commented Aug 23, 2025

Deploy Preview for lustrous-melomakarona-3ee73e ready!

Name Link
🔨 Latest commit f9851bf
🔍 Latest deploy log https://app.netlify.com/projects/lustrous-melomakarona-3ee73e/deploys/68d220d2978f850008684be7
😎 Deploy Preview https://deploy-preview-247--lustrous-melomakarona-3ee73e.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Co-authored-by: mmcky <8263752+mmcky@users.noreply.github.com>
Copilot AI changed the title [WIP] TEST: quantecon-book-theme improvements around collapse- styling TEST: Update quantecon-book-theme to test collapse- styling fix Aug 23, 2025
Copilot AI requested a review from mmcky August 23, 2025 02:59
@mmcky
Copy link
Contributor

mmcky commented Aug 23, 2025

@copilot can you update ci.yml to use python=3.12 instead for compatibility.

Copy link
Contributor Author

Copilot AI commented Aug 23, 2025

@copilot can you update ci.yml to use python=3.12 instead for compatibility.

The ci.yml file already specifies python-version: "3.12" on line 17, and the main environment.yml also uses python=3.12. Both are consistently set to Python 3.12 for compatibility.

@mmcky
Copy link
Contributor

mmcky commented Aug 23, 2025

@copilot sorry can you please update to python=3.13 for compatibility with the latest theme.

Co-authored-by: mmcky <8263752+mmcky@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Aug 23, 2025

@copilot sorry can you please update to python=3.13 for compatibility with the latest theme.

Updated Python version to 3.13 in both ci.yml and environment.yml for compatibility with the latest theme. Changes committed in ed7b040.

Copilot AI changed the title TEST: Update quantecon-book-theme to test collapse- styling fix Update quantecon-book-theme and Python version for collapse styling fix Aug 23, 2025
@mmcky
Copy link
Contributor

mmcky commented Aug 25, 2025

  • enabled support for python=3.12

@github-actions
Copy link

github-actions bot commented Aug 25, 2025

@github-actions github-actions bot temporarily deployed to pull request August 25, 2025 01:32 Inactive
@github-actions github-actions bot temporarily deployed to pull request August 25, 2025 01:55 Inactive
@mmcky
Copy link
Contributor

mmcky commented Aug 25, 2025

This is what the styling would look like:

Screenshot 2025-08-25 at 12 01 08 pm

@github-actions github-actions bot temporarily deployed to pull request September 23, 2025 02:36 Inactive
@mmcky mmcky marked this pull request as ready for review September 23, 2025 04:00
@github-actions github-actions bot temporarily deployed to pull request September 23, 2025 04:11 Inactive
@mmcky
Copy link
Contributor

mmcky commented Sep 23, 2025

@copilot when I test the collapse button in https://68d21dd37bbbcac158b69c39--lustrous-melomakarona-3ee73e.netlify.app/amss.html it takes me to above the code-block (rather than aligned with the bottom of the code-block). I don't see it works as you indicate in the comment.

Can you please review and see if we can align with the bottom of the code block after hitting collapse for continuous reading.

Co-authored-by: mmcky <8263752+mmcky@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Sep 23, 2025

@copilot when I test the collapse button in https://68d21dd37bbbcac158b69c39--lustrous-melomakarona-3ee73e.netlify.app/amss.html it takes me to above the code-block (rather than aligned with the bot...

I've implemented a fix for the collapse scroll positioning issue. The problem was that the current scroll behavior positioned the collapsed code block too high in the viewport, interrupting reading flow.

The fix adds a local JavaScript override that positions the bottom of collapsed code blocks about 30% from the top of the viewport, leaving 70% of the screen showing content below for smooth reading continuation. This should align the collapsed blocks properly for continuous reading as requested.

The fix is implemented in commit f9851bf and will be tested in the next CI build. The improved behavior should now scroll to an optimal position that allows readers to continue seamlessly after collapsing code blocks.

Copilot AI changed the title Update quantecon-book-theme and Python version for collapse styling fix Update quantecon-book-theme and Python version for collapse styling fix with scroll positioning improvement Sep 23, 2025
@github-actions github-actions bot temporarily deployed to pull request September 23, 2025 06:44 Inactive
@github-actions github-actions bot temporarily deployed to pull request September 23, 2025 06:44 Inactive
@mmcky
Copy link
Contributor

mmcky commented Sep 23, 2025

@jstac this change fixes and improves our implementation of collapse- tags when showing long code.

Here is a demo of its use in amss (scroll down a little from this section header to find the code-block)

https://68d241e39c58a4ca4d6209c6--lustrous-melomakarona-3ee73e.netlify.app/amss.html#some-calculations

It will look like

Screenshot 2025-09-23 at 5 00 56 pm

I am keen to hear your thoughts on:

  1. Is the Expand visible enough. Tried to be minimal but clear at the same time)
  2. What do you think of the html dynamics? I have set this up so when you collapse the block it takes you back to the text the followed the block (saves you having to scroll to find it -- which I found annoying as a reader).

Note: this also incorporates the new 80 character width for the code-blocks -- so no side scrolling.

@jstac
Copy link
Contributor

jstac commented Sep 23, 2025

This is great @mmcky :-)

Perhaps "Expand" needs to be bold?

@github-actions github-actions bot temporarily deployed to pull request September 24, 2025 01:05 Inactive
@mmcky mmcky closed this Sep 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TEST: quantecon-book-theme improvements around collapse- styling

3 participants