Bug 503213

Summary: preview a file with an unrecognized format as plain text in Ark internal editor, opens a very small window
Product: [Applications] ark Reporter: BugCoder <bugcoder>
Component: generalAssignee: Elvis Angelaccio <elvis.angelaccio>
Status: CONFIRMED ---    
Severity: normal CC: bugcoder, john.kizer, kostadinshishmanov, rthomsen6, rubisetcie, strong.drum0546
Priority: NOR    
Version First Reported In: 25.04.0   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: preview_small.png (screenshot of the small preview window)

Description BugCoder 2025-04-23 09:35:46 UTC
Created attachment 180557 [details]
preview_small.png (screenshot of the small preview window)

SUMMARY
Each time I preview a file with an unrecognized format, after confirming to view it as plain text, the preview window opens at an extremely small size.

STEPS TO REPRODUCE
1- Open Ark.
2- Right-click on a file with an unrecognized format and select Preview.
3- The following dialog appears:
โ€œThe internal viewer cannot preview this unknown type of file.

Do you want to try to view it as plain text?โ€

4- After confirming, the preview window opens at a very small size (approximately 200 ร— 100 px).

OBSERVED RESULT

The preview window always opens at an extremely small size.

EXPECTED RESULT

The window should automatically scale to display the text at a readable size (e.g., at least 600 ร— 400 px).

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: KDE neon 6.3
KDE Plasma Version: 6.3.4
KDE Frameworks Version: 6.13.0
Qt Version: 6.8.3

ADDITIONAL INFORMATION
Comment 1 John Kizer 2025-05-14 18:36:05 UTC
Hi - just to double-check, does this issue only occur for you with unrecognized file types, or does it also occur for files that are already identified as plain text?

Thanks!

(For reference - likely connected to https://bugs.kde.org/show_bug.cgi?id=457564 )
Comment 2 Bug Janitor Service 2025-05-29 03:59:39 UTC
๐Ÿ›๐Ÿงน โš ๏ธ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME.

For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging.

Thank you for helping us make KDE software even better for everyone!
Comment 3 Lenzoid 2025-06-01 07:15:55 UTC
I tested in a very recent Plasma git-master with a fresh user profile and couldn't reproduce the bug at all.

In my main user profile: When I first tested this Preview function in Ark, I definitely saw the same thing as you: a small sized window when opening a particular txt file in an archive, but I resized that window manually and ever since the size is OK. This suggests to me that this was an issue in my config that has been fixed by Ark doing its thing. 

If you still can reproduce this, could you maybe try it in a fresh user profile? If so, it would be useful to have an example archive file so everyone has the same input to test it with. Thanks in advance!
Comment 4 Bug Janitor Service 2025-06-16 03:47:38 UTC
๐Ÿ›๐Ÿงน โš ๏ธ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME.

For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging.

Thank you for helping us make KDE software even better for everyone!
Comment 5 Matthieu Carteron 2025-07-17 09:39:48 UTC
I have this bug too in the latest 25.07... I have tested on a fresh new user, wiping out my ark config & state to be sure.
Everytime I preview a text file in Ark, the window is at its minimal size...
Comment 6 Lenzoid 2025-07-25 14:35:48 UTC
Thanks for the update. Could you add what has to be done in order to wipe the ark config? Might be helpful for future reproduction. I have fixed a similar bug in the print preview window in Gwenview, I'll take a look if a similar fix could be applied here. Meanwhile I'll add CONFIRMED because it's clearly reproducible at least in a fresh environment.
Comment 7 Matthieu Carteron 2025-07-25 15:04:18 UTC
(In reply to Lenzoid from comment #6)
> Thanks for the update. Could you add what has to be done in order to wipe
> the ark config? Might be helpful for future reproduction. I have fixed a
> similar bug in the print preview window in Gwenview, I'll take a look if a
> similar fix could be applied here. Meanwhile I'll add CONFIRMED because it's
> clearly reproducible at least in a fresh environment.

Sure. So far, I have tried to completely remove "~/.config", "~/.cache" and "~/.local" (in a controlled environment), it didn't help...

This is a weird bug, because I swear it's true, about a week ago it disappeared completely... I no longer have this bug, the Ark preview window is now always the same dimensions of the main application window... and have not the slightest idea of what got rid of it...
Comment 8 Matthieu Carteron 2025-08-20 09:52:31 UTC
I've conducted tests, and I have some new insights:

At a fresh install of Ark, the bug is indeed present (the preview window is minuscule).
However, closing the preview and resizing the Ark main window, even the slightest, makes the bug vanish forever, even after reboots... from now on, the preview window will always be the current size of its parent window.

So, I'm guessing the problem comes from the "saved state" of the Ark window not being initialized properly...