aclist / dztui

DayZ GUI server browser and frontend for Linux
https://aclist.github.io/dzgui/dzgui
GNU General Public License v3.0
85 stars 10 forks source link

[BUG] Cannot sort table #93

Closed maplepy closed 8 months ago

maplepy commented 9 months ago

Previously you could click any of the field on top and it would sort the servers by player count for instance. For some reason now you can't. Clicking doesn't do anything

aclist commented 9 months ago

Sorting is working in all versions I tested. I will need more information about your system. It sounds like your distribution is using an old/broken version of zenity. Please use Advanced options > Output system info and submit the log generated (DZGUI.log).

In any event, I have rewritten the entire UI from scratch to add new features and better contextual menus, and it will be available sometime around EOY or early 2024.

maplepy commented 9 months ago

There you go

Test branch:

DZGUI.log

Note: it crashes (sends me back to the main menu) when i click on any of the field on top

Master branch:

DZGUI.log

aclist commented 9 months ago

I take it you are using zenity 4.0.0-1?

I think there is a regression here, possibly related to https://gitlab.gnome.org/GNOME/zenity/-/issues/74. If possible, please try rolling back to 3.44.1. (Tested working on Arch Linux here).

I have steadily reported these bugs to GNOME developers, but circa version 3.98.0, numerous issues with dialogs causing segfaults have started to appear. This issue was mostly localized to Fedora for the last few months, and Arch Linux was on 3.44.1 for some time, but it looks like the latest (buggy) version has finally been integrated.

This is part of the motivation for rewriting the UI from scratch to use native GTK bindings, but it will still be a little while (at least a week) before it is ready. The new UI is more platform-agnostic and doesn't rely on external packages, and should be significantly more performant when it comes to filtering etc.

maplepy commented 9 months ago

I take it you are using zenity 4.0.0-1?

Yes that is correct! Props to you for pin pointing the error ! I will downgrade the version and report back when I do :)

That's great news! Good luck to you and thank you so much for all of the work you do !! Respect!

maplepy commented 9 months ago

Downgraded to zenity 3.44.1 and it works properly now and my gtk theme is also being respected while it wasnt with the latest version

aclist commented 9 months ago

Thank you for confirming. I am not sure what is going on with the upstream development of zenity. It seems to function as expected for basic use cases (drawing simple dialogs), but in more advanced contexts, the newer versions have a lot of regressions and it is in quite a volatile state right now, so I'm surprised it's been pulled in as the stable package for some distributions.

I wasn't aware of the GTK theming issue. I am consolidating these findings and will report the bugs upstream to GNOME.

The next version of DZGUI will have more powerful sorting and filtering capabilities and locale support, and should integrate in a more compliant manner with GTK environments. I have finished adding all features back into the new version, and am now testing it end-to-end.

maplepy commented 9 months ago

I wasn't aware of the GTK theming issue. I am consolidating these findings and will report the bugs upstream to GNOME.

Sorry about that, I thought it was a screw up on my end since I reinstalled my machine not long ago

The next version of DZGUI will have more powerful sorting and filtering capabilities and locale support, and should integrate in a more compliant manner with GTK environments. I have finished adding all features back into the new version, and am now testing it end-to-end.

Hey that's great to hear! If you need help testing or anything feel free to hit me up :) Thanks for all the work you do

aclist commented 9 months ago

I would actually really appreciate some beta testing once it is closer to release. There is a handful of people who help with this. I'll ping you on this discussion when the time comes, if that is OK.

maplepy commented 9 months ago

Sure thing :)

trekta commented 9 months ago

I would actually really appreciate some beta testing once it is closer to release. There is a handful of people who help with this. I'll ping you on this discussion when the time comes, if that is OK.

I am having the same "sorting Bug" and GTK miss-theming using zenity >= 4.0 on arch. Would love to help testing in case you can use more people. edit: version Typo

aclist commented 9 months ago

Would love to help testing in case you can use more people.

@trekta Thank you; I should have something ready for testing this week.

I am having the same "sorting Bug" and GTK miss-theming using zenity < 4.0+ on arch.

Could you clarify this? You said < 4.0 (less than), but you also said 4.0+ (4.0 or higher). Did you mean >= 4.0? Are you having this problem on versions earlier than 4.0, or only version 4.0 and later?

trekta commented 9 months ago

@aclist I have updated the original comment. I meant 4.0 and later versions had this bug.

aclist commented 9 months ago

@maplepy @trekta

@aclist I have updated the original comment. I meant 4.0 and later versions had this bug.

Thank you, noted.

GTK miss-theming using zenity >= 4.0 on arch.

To give some additional context here, zenity is targeting GTK 4.0 now, so unless your local theme is compliant with 4.0, you are likely to see visual bugs in GTK apps, or possibly warnings in the terminal. This has tended to be the case between major GTK versions, since the API changes in oftentimes unclear ways, and GNOME's stance on this seems to be that the official theme (Adwaita) is the only guaraneed one, with user-created themes being something used at your own discretion. Themes have historically broken a lot, because they are huge and difficult to maintain. There are still not a lot of apps shipping with GTK 4.0 yet, but since zenity is a package of the GNOME project, it brings in new API changes sooner, for better or worse.

None of this is related to DZGUI, and DZGUI doesn't ship its own theme (just inherits the user's own theming settings), but I thought I should mention it anyway.

I have something new to share with you today. I have pushed the pre-release version of DZGUI 5.0.0 to the testing branch. There is a lot of ground to cover here, and I don't want to go too deeply into the technical nitty-gritty, but I'll give a basic technical overview before describing some of the new features and things you can look at when testing it out. This also serves as the first draft for details I'll be putting in the documentation after it is released.

About the new version

Thank you for waiting! For starters, this is a total overhaul of DZGUI from the ground up. I had been wanting to make this change for some time, since I was aware of the growing problems with zenity and the fact that some workflows in DZGUI, while serviceable, didn't feel quite right or tedious at worst. This was not an intentional design flaw, but came down to limitations in what zenity could provide us in terms of drawing contextual menus. Basically, we were limited to drawing one window at a time and just creating simple lists and the like.

In addition, relying on zenity in this way caused the business logic of the code to be tangled up with UI code and zenity-specific hacks, so it was difficult to separate the flow of the application from the visual side of things, which was having a cost in terms of maintainability. For the time being, we will carry around zenity only for very small and specific cases such as the pre-launch setup (in case the user cannot get into the full UI), and for the DZG Watcher used as a visual popup when downloading mods.

The new version fully separates the UI logic from the business logic in the MVC (model-view-controller) paradigm. The UI is purely a view onto data that is fetched from other sources, and is agnostic as to who or what the data is, merely presenting it to the user. The view is thus a "dumb" UI that can be wiped and populated with new data models on the fly, which is much easier to maintain, more flexible, and allows for creating dynamic and more contextual menus. This also makes it easier to prototype and create new menu and dialog contexts in the future through the use of reusable dialog types.

What this means to you is that now DZGUI provides a context-driven workflow. First of all, the main menu has been grouped according to different contexts, which are accessible via a side panel:

a

Secondly, the server browser now has filtering and searching capabilities built directly into the view, so you can continuously search and filter for different servers within a single area, seen on the right.

The application is also designed to be fully navigable with the keyboard or mouse. There is a large selection of keybindings you can use to navigate through menus without taking your hands off the keyboard. A keybinding help dialog can be brought up with the ? key.

Additionally, server lists (server browser, favorites, history, etc.) now have contextual menus you can bring up with right-click or the keyboard hotkey. These let you trigger contextual options such as adding/removing servers, copying their IP, or bringing up the remote server's modlist. The goal here is to integrate features that were tied up in single menu options and streamline the workflow better going forward. I believe there are still more options we can streamline here.

d

Compatibility

I have tested on the following environments:

Note that the mod auto install feature is currently disabled while I finish refactoring it. All other features available in 4.x.x versions of DZGUI are here.

5.0.0 also conforms better to the XDG specification for cache, log, and state files. Logs are being written to $HOME/.state/dzgui/logs, but are also available directly inside of DZGUI via the menu Options > Show debug log. This brings up a browseable log that can be used for troubleshooting, although the logs are mainly intended for sending to the developer.

Features

Now to talk about some new features:

The statusbar bears some additional mention here, as it also displays the distance when you are browsing servers. Previously, we would grab the entire server list and start crunching the kilometer distance to each server while loading in the results as fast as possible into the table, but this is a computationally expensive process, so I felt it was making the server browser unpleasant to use because the results don't load in instantly. In the new version, I've decided to relegate this information to the statusbar: when you highlight a row, the distance will be calculated automatically. This should feel a lot more responsive, and allow the entire server browser to load in at once without any additional waiting.

There are lots of other hidden features and conveniences. Overall, the app should feel more responsive and smoother to operate. Going forward, I want to keep consolidating small menu options that are seldom used into more easy-to-access places.

Testing

Here is what you can do to help:

  1. Toggle to the testing branch via the Advanced options menu.
  2. DZGUI should download the testing version and ask you to restart.
  3. Your old settings should carry over as before, although if you are carrying around an old history file format (used for the recent servers list), it may have to be wiped to comply with the new format.
  4. Preferably, run DZGUI from the terminal so that you can capture any tracebacks emitted.
  5. If DZGUI complains about needing PyGObject, install the package listed at the top of this post.

Play around and use the settings you would normally use, as well as explore some of the other menus and try to break things. Try to download mods or connect to servers, and try to search/filter for certain parameters. Everyone's OS environment is slightly different, so I would not be surprised if you encounter some bugs.

If something does not behave as expected or "feels" weird, make note of it. If you experience an actual bug or crash, copy the traceback from the terminal and the contents of $HOME/.local/state/dzgui/logs/DZGUI_DEBUG.log. You can also generate a system log via Options > Output system info to log file, and this log is written to $HOME/.local/state/dzgui/logs/DZGUI_SYSTEM.log.

I am open to other suggestions you may have in terms of look and feel, but try to focus on actual crash conditions or things that impede you from connecting to a server and fetching mods. The underlying logic is the same as in previous versions, but there is the possibility of bugs due to the extensive refactoring that took place. On the upside, I did find and squash several minor bugs in the old version of DZGUI over the course of developing this new version, so the server connection logic should be more robust.

Thank you for using DZGUI.

trekta commented 9 months ago

first off: thanks for all the work you put into this. I really appreciate it. without this project I would not be able to play dayz as easily on linux. here are my first impressions and observations after short testing.

as I have/find more time I can test and give more feedback.

I have attached termoutput.txt and log.txt of a "dry run" showing installed mods with redacted username.

aclist commented 9 months ago

list installed mods feature shows 0.000 mb for every mod

I have a fix prepared locally for this, consider it already done -- will push tomorrow.

application starts in fullscreen mode (i3 window-manager)

This is currently something I am enforcing because of scaling issues. The content of the server browser view can get quite large, causing the window to resize to the minimum required to display those contents. This causes some irregular behavior on different resolutions, such as low resolution devices. The best way I have found so far is to constrain to fullscreen so that the elements scale within the viewport. It is working in 99% of scenarios except Steam Deck, which needs some special handling. I'm not really sure if we should allow the application to be resized too much or dragged by the user, since it could be unpredictable and we need a minimum of size for the content. It's not so much of a problem for the main menu, but the server browser is where it becomes quite large.

if steam not started - manual mod download via "show server-side mods" starts steam and makes the application hang as long as steam is running.

Great catch, I will put this on a separate thread so it is unblocked. Also, note that you can wait for the final step in the connection process and it will walk you through mod downloading (this is the semi-automatic method). You don't have to open each link by yourself unless you want to.

aclist commented 9 months ago

application starts in fullscreen mode (i3 window-manager)

I misread your comment originally and thought you were talking about the proportions of content within the window. I am using i3wm as well and I see what you are talking about now: the window gets put into a tile in fullscreen instead of being treated as "floating".

I've done a bit of reading about this, and it seems like we could "force" i3wm to treat the entire application as a floating dialog by using the property Gdk.WindowTypeHint.DIALOG, but this seems like a bit of a hack, since it's not actually a dialog window. Alternatively, you can set a custom property in the i3wm config file such as for_window [class="Ui.py"] floating enable. (Ui.py is currently the placeholder name).

I've tested both methods and either works, but I need to think about what is more appropriate here. Obviously the first one gives a more OOB experience, but may come with certain pitfalls.

aclist commented 8 months ago

The beta version has been released into the stable branch with the 5.0.0 release and this issue is resolved. zenity is no longer used for tables.

maplepy commented 7 months ago

Sorry i was unable to play for the past months :/

maplepy commented 7 months ago

I tried it yesterday though and it looks awesome! One thing that could be better is the player count in the server list, it is currently not present and would be a great feature!

aclist commented 7 months ago

I tried it yesterday though and it looks awesome! One thing that could be better is the player count in the server list, it is currently not present and would be a great feature!

The player count is the fifth column in the table and is present on all modes. Can you clarify when this doesn't show up for you?

maplepy commented 7 months ago

Sure I'll send a screen shot when I'll back on the game ! :)

maplepy commented 6 months ago

Alright just tried it, it actually is there but was hidden on the right because the server name column was too wide mb!

aclist commented 6 months ago

Alright just tried it, it actually is there but was hidden on the right because the server name column was too wide mb!

You can resize columns now, and the column width will be stored across sessions. Note that the column width you set is shared across server browser contexts.

maplepy commented 6 months ago

That's great :) it works wonderfully