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

[feature] support of additional data formats #1

Open
4 tasks done
koebel opened this issue Feb 29, 2024 · 20 comments
Open
4 tasks done

[feature] support of additional data formats #1

koebel opened this issue Feb 29, 2024 · 20 comments

Comments

@koebel
Copy link
Contributor

koebel commented Feb 29, 2024

Would be nice if the extension would support more commonly used 3D file formats like OBJ, FBX, STL

User Story

As a user
I want to open my 3D objects (of various file format types like .obj, .fbx and .stl) in the app
so that I can preview the files.

Acceptance Criteria

  • Preview 3D objects of file formats .obj, .fbx, .stl

File formats

@koebel
Copy link
Contributor Author

koebel commented Apr 11, 2024

just discovered that someone else has written an app that displays 3D models of some different file formats
https://marketplace.owncloud.com/apps/files_3dviewer

maybe we can check what plugins / frameworks they used for their implementation and see if your app can easily support theses file formats too?

@alexstocker
Copy link
Contributor

Hello @koebel Can I support, assist or contribute?

@saw-jan
Copy link
Owner

saw-jan commented Oct 11, 2024

Hello @koebel Can I support, assist or contribute?

yes please. You are very welcome to contribute

@alexstocker
Copy link
Contributor

alexstocker commented Oct 11, 2024

Hello @saw-jan

Well, I did a (really) basic implementation for STL and FBX file support (no e2e tests, no code separation, no icons ...) on my fork development branch alexstocker/web-app-3dmodel-viewer/1.0-devel.

I don't want to add a pull request on your master directly as long as a set of minimal quality standards is not defined. Did you think about branching strategy, coding standards, patterns and principles already?

@kulmann I am pretty sure there are some best practice quality standards and guidelines for oCIS web defined already. Can you tell me please where to refer to?

@saw-jan
Copy link
Owner

saw-jan commented Oct 11, 2024

The repo is fairly small and simple, so there're no such proper contribution guidelines. I would suggest to make a PR to the master branch, review it and merge it. As per your branch, it looks good already, so please make a PR to the master branch.

saw-jan added a commit that referenced this issue Oct 14, 2024
* Added basic STL support

* Added AxesHelper

* Added basic FBX support

* Added basic OBJ support and fixed unloading models on prev/next

* Modified CHANGELOG

* Lint fix

* Update src/index.ts

Co-authored-by: Sawjan Gurung <[email protected]>

* Update src/App.vue

Co-authored-by: Sawjan Gurung <[email protected]>

* Update src/App.vue

Co-authored-by: Sawjan Gurung <[email protected]>

* Remove scene.remove for renderNewModel. no longer needed

---------

Co-authored-by: Alexander Stocker <[email protected]>
Co-authored-by: Sawjan Gurung <[email protected]>
@alexstocker
Copy link
Contributor

@saw-jan @kulmann I would like to assign different icons related to the mime type of a file. It looks like this is handled more less like OC10 or did I miss something? https://doc.owncloud.com/ocis/next/deployment/services/s-list/app-registry.html#mime-type-configuration.

Background: I did this already once https://github.com/alexstocker/3dviewer-for-owncloud/blob/main/js/fileinfo.js#L31 but imho there should be a better way.

@saw-jan
Copy link
Owner

saw-jan commented Oct 14, 2024

It should be possible to add an icon based on the file extension in

extensions: Object.keys(mimeTypes).map((extension) => ({
extension,
mimeType: mimeTypes[extension],
label: 'View 3D Model'
}))

But I think it will only accept existing icon name like
icon: 'resource-type-graphic',

don't know if it will accept url or not

@alexstocker
Copy link
Contributor

@saw-jan I know, but

  1. this affects the file details (context menu) icon only
  2. and yes, this approach allows already registered icons only

ocis-view-3d-model_filetype-icon_001

To get custom icons related to the mimeType and/or filetype extension within the file list view, without the need of asking an admin to register additional icons, the only way I found was https://github.com/alexstocker/3dviewer-for-owncloud/blob/main/js/fileinfo.js#L31 (related to OC10).

I wonder there is still no other way with oCIS?

@saw-jan
Copy link
Owner

saw-jan commented Oct 14, 2024

I wonder there is still no other way with oCIS?

I also don't know the details. Maybe @kulmann can help us.

@alexstocker
Copy link
Contributor

@saw-jan Thank you. I guess adding custom icons should be an feature|enhancement issue|task for its own.

@kulmann
Copy link
Contributor

kulmann commented Oct 14, 2024

You can also provide an img instead of an icon field. That will render into an oc-img component and puts the img value into the src attribute. You could try to ship an icon-image with this app and reference it via relative URL in the img field. I have no clue if this works, but it seems to be worth a try. Absolute URLs to external image sources are not an option unfortunately, because that would need an img-src CSP rule added to the ocis csp.yaml by each and every admin who uses this app.

If referencing an image shipped with you app doesn't work, we'll make it work in web core. I'd appreciate an issue in the web repo in that case. ❤️

But: I'm not happy with having different icons for different file types for one and the same app. You should really find an icon which builds a strong association with the app, not the file type.

@kulmann
Copy link
Contributor

kulmann commented Oct 14, 2024

@kulmann I am pretty sure there are some best practice quality standards and guidelines for oCIS web defined already. Can you tell me please where to refer to?

Hey, our dev docs need to be updated urgently with regards to dev conventions, but there is something available here: https://owncloud.dev/clients/web/development/conventions/

Also some docs about the extension system are available, they are pretty much up to date: https://owncloud.dev/clients/web/extension-system/

We have recently moved apps and extensions out of the web monorepo which gave us lots of insights what's needed for external repos. We came up with https://github.com/owncloud/web-app-skeleton so that no one needs to come up with all the project boilerplate on their own.

I think this should give you some pointers. Really, really happy about any kind of feedback or improvements. I'd love to encourage you to come up with issues (best in web monorepo), pull requests and chat with us about any issue you have, no matter how big or insignificant it seems.

@alexstocker
Copy link
Contributor

But: I'm not happy with having different icons for different file types for one and the same app. You should really find an icon which builds a strong association with the app, not the file type.

@kulmann Thanx for clarifying. That is the information I was missing. I would say, from a user perspective, having icons related to the file type could improve the user experience, but that's just my point of view.

@kulmann
Copy link
Contributor

kulmann commented Oct 14, 2024

But: I'm not happy with having different icons for different file types for one and the same app. You should really find an icon which builds a strong association with the app, not the file type.

@kulmann Thanx for clarifying. That is the information I was missing. I would say, from a user perspective, having icons related to the file type could improve the user experience, but that's just my point of view.

For icons representing file types in the file list / tiles view / file details / search etc you can always make a pull request to web. Happy to have an icon for every possible file type. 😇 See here for an example: https://github.com/owncloud/web/pull/11646/files (normally it's preferred to have no colors in the svg itself, but assign a color var to it in the mapping in packages/web-pkg/src/helpers/resource/icon.ts ).

@koebel
Copy link
Contributor Author

koebel commented Oct 29, 2024

@alexstocker the different icons you've pointed out in the screenshot above are because on the left it displays the icon related to the file type and in the menu on the right the icon related to the specific viewer/editor. A viewer might support multiple file types and for some file types multiple viewers & editors might be available. In the later case, a list of all of them is displayed in the menu. Not sure if this helps for clarification and your thoughts on what would lead to the best user experience...

@alexstocker
Copy link
Contributor

@koebel Thank's for your reply and good point, I guess, but I am not sure if, within the context/action menu, there should appear more than one App to handle a file from a specific type. Maybe I got something wrong.

image

@kulmann is ocis web really designed that way? If yes, the context/action could contain something like "open with....". I need to investigate on this.

@koebel
Copy link
Contributor Author

koebel commented Nov 8, 2024

@alexstocker a specific context I'm aware of are .md files where there is an editor available for editing the content and our recently released Presentation Viewer for viewing presentations rendered from .md files

@saw-jan saw-jan mentioned this issue Nov 12, 2024
@alexstocker
Copy link
Contributor

@koebel Thanx and tatsächlich didn't expect that. Nice.

@alexstocker
Copy link
Contributor

alexstocker commented Nov 15, 2024

@koebel @saw-jan So, what we are going to need is a decision about icons and designs.

  • does somebody know a designer how would take care of?
  • should we have on icon for every file type or one for each?
  • how should the app icon look like?
  • shouldn't it be worth to have at least one issue|ticket for icon design and adding?

image
image

alexstocker/ocis-web@3d4b2e7
alexstocker@404723a

@koebel
Copy link
Contributor Author

koebel commented Nov 15, 2024

@alexstocker I've previously been told by @kulmann to use as much as possible icons from https://github.com/owncloud/web/tree/master/packages/design-system/src/assets/icons . they are from font awesome and remix icons.
If there is a need for additional icons, it was recommended to try to get icons upstream into remix icons, through a PR to https://github.com/Remix-Design/RemixIcon. I did that for another ocis web extension and my suggestions got accepted by remix design.
alternatively you can use img instead of icons as @kulmann outlined above (#1 (comment))

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

4 participants