Skip to content

Conversation

alperozturk96
Copy link
Collaborator

@alperozturk96 alperozturk96 commented Aug 18, 2025

  • Tests written, or not not needed

Issue

The purpose of this PR is not to enhance the UI, but to ensure that the correct filenames are displayed. Certain invisible or special Unicode characters can be used to manipulate a filename’s visual representation, misleading users about its true file extension.

e.g. filename: invoiceexe.docRLO this will appear as invoice.doc, but actual filename is invoicedoc.exe. It is not a doc file, it's an EXE file.

Previously, the filename with extension in one text view component was shown; now, we also display the file extension as a separate text view component next to the filename, which is why the UI is changed.

The reason for using two separate text view elements is explained in detail in the mentioned issue.

@alperozturk96 alperozturk96 force-pushed the fix/left-to-right-filename-sanitization-v2 branch from 1c48637 to d0d761a Compare August 19, 2025 11:41
@nextcloud nextcloud deleted a comment from github-actions bot Aug 19, 2025
@alperozturk96 alperozturk96 force-pushed the fix/left-to-right-filename-sanitization-v2 branch 2 times, most recently from daf5295 to 644bb91 Compare August 19, 2025 14:41
kra-mo

This comment was marked as outdated.

@alperozturk96

This comment was marked as resolved.

@alperozturk96

This comment was marked as resolved.

@AndyScherzinger

This comment was marked as resolved.

@alperozturk96 alperozturk96 force-pushed the fix/left-to-right-filename-sanitization-v2 branch from 644bb91 to 980914d Compare August 20, 2025 05:44
@alperozturk96

This comment was marked as resolved.

@tobiasKaminsky tobiasKaminsky force-pushed the fix/left-to-right-filename-sanitization-v2 branch from 980914d to 36986ef Compare August 20, 2025 07:43
@AndyScherzinger AndyScherzinger added this to the Nextcloud App 3.33.0 milestone Aug 20, 2025
@alperozturk96 alperozturk96 force-pushed the fix/left-to-right-filename-sanitization-v2 branch 2 times, most recently from f1eb176 to fd0c067 Compare August 21, 2025 10:47
@alperozturk96 alperozturk96 marked this pull request as draft August 21, 2025 10:48
@kra-mo kra-mo mentioned this pull request Aug 21, 2025
@alperozturk96 alperozturk96 requested a review from ZetaTom August 21, 2025 12:20
@alperozturk96 alperozturk96 marked this pull request as ready for review August 21, 2025 12:22
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
@alperozturk96 alperozturk96 force-pushed the fix/left-to-right-filename-sanitization-v2 branch from 8fd357b to 013caa1 Compare August 22, 2025 13:16
@alperozturk96
Copy link
Collaborator Author

alperozturk96 commented Aug 22, 2025

The remaining issues:

  1. In some cases, the “More” button appears to be slightly shifted to the right.

  2. Very long filenames may occupy space without showing the extension (e.g., This PR: aaaaaaaaaa..... Master: aaa.....jpg). This occurs because the master currently uses a single text view element and ellipsis in the middle.

Image 1

Achieving perfectly consistent alignment across all three elements in every scenario does not appear feasible. Using two text view elements makes it impossible to fully match with the master.

Considering that this change will only be applied to bidirectional filenames, I believe the current implementation is acceptable.

Demo:

Screen.Recording.2025-08-22.at.15.29.52.mp4

@tobiasKaminsky @AndyScherzinger

Copy link

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/15388.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.

@AndyScherzinger
Copy link
Member

Fine by me 👍

Copy link

Codacy

Lint

TypemasterPR
Warnings4848
Errors1111

SpotBugs

CategoryBaseNew
Bad practice5959
Correctness6262
Dodgy code283283
Experimental11
Internationalization77
Malicious code vulnerability22
Multithreaded correctness3535
Performance4848
Security1818
Total515515

@AndyScherzinger AndyScherzinger merged commit e21ed79 into master Aug 23, 2025
19 of 21 checks passed
@AndyScherzinger AndyScherzinger deleted the fix/left-to-right-filename-sanitization-v2 branch August 23, 2025 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants