-
-
Notifications
You must be signed in to change notification settings - Fork 687
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Table in a container does not display or update as expected. #3046
Comments
As far as I can make out, at best, this is a Windows specific issue. On macOS, I don't see any issues with the update you've flagged as a problem. I do, however, get a hard crash during test "5". Debugging this issue is very difficult, though. Between the series of nested functions, weird workarounds for "issues" (such as the many calls to "scroll_to_row"), API usage like literal AST parsing, the large blocks of commented out code, the weird usage of Python APIs (like When you're providing a minimal reproduction case for a bug, the critical word is minimal. You need to provide the least possible code to reproduce the problem. Having to press a button 5 times to generate a problem? Unless "do X 5 times" is the problem you're observing, your example code has just become 5 times more complicated than it needs to be. In this case, if the issue is "row doesn't update"... then the example should be "updating a row". If changing the scroll position of the list isn't a critical part of making the bug manifest - don't scroll the position of the list. Any complication above and beyond what makes the bug occur only serves to make the underlying problem harder to find. It's also a key part of getting an issue looked at. Right now, if I want to investigate this issue, the first thing I'll need to do is spend an hour rewriting the example so that it only demonstrates the problem you're describing. That inevitably puts this bug further down my todo list, because I need to find an additional hour to work on in, in addition to any time I need to spend hunting down a fix. |
Thanks for your comments. The reason for the what you see as complexity is that I was trying to pinpoint what did and did not work in a step by step approach rather than saying. "It does not work!" The step by step test approach was taken to try and demonstrate what did work and what did not work.
I appreciate that some one with more knowledge or experience may have been able to take a different approach. |
Sure - and that's not a problem, as long as you declare that (which you have). We don't expect every user to have access to every platform.
Sure - except that you've stopped too soon. Once you've got a broken example, you then need to continue simplifying until you can remove nothing else. For example - how is the "substring search" behavior of Also - you need to frame the example so that it best exhibits the problem you're trying to describe. You say that the scrolling is necessary? Make that part of the test. To demonstrate what I mean, I've reworked your example:
In this example:
In addition, if you manually select the Zaphod row at any point after step 2, the age is correctly rendered. With a minimal reproduction case, I can now easily demonstrate the difference between the table update, the scroll, and the delete. Even this isn't a 100% minimal example, because being nested in an OptionContainer doesn't change anything - you can see the same behavior in the "main container" table. However, given there's some potential crossover with #2974, and it's easy to accomodate both tables in the example, I've left it in. But as a result of this simplified example, I can also easily conform that the Winforms table is being notified of the change of data; but this isn't triggering a redraw of the virtual table item. I'm not entirely sure why this is occurring, but it might be related to recent changes restoring keyboard navigation for tables. |
Just chiming in that I can similarly reproduce the data display lag on Windows (with or without a box or option container), but the column widths still work correctly for me, even inside a container. Tested on Windows 11. |
Describe the bug
possibly an extension to: #2974
A table within a container does not initially expand columns
The table does not display data updates when the underlying data is updated.
A row edit is not reflected in a change in the display
Append and Delete Rows show updated data including pending row edits.
Steps to reproduce
I attach a test program that can be run in a dev environment to demonstrate the problem.
A new table in an opcontainer is displayed with compressed columns.
To Test: Press the Run table Test button. There are 5 tests.
1 use append to add a new Row. New Row IS visible
2 use find to find row matching the given attribute and value - an exact match.
3 set row attribute using tablet.data[rowid].setattr('age',999), updated value is NOT shown
4 set row attribute, upsert function will update an existing row OR insert a new row.
new value of age = 0 expected but NO change shown
5 delete an existing row, the table display updates to not show the removed row as expected but does now show the
previously updated updated age for the last row.
[
tabletest.zip
]
Expected behavior
On a programmatic change in data e.g. made with a call to tablet.data[rowid].setattr('age',999) I would expect the underlying ListSource to update and the display to reflect the change. However although it can be shown the ListSource has changed the display does not update.
Note that the change does show following a subsequent Row Delete action
Screenshots
following a further update to age = 0 and a Row Delete:
Environment
Logs
terminal putput:
briefcase.2024_12_16-11_05_11.dev.log
The text was updated successfully, but these errors were encountered: