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

Only show audio translation option if available #189

Merged
merged 1 commit into from
Aug 1, 2024

Conversation

odkhang
Copy link
Collaborator

@odkhang odkhang commented Aug 1, 2024

This PR closes/references issue #171 . It does so by check if translation size of video to hide/unhide audio translation box

How has this been tested?

Checklist

  • I have added tests to cover my changes.

Summary by Sourcery

This pull request enhances the user interface by conditionally displaying the audio translation dropdown only when more than one language is available, improving the user experience by hiding unnecessary options.

  • Enhancements:
    • Conditionally display the audio translation dropdown only if more than one language is available.

Copy link

sourcery-ai bot commented Aug 1, 2024

Reviewer's Guide by Sourcery

This pull request addresses issue #171 by adding a conditional check to the audio translation dropdown in the 'item.vue' file. The dropdown will now only be displayed if more than one language is available. This change ensures that the audio translation option is only shown when applicable, improving the user interface.

File-Level Changes

Files Changes
webapp/src/views/rooms/item.vue Added a conditional check to display the audio translation dropdown only when multiple languages are available.

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @odkhang - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider adding unit tests to verify the AudioTranslationDropdown component's behavior with different language array inputs, including edge cases like empty or null arrays.
Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

@@ -8,7 +8,7 @@
reactions-bar(:expanded="true", @expand="activeStageTool = 'reaction'")
//- reactions-bar(:expanded="activeStageTool === 'reaction'", @expand="activeStageTool = 'reaction'")
// Added dropdown menu for audio translations near the reactions bar
AudioTranslationDropdown(:languages="languages", @languageChanged="handleLanguageChange")
AudioTranslationDropdown(v-if="languages.length > 1", :languages="languages", @languageChanged="handleLanguageChange")
Copy link

Choose a reason for hiding this comment

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

question: Consider edge cases for languages array

The current condition ensures the dropdown is only shown when there are multiple languages. Have you considered how the component should behave if the languages array is empty? Is the current behavior (not rendering in that case) intentional?

@@ -8,7 +8,7 @@
reactions-bar(:expanded="true", @expand="activeStageTool = 'reaction'")
//- reactions-bar(:expanded="activeStageTool === 'reaction'", @expand="activeStageTool = 'reaction'")
Copy link

Choose a reason for hiding this comment

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

suggestion: Remove commented-out code if no longer needed

If this commented-out line is no longer needed, consider removing it to improve code readability. If it's kept for future reference, adding a comment explaining why might be helpful.

Suggested change
//- reactions-bar(:expanded="activeStageTool === 'reaction'", @expand="activeStageTool = 'reaction'")
// If this line is needed for future reference, please uncomment and use it accordingly.
// reactions-bar(:expanded="activeStageTool === 'reaction'", @expand="activeStageTool = 'reaction'")

@odkhang
Copy link
Collaborator Author

odkhang commented Aug 1, 2024

This room did not have audio translation
image

image

No translation box is showed

@mariobehling mariobehling merged commit 8f63b54 into fossasia:development Aug 1, 2024
1 of 2 checks passed
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.

2 participants