nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.57k stars 4.08k forks source link

[Bug]: Regression NC29.0.8rc1 - View jumps to top after file close for long file lists #48545

Closed XueSheng-GIT closed 1 month ago

XueSheng-GIT commented 2 months ago

⚠️ This issue respects the following points: ⚠️

Bug description

Nextcloud 29.0.8rc1: Files app of webif. If you open a file of a long file list and close it again, the view jumps to the top of the list and the file is not highlighted. For short file lists, the view does not jump, but still the file is not highlighted after close. This is a regression compared to NC29.0.7.

See also screen recording at the Additional info section below.

Steps to reproduce

  1. Open Nextcloud webif
  2. Open files app
  3. Open a folder with a lot of files (issue is partly related to the length of the list and the available height of the view).
  4. Open one of the files near the bottom of the list (e.g. markdown, pdf, ...).
  5. Close the file again.

Expected behavior

After file close, view should stay at it's position and file should be highlighted.

Nextcloud Server version

29

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.1

Web server

None

Database engine version

PostgreSQL

Is this bug present after an update or on a fresh install?

Updated from a MINOR version (ex. 28.0.1 to 28.0.2)

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

Configuration report

{ "system": { "instanceid": "REMOVED SENSITIVE VALUE", "passwordsalt": "REMOVED SENSITIVE VALUE", "secret": "REMOVED SENSITIVE VALUE", "trusteddomains": [ "cloud.domain.de" ], "datadirectory": "REMOVED SENSITIVE VALUE", "dbtype": "pgsql", "version": "29.0.8.0", "dbname": "REMOVED SENSITIVE VALUE", "dbhost": "REMOVED SENSITIVE VALUE", "dbtableprefix": "oc", "dbuser": "REMOVED SENSITIVE VALUE", "dbpassword": "REMOVED SENSITIVE VALUE", "installed": true, "forcessl": true, "forceSSLforSubdomains": true, "htaccess.RewriteBase": "\/", "overwrite.cli.url": "https:\/\/cloud.domain.de\/", "overwritehost": "cloud.domain.de", "overwriteprotocol": "https", "overwritewebroot": "", "trusted_proxies": "REMOVED SENSITIVE VALUE", "mail_smtpmode": "smtp", "mail_smtpsecure": "ssl", "mail_sendmailmode": "smtp", "mail_from_address": "REMOVED SENSITIVE VALUE", "mail_domain": "REMOVED SENSITIVE VALUE", "mail_smtpauthtype": "LOGIN", "mail_smtpauth": true, "mail_smtphost": "REMOVED SENSITIVE VALUE", "mail_smtpport": "465", "mail_smtpname": "REMOVED SENSITIVE VALUE", "mail_smtppassword": "REMOVED SENSITIVE VALUE", "theme": "", "logtimezone": "Europe\/Berlin", "loglevel": 0, "log_rotate_size": 104857600, "maintenance": false, "trashbin_retention_obligation": "30, 180", "memcache.local": "\OC\Memcache\APCu", "memcache.distributed": "\OC\Memcache\Redis", "memcache.locking": "\OC\Memcache\Redis", "redis": { "host": "REMOVED SENSITIVE VALUE", "port": 0, "dbindex": 0, "password": "REMOVED SENSITIVE VALUE", "timeout": 1.5 }, "enabledPreviewProviders": [ "OC\Preview\PNG", "OC\Preview\JPEG", "OC\Preview\GIF", "OC\Preview\HEIC", "OC\Preview\BMP", "OC\Preview\XBitmap", "OC\Preview\MP3", "OC\Preview\TXT", "OC\Preview\MarkDown", "OC\Preview\Movie", "OC\Preview\MKV", "OC\Preview\MP4", "OC\Preview\AVI" ], "preview_max_x": "2048", "preview_max_y": "2048", "jpeg_quality": "60", "updater.release.channel": "stable", "app_install_overwrite": [ "calendar", "keeweb", "files_retention", "bruteforcesettings", "previewgenerator", "socialsharing_email", "fulltextsearch", "fulltextsearch_elasticsearch", "files_fulltextsearch", "groupfolders", "files_fulltextsearch_tesseract", "emlviewer", "files_accesscontrol" ], "default_language": "de", "default_locale": "de_DE", "default_phone_region": "DE", "allow_local_remote_servers": true, "activity_use_cached_mountpoints": true, "defaultapp": "", "maintenance_window_start": 1, "skeletondirectory": "\/mnt\/nextcloud\/skeleton", "templatedirectory": "\/mnt\/nextcloud\/templates" } }

List of activated Apps

Enabled:

Nextcloud Signing status

n/a

Nextcloud Logs

n/a

Additional info

Screen recording of the issue:

https://github.com/user-attachments/assets/b3833ed7-86a9-44e0-b32b-da4559bee4a0

XueSheng-GIT commented 2 months ago

Issues which may be (partly) related: https://github.com/nextcloud/server/issues/44300, https://github.com/nextcloud/server/issues/44792, https://github.com/nextcloud/server/issues/46084

RainerEmrich commented 2 months ago

Same here with php8.3 and mariadb.

XueSheng-GIT commented 1 month ago

I just played around with NC 30.0.1 RC1 and faced the same issue. While doing some more tests I noticed that also opening and closing the sidebar triggers this issue.

In firefox browser console following messages are shown: Opening a file or opening it's sidebar:

[DEBUG] files: VirtualList: scrolling to index 17 
Object { app: "files", uid: "admin", level: 0, scrollTop: 907.5, columnCount: 1 }

Closing that file or it's sidebar:

[DEBUG] files: VirtualList: scrolling to index 0 
Object { app: "files", uid: "admin", level: 0, scrollTop: -27.5, columnCount: 1 }

I'm working a lot with files and I fear I'll completely be lost with NC 29.0.8 or NC 30.0.1. Each time you open/close a file or its sidebar, you don't know which file you were working on because file list scrolls to top and file is not highlighted anymore.

@artonge Could this be a regression as result of removing the fileid from the route https://github.com/nextcloud/server/pull/47920? CC @susnux

susnux commented 1 month ago

I posted it already in the pull request, but I think we need to slightly adjust the parameters in the route:

I think the underlying issue is we have two properties for three states:

States:

  1. Sidebar open
  2. File open
  3. File focused

(3 is needed because of virtual scrolling to preserve the correct files in view).

Properties that control the states:

  1. openFile
  2. Fileid in route

So I think the best solution would be to add a new query part: details for information if the sidebar should be opened.

So we end up with:

  • /files/123: Focus file 123
  • /files/123?openFile: Open the file 123 with default action (viewer)
  • /files/123?details: Open the sidebar for file 123
  • /files/123?details&openFile: Open the sidebar for file 123 while the viewer is open

This would allow to reload the page at any state and the same view will be created as before the reload.