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

SF-3029 Hide bottom bar while answering or commenting #2841

Merged
merged 5 commits into from
Dec 5, 2024

Conversation

josephmyers
Copy link
Collaborator

@josephmyers josephmyers commented Nov 6, 2024

This helps the user focus on their immediate task and frees up vertical space. It is based off the presence of the CheckingInputComponent, which contains the textarea for keyboard entry. However, we don't want to base it off of having the textarea focused, since audio would cause it to reappear. It is better to rely solely on the presence of this component.

When this property is set, it will in turn set a class which disables the display of the question-nav. This was necessary, as opposed to putting the textHasFocus check in the surrounding @if condition, to avoid "changed after checked" errors.

I also experimented with animating the show/hide, but it didn't look good with all the other resizing (splitter + keyboard).


This change is Reviewable

Copy link

codecov bot commented Nov 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.24%. Comparing base (402fb28) to head (68f3cc6).
Report is 100 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2841      +/-   ##
==========================================
+ Coverage   79.23%   79.24%   +0.01%     
==========================================
  Files         534      534              
  Lines       31056    31060       +4     
  Branches     5063     5064       +1     
==========================================
+ Hits        24606    24613       +7     
- Misses       5659     5669      +10     
+ Partials      791      778      -13     

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

@josephmyers josephmyers marked this pull request as ready for review November 6, 2024 04:38
@josephmyers josephmyers added the will require testing PR should not be merged until testers confirm testing is complete label Nov 6, 2024
@pmachapman pmachapman self-assigned this Nov 6, 2024
@pmachapman pmachapman self-requested a review November 6, 2024 17:55
Copy link
Collaborator

@pmachapman pmachapman left a comment

Choose a reason for hiding this comment

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

The code looks good, but with your PR I get an "NG0100: ExpressionChangedAfterItHasBeenCheckedError" error when I:

  1. Open a comment or answer for editing.
  2. Change the chapter number to a chapter without a question (it may also occur when changing chapter to another chapter with a question).
  3. The error dialog will appear.

See: https://youtu.be/-LVHAGvjveI

This occurs on mobile and desktop.

Reviewed 5 of 5 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @josephmyers)

@RaymondLuong3 RaymondLuong3 force-pushed the feature/SF-3007-comment-audio branch from eac859b to 58fca90 Compare November 7, 2024 22:31
@Nateowami Nateowami force-pushed the feature/SF-3007-comment-audio branch from 4893495 to c8bdb59 Compare November 14, 2024 20:21
Base automatically changed from feature/SF-3007-comment-audio to master November 14, 2024 20:36
Copy link
Collaborator Author

@josephmyers josephmyers left a comment

Choose a reason for hiding this comment

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

I had to do a bit of footwork to fix this, but I've fixed a couple bugs and oddities in the process. Please see my checkin comments for more details.

Reviewable status: 1 of 6 files reviewed, all discussions resolved (waiting on @pmachapman)

Copy link
Collaborator

@pmachapman pmachapman left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 4 of 4 files at r2, 2 of 2 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @josephmyers)

@pmachapman pmachapman added ready to test and removed will require testing PR should not be merged until testers confirm testing is complete labels Dec 4, 2024
@josephmyers
Copy link
Collaborator Author

josephmyers commented Dec 4, 2024

@pmachapman I oopsied and forgot to read the JIRA description. After I did, I had to make two small but potentially impacting changes. Since you've already approved and gone home scooted back from your desk for the day, I'm going to leave this in the Test column. Feel free to revert your approval, though

Copy link
Collaborator

@pmachapman pmachapman left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r4, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @josephmyers)

This helps the user focus on their immediate task and frees up vertical space. It is based off the presence of the CheckingInputComponent, which contains the textarea for keyboard entry. However, we don't want to base it off of having the textarea focused, since audio would cause it to reappear. It is better to rely solely on the presence of this component.

When this property is set, it will in turn set a class which disables the display of the question-nav. This was necessary, as opposed to putting the textHasFocus check in the surrounding @if condition, to avoid "changed after checked" errors.

I also experimented with animating the show/hide, but it didn't look good with all the other resizing (splitter + keyboard).
This fixes the NG0100 error when the bottom bar is hidden but the user then moves to a chapter with no questions. Hiding the bottom bar in this case also makes sense, given that the bottom bar is somewhat broken then. Since there is no selected question at the new chapter, the software maintains the selected question from the other chapter, meaning that the Next and Previous buttons don't make sense. The user can easily restore the bottom bar at this chapter by adding a question.

This change is also required (mysteriously) for the followon change to fix the donut, which has been broken for quite some time.
This restores functionality to the donut, which is currently broken on Live. I'm not sure how this was ever working updating the view when the data changes, but my guess is that the callers were destroying and recreating the component whenever the data changed, avoiding this issue. I would imagine it's better practice to not require this.
This is per the JIRA task description
@Nateowami Nateowami force-pushed the improvement/SF-3029 branch from 61999b6 to 68f3cc6 Compare December 5, 2024 16:02
@Nateowami Nateowami added testing complete Testing of PR is complete and should no longer hold up merging of the PR and removed ready to test labels Dec 5, 2024
@Nateowami Nateowami enabled auto-merge (squash) December 5, 2024 16:04
@Nateowami Nateowami merged commit da9bdd2 into master Dec 5, 2024
13 checks passed
@Nateowami Nateowami deleted the improvement/SF-3029 branch December 5, 2024 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing complete Testing of PR is complete and should no longer hold up merging of the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants