Not only has universal not changed to priority, these bindings are on the
screen and so have priority anyway. This means we can safely go back to how
5x5 was prior to 0.6.0.
This is the one biggish change between the last working test run in GitHub,
and now. Tests are still running locally fine, an on GitHub, in the last
run, I had one job pass and another fail, both on the same OS, just 3.10
passed and 3.9 failed. The problem still to do with (as far as I can tell)
messages inside Textual and some sort of async issue.
So let's try this.
Wondering if this is the issue with why the tests have stopped working in
GitHub; but also not *really* confused as to why they were working in the
first place.
This code is running just finally locally in tests, but is failing with:
RuntimeError: Task <Task pending name='Task-279' coro=<MessagePump._process_messages() running at /home/runner/work/textual/textual/src/textual/message_pump.py:314>> got Future <Future pending> attached to a different loop
in GitHub Actions. Pretty sure I saw this before, which made me add the
pause in the first place. Given this seems to just be affecting the last
test, from what I can tell, let's make the pause longer to see if that
helps.
I hate chasing action issues...
This is set to xfail at the moment because the tested result is what I think
should be the result, but what happens now isn't that. Need to check with
Will to see what he thinks the correct resolution is here.
I feel some more will be needed, but this is all of the basics, hitting all
of the important points that relate to #1343. More importantly all of the
xfails are now removed.
This works in conjunction with BINDINGS. If a widget has BINDINGS, and if
any of those bindings have a priority that isn't True or False, the value of
PRIORITY_BINDINGS will be used (or the value from one of the parent classes,
if there are any, will be used if it isn't set on the current class).
See #1343.
This commit changes things slightly so that the priority of a binding is an
three-state: True, False or None. True and False are firm choices that
nothing else should override. None says "fall back to whatever default is up
for grabs".
The commit also then adds support for a default priority and, when building
a binding, it uses that if the binding has a priority of None.
See #1343.
At the moment at least, we don't allow binding on " ", we bind on "space".
Meanwhile, tidy folk may try and bind in "a, b, c, d" as opposed to trying
to bind on "a,b,c,d". I feel we should allow for that.
This test, which breaks at the moment, should be satisfied.
Mostly adding this so that it turns this:
$ poetry run mypy --strict binding.py
binding.py:8: error: Module "textual._typing" does not explicitly export attribute "TypeAlias" [attr-defined]
Found 1 error in 1 file (checked 1 source file)
into this:
$ poetry run mypy --strict binding.py
Success: no issues found in 1 source file
The cursor keys stopped working in 5x5 once binding inheritance was
introduced in 0.6.0 (see #1343). Making them `universal` keys here fixes the
issue. This won't be the final form of this change, but this fixes this
example so that it works with 0.6.0 (so anyone cloning down the code and
running with an installed 0.6.0 will get the full effect).
Once the final work resulting from #1343 takes place this will need a final
update (and should be a good test example for the changes).