Wingysam / Christmas-Community

Christmas lists for families
GNU Affero General Public License v3.0
263 stars 42 forks source link

Feature Request - Export list to csv #153

Open brian-ebarb opened 1 day ago

brian-ebarb commented 1 day ago

Would be helpful to be able to export an individual list or all lists to CSV to give to other family members not tech saavy or able to access the network/container it's running in.

Wingysam commented 1 day ago

For family members who aren't tech-savvy, wouldn't it be better to print the list out? Although I just tried printing a wishlist out and the print view seems to be broken.

I do see the value in a CSV export though, maybe appending /csv can return a csv of the wishlist? I would say appending .csv but someone could have .csv in their username. It could also be done based on the Accept header but using that is impractical in a web browser.

brian-ebarb commented 1 day ago

Why not just add a button on the bottom of the list that fires off typescript function that builds a map with data in current table, and then write that map to a csv. And then allow access to that file via a link you create on the fly in your function after csv creation loop. Or you can just always have it built and ready for dl do it via onload and page refresh rebuilds the csv.. lot of approaches tbh

Wingysam commented 1 day ago

Because I'd rather not complicate the UI with features that most people don't use.

brian-ebarb commented 1 day ago

Hey it's your codebase and your call for sure. But a button that says "Export to Csv" is generally not out of place on any table. And to answer your original question, printing it and handing it to someone isn't possible necessarily. In my particular use case I was looking for an easier way to give the lists to a locally hosted ai model so it could send it to others for me lol

Wingysam commented 1 day ago

There's something to be said for feature discoverability, hiding it behind a magic "add /csv to the url" is obscure at best. I want to avoid the UI looking like an airplane cockpit, but sometimes adding new features is okay. I think I should experiment with it and see how it looks. Passing the lists to LLMs is interesting! Please let me know how it goes once CSV export is implemented.

brian-ebarb commented 1 day ago

You bet! Mostly just trying to use CrewAI (when it cooperates) to interact with Home Assistant. If I get anything neat to work I'll make a repo and circle back and link you! :)