Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SICP JS: Rework program snippets #1832

Merged
merged 5 commits into from
Jun 27, 2021

Conversation

samuelfangjw
Copy link
Contributor

@samuelfangjw samuelfangjw commented Jun 26, 2021

Description

This PR is dependent on source-academy/sicp#545.

  1. Fixes Env viz: wrong line highlighted when code is folded #1830.
  2. Reworked how snippet dependencies are hidden. Dependencies are now hidden by code folding instead. This solves the environment model not working with dependencies bug and the bug where some program snippets cannot be run when dependencies are hidden because the prepend was evaluated in a different scope to the main body.

Screenshot 2021-06-26 at 8 38 07 PM

In the image above, taken from the third program snippet in section 3.2.3, lines 2 to 15 are hidden. A user can click on the yellow button to reveal dependencies.

Screenshot 2021-06-26 at 8 39 09 PM

With this solution the only way to hide dependencies again is to close and reopen the snippet.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Code quality improvements

How to test

  1. Ensure correct lines are highlighted when using env visualiser with and without code folding.
  2. Ensure snippets with dependencies are hidden correctly and can be revealed by pressing the yellow button. The env viz should also work correctly when dependencies are hidden.

Checklist

  • I have tested this code
  • I have updated the documentation

@coveralls
Copy link

Pull Request Test Coverage Report for Build 974181707

  • 0 of 6 (0.0%) changed or added relevant lines in 1 file are covered.
  • 2 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.03%) to 30.031%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/pages/playground/Playground.tsx 0 6 0.0%
Files with Coverage Reduction New Missed Lines %
src/pages/playground/Playground.tsx 1 1.78%
src/pages/sicp/subcomponents/SicpWorkspaceContainer.tsx 1 11.76%
Totals Coverage Status
Change from base Build 974170028: -0.03%
Covered Lines: 3199
Relevant Lines: 9806

💛 - Coveralls

@coveralls
Copy link

Pull Request Test Coverage Report for Build 975272159

  • 0 of 6 (0.0%) changed or added relevant lines in 1 file are covered.
  • 2 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.03%) to 30.031%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/pages/playground/Playground.tsx 0 6 0.0%
Files with Coverage Reduction New Missed Lines %
src/pages/playground/Playground.tsx 1 1.78%
src/pages/sicp/subcomponents/SicpWorkspaceContainer.tsx 1 11.76%
Totals Coverage Status
Change from base Build 974255973: -0.03%
Covered Lines: 3199
Relevant Lines: 9806

💛 - Coveralls

@martin-henz martin-henz self-requested a review June 27, 2021 01:50
Copy link
Member

@martin-henz martin-henz left a comment

Choose a reason for hiding this comment

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

Works fine.

@martin-henz martin-henz merged commit 2a49520 into source-academy:master Jun 27, 2021
@samuelfangjw samuelfangjw deleted the rework-code-snippets branch July 1, 2021 08:58
@coveralls
Copy link

coveralls commented Sep 19, 2024

Pull Request Test Coverage Report for Build 975272159

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 6 (0.0%) changed or added relevant lines in 1 file are covered.
  • 2 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.03%) to 30.031%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/pages/playground/Playground.tsx 0 6 0.0%
Files with Coverage Reduction New Missed Lines %
src/pages/playground/Playground.tsx 1 1.78%
src/pages/sicp/subcomponents/SicpWorkspaceContainer.tsx 1 11.76%
Totals Coverage Status
Change from base Build 974255973: -0.03%
Covered Lines: 3199
Relevant Lines: 9806

💛 - Coveralls

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.

Env viz: wrong line highlighted when code is folded
3 participants