-
-
Notifications
You must be signed in to change notification settings - Fork 960
Add a CSV fallback for Nextcloud-Text #3575
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
base: master
Are you sure you want to change the base?
Conversation
Add a fallback for CSV files if the editor is Nextcloud-Text, as the Nextcloud-Text editor displays CSV files as text rather than as a table.
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.
Pull Request Overview
This PR adds a fallback mechanism for CSV files when the Nextcloud-Text editor is being used, ensuring CSV files are displayed as tables rather than plain text. The change addresses a specific limitation where Nextcloud-Text displays CSV files in text format instead of the more user-friendly table format.
- Adds detection logic to check if CSV files are being opened with Nextcloud-Text editor
- Implements a fallback to QLPreview for better CSV file presentation
- Refactors existing preview logic into a reusable function
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
iOSClient/Viewer/NCViewer.swift | Adds CSV fallback logic and refactors QLPreview into separate function |
iOSClient/Data/NCManageDatabase+Metadata.swift | Adds isCsv computed property for CSV file detection |
if metadata.isCsv { | ||
let editors = utility.editorsDirectEditing(account: metadata.account, contentType: metadata.contentType) | ||
if editors.contains("Nextcloud Text") { | ||
qlPreview(viewController: viewController, metadata: metadata) |
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.
Missing return statement after calling qlPreview. Without it, the code will continue executing and potentially trigger other viewers or the fallback qlPreview call at line 178, leading to duplicate preview attempts.
qlPreview(viewController: viewController, metadata: metadata) | |
qlPreview(viewController: viewController, metadata: metadata) | |
return |
Copilot uses AI. Check for mistakes.
return (contentType == "text/csv") | ||
} | ||
|
||
/// Returns false if the user is lokced out of the file. I.e. The file is locked but by somone else |
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.
Spelling errors in the comment: 'lokced' should be 'locked' and 'somone' should be 'someone'.
/// Returns false if the user is lokced out of the file. I.e. The file is locked but by somone else | |
/// Returns false if the user is locked out of the file. I.e. The file is locked but by someone else |
Copilot uses AI. Check for mistakes.
Hi, I don't think we can merge this since we must use Nextcloud Text for files like this. I will check with the Nextcloud Text devs and see what we can do. |
In the meantime I can repurpose your code to open a csv in |
Add a fallback for CSV files if the editor is Nextcloud-Text, as the Nextcloud-Text editor displays CSV files as text rather than as a table.