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

feat: audio component can be passed transcript text and launch own popup #2460

Merged
merged 10 commits into from
Oct 10, 2024

Conversation

jfmcquade
Copy link
Collaborator

@jfmcquade jfmcquade commented Oct 8, 2024

PR Checklist

  • PR title descriptive (can be used in release notes)

Description

Follow up to #2448.

Adds a parameter, transcript_text to the audio component. This parameter takes a string value, which should represent the text of the transcript for the associated audio file. If a value for transcript_text is provided, then the audio component will show the "info button" icon (i.e. show_info_button is set to true), and clicking on this button will automatically launch a pop-up to display the text when the "info button" is clicked, without having to manually author an action, as was the case after #2448 (although custom action handling is still supported).

Git Issues

Closes #

Screenshots/Videos

comp_audio

Screenshot 2024-10-08 at 17 15 56 Screenshot 2024-10-08 at 17 16 28

Copy link

github-actions bot commented Oct 8, 2024

Visit the preview URL for this PR (updated for commit 4d0ff66):

https://plh-teens-app1--pr2460-feat-audio-player-co-00nwwtq8.web.app

(expires Thu, 24 Oct 2024 10:39:25 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: e4c0bab6b08dd290fbf002fd6e07987fa4b5fce1

Copy link
Member

@chrismclarke chrismclarke left a comment

Choose a reason for hiding this comment

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

Really nice you were able to get this working so smoothly, I really like the implementation overall and think it should simplify things for authors nicely. See a few minor comments inline, but otherwise I'd say should be good to go

(emittedValue)="handleEmittedValue($event)"
></plh-template-container>
@if (props.textOnly) {
<div class="large standard normal" [innerHTML]="props.text | markdown"></div>
Copy link
Member

Choose a reason for hiding this comment

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

large standard normal - which is it??! 😅

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeh this is pretty gross... I was using the same pattern to apply those styles as is used by the text component, but now I've updated it so that the pop-up component, when called to display text only, uses an instance of the text component itself. See 50cc535

The text component styling could still do with some tidying up, but at least this means that it's still only in one place

@jfmcquade
Copy link
Collaborator Author

Thanks @chrismclarke, I've addressed your points. I think this should be good to go, pending any opinions you have on my changes to the text component to enable it to be instantiated from within a parent component, see 50cc535

@chrismclarke
Copy link
Member

Thanks @chrismclarke, I've addressed your points. I think this should be good to go, pending any opinions you have on my changes to the text component to enable it to be instantiated from within a parent component, see 50cc535

I really like leveraging the existing text component to be able to inherit consistent styling, although would much prefer to isolate the text component from these changes. We've already had to update the common popup component to add support for direct text, I think it starts to feel a bit over-engineered to then also be changing the text component to handle case when being rendered directly within a popup.

So I'd say better to just create an ad-hoc template row in the popup component so that the text can display in the usual way

@chrismclarke
Copy link
Member

chrismclarke commented Oct 9, 2024

Possibly too many changes to easily merge as "suggested changes" but hopefully you get the idea at least. Let me know what you think (probably should have done as a PR targetting this branch instead)

@jfmcquade
Copy link
Collaborator Author

So I'd say better to just create an ad-hoc template row in the popup component so that the text can display in the usual way

Ah good idea. I'd forgotten how easy it is to pass in a value for [row]. I've updated this PR to use that pattern, and reverted the changes to the text component (I think I'll make a follow-up PR just refactoring text somewhat)

Copy link
Member

@chrismclarke chrismclarke left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks for making the updates. Oh yeah, nice idea to tidy up the text component, had thought the same while looking at it

Copy link
Collaborator

@esmeetewinkel esmeetewinkel left a comment

Choose a reason for hiding this comment

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

Functional test passed

@esmeetewinkel esmeetewinkel merged commit a2cbeaa into master Oct 10, 2024
8 checks passed
@esmeetewinkel esmeetewinkel deleted the feat/audio-player-compact-variant branch October 10, 2024 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Work on app features/modules test - preview Create a preview deployment of the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants