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

Text and Images don't seem to work. #21

Open
gavspav opened this issue Dec 6, 2022 · 19 comments
Open

Text and Images don't seem to work. #21

gavspav opened this issue Dec 6, 2022 · 19 comments

Comments

@gavspav
Copy link

gavspav commented Dec 6, 2022

The first 'text' uploaded with the first asset works but then every further asset displays that same text.

In the admin panel all text assets (including the first) read "text not supported".
In the old admin panel however, text assets are visible.

Again, config file is here:

EDIT: just discovered the same is happening with images. They display fine in the admin panel(s) but only the very first image of the project is visible - in every asset window

@gavspav gavspav changed the title Text doesn't seem to work. Text and Images don't seem to work. Dec 6, 2022
@hburgund
Copy link
Member

hburgund commented Dec 6, 2022

First, one critical point that you may be aware of or may not because it is not obvious in all situations: Roundware is audio-based and the photos and text assets are truly "supplemental" in the sense that they are intended to enhance a piece of audio, not exist on their own. There is a mechanism in the Roundware backend - Envelopes - that allows for the grouping of the photo and text assets with a corresponding audio asset. So text and photo assets do not show up on the map on their own, but rather as part of the audio asset and are displayed within the infowindow of that asset assuming the config settings are correct.

I think you are likely aware of all of this, but I'm noting it anyway because I have not otherwise made it clear and it's important!

Regarding the specific issue you raise here, I think I understand what you are saying is happening and this certainly didn't used to be the case, so I will look into reproducing. If you have an example of this behavior posted anywhere that I could see, that would be helpful.

We can improve the admin panel to display text assets better for sure. Right now, you can download the txt file from the asset detail/edit view, but that is clearly not an adequate approach.

@gavspav
Copy link
Author

gavspav commented Dec 6, 2022

Yeah I totally get that about it being audio led - and that is certainly the way we want to use it anyway.
I'm not sure if I explained the issue that well. But if you visit this instance hopefully you can see that all displayed images and text descriptions in the asset window are the same?

@hburgund
Copy link
Member

hburgund commented Dec 6, 2022

Thx for the example; indeed I see the issue!

How have you added these assets? Via the app itself or the admin or some from each? And if some from each, do you see any consistently different behaviors between the two?

To clarify, there is only one photo and one text asset that are showing up everywhere, not multiple copies of the same photo/text in different assets?

And finally, can you look in your admin and see if there is one envelope being used for all of your assets for some reason? You can see that in the asset edit screen. When the infowindow content is created, it is supposed to look for any text and photos assets with the same envelope_id as the corresponding audio asset, so if somehow everything got assigned the same envelope_id, that could be causing this issue and would help debugging.

@gavspav
Copy link
Author

gavspav commented Dec 6, 2022

All these assets have been added via the web app/speak page I think.

Envelope ID's seem to be the same as the asset ID's.

My highest asset ID no. is currently 182. The lowest is 163. We deleted all the assets previous as we were doing some tests. The image and text shown in each asset window are asset 163 and asset 165 - the first image and text I submitted.

If I look at the secondary asset section the id and assets are again the same but they stop at 132.

If I look at the old admin panel envelopes are more how I would expect. The assets I actually uploaded are together within each envelope eg audio + image or ausio + image + text. The envelope id's are the same as with the react admin and the asset id's are correct.

@hburgund
Copy link
Member

hburgund commented Dec 6, 2022

so for each new audio asset you add, is there a new photo asset and text asset also created simultaneously, or are all new audio assets attached to the same two previously existing photo and text assets?

@gavspav
Copy link
Author

gavspav commented Dec 6, 2022

I add an audio asset and if I add a photo and/or a text asset, then the photo/text asset displayed in the asset window is the first image/text I submitted - currently 163/165.

From what I can tell the envelopes are working correctly.

@hburgund
Copy link
Member

hburgund commented Dec 6, 2022

ok, so if you don't try to add a photo/text with the new asset, does the first photo/text still show up or does it just not have any associated photo/text? I ask because it might be some kind of weird caching in the app that is constantly re-uploading the same photo/text despite you selecting different ones...

@hburgund
Copy link
Member

hburgund commented Dec 6, 2022

I have reviewed and think I understand the issue and the causal bug. Shreyas is going to try to fix soon and will keep you posted. Most likely it will be a framework fix.

@gavspav
Copy link
Author

gavspav commented Feb 10, 2023

This seems to be fixed for images but I'm still seeing the same behaviour with text. I'm also getting the same behaviour with your deployment at roundware.surge.sh

@gavspav
Copy link
Author

gavspav commented Feb 11, 2023

This is possibly related but probably more an issue with the browser based admin panel.
At the bottom of each Asset page the Envelope ID seems to be wrong. For me it is just the same as the Asset ID.
The ID's listed in the Envelope section do not correspons.
However in the old admin on the server, the envelope's are described as expected ie one id for several assets

@hburgund
Copy link
Member

Yes, this is related and has been fixed, but not deployed yet to your admin because it is not fully merged into the official admin repo yet. The relevant commit is here:

https://github.com/shreyas-jadhav/roundware-react-admin/commit/47e466906154d561276e6097830f54261510fa49

But you won't be able to access that at this point. I am trying to get a PR made that should allow more access and easy updating.

I believe this entire issue is fixed, but I am behind on final review and closing of issues here.

@gavspav
Copy link
Author

gavspav commented Feb 12, 2023

Aha ok thanks for letting me know. I'm using descriptions as a workaround for now.

Also discovered you can hack hyperlinks in descriptions (and I guess text assets) by using close and open scan tags in the text with a link in between!

@gavspav
Copy link
Author

gavspav commented Oct 11, 2023

I've just updated to the latest version (I think) and text still not working for me.
I've just discovered it works as expected in the admin panel if I view assets by map
Two images here of the same asset info window. The correct text is "Testing the Text" as displayed in the admin (assets by map). The second is the same asset displayed on the map. Text="Round 'Ere" which is my first text asset displayed with every asset.

Screenshot 2023-10-11 at 10 55 50 Screenshot 2023-10-11 at 11 08 11

@hburgund
Copy link
Member

What is in your config.ts file? Infowindow items can be congifured there, so if you could send me what you have that would be helpful for me to assess.
Relevant section:

infoWindowItems: {
    available: ['date', 'tags', 'description', 'audio', 'photo', 'text', 'actions'],
    actionItems: ['like', 'flag', 'show'],
},

It is possible you are using an older config approach as we have changed that relatively recently, I think.

@hburgund
Copy link
Member

I've done a bit of testing and was able to reproduce this issue. It seems like the first text asset for the project is displayed in all asset infowindows.
@shreyas-jadhav I have determined that the GET assets/ call includes envelope_ids as a param and this returns multiple text assets and only the first one is displayed in the infowindow, hence always displaying the first text asset in the project. If the param is changed to envelope_id, it seems to return the proper one for the audio asset in question and presumably the display would then work properly.

So it should be a very easy fix, but presumably in the framework? @gavspav feel free to try this yourself and report back, but @shreyas-jadhav let us know if you can make this update. Thx.

Clearly this is non-intuitive on the part of the API behavior, so I should look into that for a more robust fix, but hopefully this gets past the current functional issue.

@gavspav
Copy link
Author

gavspav commented Oct 11, 2023

Ah thanks. So you mean I should try and edit this in the framework?

Or in the AssetInfoCard.tsx file

In any case I've tried both but I get errors - can't work it out so far!

@hburgund
Copy link
Member

Thx for trying @gavspav. It may be a web app and framework combined fix. I was unable to figure it out quickly, but it doesn't seem like it should be difficult to fix. @shreyas-jadhav can you have a look and let us know how to fix ourselves or make the quick changes and push something? Thanks!

@gavspav
Copy link
Author

gavspav commented Oct 16, 2023

I had another go at this and think I have found a workaround.
In AssetInfoCard.tsx, comment out line 47 and replace with:

// @ts-ignore
envelope_id: asset?.envelope_ids,

Looks like this change has already been made in the 'photo' section slightly earlier in the file. I just didn't realise the importance of //@ts-ignore but googled it and voila.

@hburgund
Copy link
Member

great news, @gavspav ...this might actually be the best solution for now, but we'll see what @shreyas-jadhav thinks.
at least it is no longer blocking you!

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

No branches or pull requests

2 participants