Tapping a downloaded file skips the configured Direct Editing editor (e.g. PDF opens in an external app instead)

Offen Anfängerfreundlich
#18,152 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
82/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
android, kotlin
Bereich
mobile

Rechercherichtung

Beginne mit OCFileListFragment.onFileClicked() und vergleiche die Pfade für heruntergeladene und nicht heruntergeladene Dateien, insbesondere die vorhandene Prüfung hasTextEditor(file). Sieh dir FileDisplayActivity.previewFile() und FileActionHandler.edit() an, um das aktuelle Verhalten von Vorschau und Editor zu verstehen. Fertig ist die Aufgabe, wenn durch Tippen auf eine heruntergeladene Datei der konfigurierte Direct Editing-Editor geöffnet wird, sofern verfügbar, während die Offline-Vorschau eine Ausweichmöglichkeit bleibt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

0. Needs triage enhancement
How to use GitHub
  • Please use the 👍 reaction to show that you are interested into the same feature.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Is your feature request related to a problem? Please describe.

What happens when I tap a file depends on whether it is already downloaded to the device:

So the same tap on the same file opens the server's editor the first time and an external app once the file is cached. My use case: a server app that registers a Direct Editing editor for application/pdf (annotating construction plans). On a tablet, the editor opens fine until the file has been downloaded once; after that, tapping it opens the external PDF viewer. Edit in the file menu still opens the editor (FileActionHandler.edit()), but tapping is what users do.

Reading the code, the same seems to apply to other editors, e.g. a downloaded Markdown file would go to the internal text preview instead of the Text app's editor. I have only observed the PDF case.

Describe the solution you'd like

When a Direct Editing editor lists the mimetype in its (non-optional) mimetypes, tapping a file opens that editor whether or not the file is downloaded. In code: apply the same webViewAvailable && hasTextEditor(file) && !file.isEncrypted check in onFileClicked() before the file.isDown branch (or at the start of previewFile()). Offline, the current preview could stay as the fallback.

Describe alternatives you've considered

  • Using Edit from the file menu every time: works, but is not discoverable and differs from the non-downloaded case.
  • Uninstalling or changing the default PDF app on the device: then the internal PDF preview opens, still not the editor.
  • A setting "Open files with the server editor when available": would also work, but the consistent behaviour above seems simpler.

Additional context

  • Observed on a live instance: Nextcloud server 35.0.3, Nextcloud Android app , , Android .
  • The editor is registered via RegisterDirectEditorEvent and appears in /ocs/v2.php/apps/files/api/v1/directEditing with application/pdf in mimetypes.

Assisted by ClaudeCode:claude-opus-5-5

Vorherrschende Sprache
Kotlin
Sterne
5.7k
Forks
2.1k
Ø Merge
2 T. 7 Std.
Gemergte PRs (30 T.)
149

Entwicklungsumgebung

In Codespaces öffnen

Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus nextcloud/android

Alle Issues in nextcloud/android

Ähnliche Issues

Weitere Issues zu Kotlin

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.