-
Notifications
You must be signed in to change notification settings - Fork 1
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
Communication
: Allow users to view and download sent attachments
#239
base: develop
Are you sure you want to change the base?
Communication
: Allow users to view and download sent attachments
#239
Conversation
Communication
: Allow users to view sent attachmentsCommunication
: Allow users to view and download sent attachments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking very good overall, I think this is really a major improvement for the app. Good job! 😊
Besides the code comments, I have a few general remarks:
- When opening the pdf, it shows a page count of "Page 3/18", even though only the first 1,5 pages are visible. But I think you mentioned something about the page indicator behaving weirdly, so if there is no easy fix, its also fine if we leave it as is :)
- The name of the pdf is currently just the timestamp (if think), could we change this to the name displayed in the markdown link? When I eg download the slides I cant really judge what the content of the file is by its name.
- The action labelled with "Rotate PDF" felt quite counter-intuitive for me, from this name I would have expected the pdfs to rotate 90°. But I also can't find a short, better fitting alternative. Its a little bit longer than the other labels, but maybe "Toggle View Mode" would be a better fit, what do you think @julian-wls ?
- Somewhere in the code zoom is mentioned, I tried to zoom the pdfs by pinching with two fingers in the bottomSheet, but nothing happened. Is this intended?
...src/main/kotlin/de/tum/informatics/www1/artemis/native_app/core/ui/compose/ArtemisPdfView.kt
Show resolved
Hide resolved
...ormatics/www1/artemis/native_app/core/ui/markdown/link_resolving/MarkdownLinkResolverImpl.kt
Outdated
Show resolved
Hide resolved
val context = LocalContext.current | ||
|
||
val (bottomSheetLink, setLinkToShow) = remember { mutableStateOf<String?>(null) } | ||
val (bottomSheetState, setBottomSheetState) = remember { mutableStateOf(LinkBottomSheetState.WEBVIEWSTATE) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering, is there a particular reason why you used the syntax of val (bottomSheetLink, setLinkToShow) = remember { mutableStateOf<String?>(null) }
instead of val bottomSheetLink by remember { mutableStateOf<String?>(null) }
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...ormatics/www1/artemis/native_app/core/ui/markdown/link_resolving/MarkdownLinkResolverImpl.kt
Outdated
Show resolved
Hide resolved
Thanks for reviewing. I really appreciate the feedback :) Here are the answers:
|
Problem Description
As described in #117 all non-image attachments that are sent in the chat are rendered as links and cannot be opened currently due to an authorization error, since there is no authToken attached to the request.
Changes
This PR introduces a Link resolver, that is capable of detecting the target of the link and attaches an authToken if needed. If the link targets a pdf file, the resolver passes the request to a new Pdf View, which is wrapped in a modal bottom sheet. Requests that target other Artemis pages should also be opened in a modal bottom sheet in a web view, which allows attaching cookies, however there were issues (see #245). All other links are now opened as new IntentTab.
The new Pdf view was inspired by this repository. It allows users to share and download the pdf. Pdf can also be shown vertically and horizontally.
Note: The security checks have failed because of the repository being temporarily added to the project. However, it has been removed and the pdf viewer was added manually including various modifications (see pdf package in
core:ui
module)Steps for testing
Screenshots