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

Add audio source count per sentence for user audio contributions page #3121

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

cblanken
Copy link
Contributor

This PR solves issue #2944

So far I've only tested on a couple audio sources as shown in the screenshot, but this solution should work for any number of audio sources. I'll do some more testing when I get a script working to import audio files automatically.
image

@jiru
Copy link
Member

jiru commented Apr 22, 2024

Thanks! 🙂 I have a few comments.

From my understanding, the code you changed also affects the display of sentences everywhere on the website, including search results etc. I wonder if this is a necessary or wanted change.

Since the majority of sentences with audio only have one audio, I suggest not displaying anything in that case to reduce cognitive load.

@cblanken
Copy link
Contributor Author

cblanken commented Apr 22, 2024

From my understanding, the code you changed also affects the display of sentences everywhere on the website, including search results etc. I wonder if this is a necessary or wanted change.

I can't quite pin down why, but there does appear to be a different component for the regular sentence search. The changes I've made only seem to affect the search by audio page (/audio/index) and the individual contributor audio page (/audio/of/<contributor>).

In the long run, I think it would be nice to have a complete dropdown menu to select available audios and replay them at will instead of cycling through them one at a time especially if any features to mark audios as particular dialects/accents are ever implemented. A number indicator telling how many different audios exist for a sentence is a good stopgap though.

/audio/index

image

/audio/of/contributor

image

Main Sentence Search

image

Edit:
I removed the counts for sentences with only one audio and added a bit of right-side padding, so it should work well for sentences up to 2 digits. I doubt many sentences will ever get more than 99 audios.

@jiru
Copy link
Member

jiru commented Apr 23, 2024

Thank you for making the change I suggested.

I can't quite pin down why, but there does appear to be a different component for the regular sentence search. The changes I've made only seem to affect the search by audio page (/audio/index) and the individual contributor audio page (/audio/of/).

Sorry I wasn’t very clear. Sentences can be displayed using two different designs, because we "in the process" of migrating from the "old design" to the "new design". There is a setting in user preferences that allows you to switch between both, it says:

Display sentences with the old design. Note that the old design will be removed at some point.

You can see the difference between both designs on the search results page for example. Using the old design, your change does affect search results (and pretty much all the other pages where sentences are displayed).

As for the /audio/index and /audio/of/<contributor> pages, they both happen to use the old design no matter what the setting says, because they have not been migrated yet.

As for the impact of your change, the only concern I have is that your change reduces the available space for sentence text, especially in search results where the space is already reduced compared to other places, because of the right pane. Looking back, at some point we added the audio icon, then the copy-paste button, which makes the whole thing more and more crowded, I think we want to avoid adding yet another item.

I think that while it totally makes sense to make the "number of audios" prominently visible on /audio pages, maybe not so much in other pages where audio isn’t the main focus. Maybe the display can be adjusted with a CSS specific to /audio pages.

@cblanken
Copy link
Contributor Author

cblanken commented Apr 23, 2024

Ah, I see now. Thank you. I was really confused what was going on 😅

As for the impact of your change, the only concern I have is that your change reduces the available space for sentence text, especially in search results where the space is already reduced compared to other places, because of the right pane. Looking back, at some point we added the audio icon, then the copy-paste button, which makes the whole thing more and more crowded, I think we want to avoid adding yet another item.

If space is the main concern, I think the audio count could be minimized a bit, so it only takes up about 1 character's width at most. Like this:

/audio/index

image

/sentences/search

image

This solution just adds an extra 3/4 character width in margin on the right to make space for up to 2 digits in the audio count (the audio count font size is 60% of the main sentence font size here).

I think that while it totally makes sense to make the "number of audios" prominently visible on /audio pages, maybe not so much in other pages where audio isn’t the main focus. Maybe the display can be adjusted with a CSS specific to /audio pages.

@jiru I think it would be better for the audio playback interface to be consistent between pages whether that means leaving out the audio count entirely or adding it, but I can look into applying it specifically to the /audio pages if you really think that's the way to go?

@jiru
Copy link
Member

jiru commented Apr 29, 2024

If space is the main concern

My concern is also about cognitive load. More things displayed means it takes longer for the eyes and brain to process the information.

@jiru I think it would be better for the audio playback interface to be consistent between pages whether that means leaving out the audio count entirely or adding it, but I can look into applying it specifically to the /audio pages if you really think that's the way to go?

I understand the point of having a consistent interface, but striking for consistency is also what made us to build the current sentences+translations block, which is somewhat crowded. This block has all the functionalities, you can do anything everywhere, but in terms of design I think it is rather disconnected from the context of the page it is displayed in. Sorry for digressing. 😆

As showed in issue #2944 there are good reasons to add the number of audio in audio pages. Let’s add it to the audio pages only for now, and if we figure out there is a need somewhere else, or everywhere, we can later add it there too.

@jiru
Copy link
Member

jiru commented Apr 29, 2024

By the way it seems your changes break the display of sentences with transcriptions:
image

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.

None yet

2 participants