Skip to content

Commit

Permalink
Chapter audio only hides bottom bar if scripture text is shown
Browse files Browse the repository at this point in the history
This fixes an issue where "hide text" projects couldn't navigate questions on mobile, since the bottom bar is now being hidden.

So now, we don't hide the bottom bar if "hide text" is enabled. We will instead only hide the bar if the "hide text" is disabled and the chapter audio is shown. Effectively, this is when "the user opens the chapter audio."

The second case where we hide the bar remains. I did a slight refactoring to make all this clear and readable.

The original reason for the hiding behavior is still intact, that being to free up space on mobile and keep users focused on their intended task.
  • Loading branch information
josephmyers authored and RaymondLuong3 committed Dec 18, 2024
1 parent e3e072a commit addcd7e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ <h2 matSubheader>{{ t("filter_questions") }}</h2>
</div>
</div>
@if (projectDoc && totalVisibleQuestions() > 0) {
<div id="question-nav" [ngClass]="{ hide: (textHasFocus && isScreenSmall) || showScriptureAudioPlayer }">
<div id="question-nav" [ngClass]="{ hide: textboxIsShownMobile || userOpenedChapterAudio }">
@if (!isQuestionListPermanent) {
<button mat-button type="button" (click)="setQuestionsOverlayVisibility(true)">
{{ t("view_questions") }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,20 @@ export class CheckingComponent extends DataLoadingComponent implements OnInit, A
return this.projectDoc?.data?.checkingConfig.hideCommunityCheckingText ?? false;
}

get userOpenedChapterAudio(): boolean {
return this.showScriptureAudioPlayer && !this.hideChapterText;
}

get textboxIsShown(): boolean {
const isAnswering = this.answersPanel?.answerInput != null;
const isCommenting = this.answersPanel?.allComments?.find(c => c.inputComponent != null) != null;
return isAnswering || isCommenting;
}

get textboxIsShownMobile(): boolean {
return this.textboxIsShown && this.isScreenSmall;
}

get isRightToLeft(): boolean {
if (this.projectDoc?.data?.isRightToLeft != null) {
return this.projectDoc.data.isRightToLeft;
Expand Down Expand Up @@ -1082,12 +1096,6 @@ export class CheckingComponent extends DataLoadingComponent implements OnInit, A
}
}

get textHasFocus(): boolean {
const isAnswering = this.answersPanel?.answerInput != null;
const isCommenting = this.answersPanel?.allComments?.find(c => c.inputComponent != null) != null;
return isAnswering || isCommenting;
}

/**
* Retrieves the adjacent question based on the active question and the direction.
* Adjacent question might be outside the current filtered scope.
Expand Down

0 comments on commit addcd7e

Please sign in to comment.