diff --git a/docs/examples/styles/grid.py b/docs/examples/styles/grid.py
index 338af444c..1901d1862 100644
--- a/docs/examples/styles/grid.py
+++ b/docs/examples/styles/grid.py
@@ -14,5 +14,3 @@ class GridApp(App):
app = GridApp(css_path="grid.css")
-if __name__ == "__main__":
- app.run()
diff --git a/docs/examples/styles/links.py b/docs/examples/styles/links.py
index cf45563cc..ddd472974 100644
--- a/docs/examples/styles/links.py
+++ b/docs/examples/styles/links.py
@@ -13,6 +13,3 @@ class LinksApp(App):
app = LinksApp(css_path="links.css")
-
-if __name__ == "__main__":
- app.run()
diff --git a/docs/examples/widgets/checkbox.py b/docs/examples/widgets/checkbox.py
index ff2b27196..400f2ae25 100644
--- a/docs/examples/widgets/checkbox.py
+++ b/docs/examples/widgets/checkbox.py
@@ -7,7 +7,9 @@ class CheckboxApp(App):
def compose(self) -> ComposeResult:
yield Static("[b]Example checkboxes\n", classes="label")
yield Horizontal(
- Static("off: ", classes="label"), Checkbox(), classes="container"
+ Static("off: ", classes="label"),
+ Checkbox(animate=False),
+ classes="container",
)
yield Horizontal(
Static("on: ", classes="label"),
diff --git a/docs/examples/widgets/table.py b/docs/examples/widgets/data_table.py
similarity index 100%
rename from docs/examples/widgets/table.py
rename to docs/examples/widgets/data_table.py
diff --git a/docs/examples/widgets/footer.py b/docs/examples/widgets/footer.py
index 47d9c9aa6..85406b4e9 100644
--- a/docs/examples/widgets/footer.py
+++ b/docs/examples/widgets/footer.py
@@ -4,7 +4,16 @@ from textual.widgets import Footer
class FooterApp(App):
- BINDINGS = [Binding(key="q", action="quit", description="Quit the app")]
+ BINDINGS = [
+ Binding(key="q", action="quit", description="Quit the app"),
+ Binding(
+ key="question_mark",
+ action="help",
+ description="Show help screen",
+ key_display="?",
+ ),
+ Binding(key="j", action="down", description="Scroll down", show=False),
+ ]
def compose(self) -> ComposeResult:
yield Footer()
diff --git a/docs/widgets/data_table.md b/docs/widgets/data_table.md
index ce7f25bf5..7d5558a95 100644
--- a/docs/widgets/data_table.md
+++ b/docs/widgets/data_table.md
@@ -11,13 +11,13 @@ The example below populates a table with CSV data.
=== "Output"
- ```{.textual path="docs/examples/widgets/table.py"}
+ ```{.textual path="docs/examples/widgets/data_table.py"}
```
-=== "table.py"
+=== "data_table.py"
```python
- --8<-- "docs/examples/widgets/table.py"
+ --8<-- "docs/examples/widgets/data_table.py"
```
diff --git a/src/textual/app.py b/src/textual/app.py
index c044f6155..43f1bd56c 100644
--- a/src/textual/app.py
+++ b/src/textual/app.py
@@ -605,7 +605,7 @@ class App(Generic[ReturnType], DOMNode):
assert press
driver = app._driver
assert driver is not None
- await asyncio.sleep(0.01)
+ await asyncio.sleep(0.02)
for key in press:
if key == "_":
print("(pause 50ms)")
@@ -632,7 +632,13 @@ class App(Generic[ReturnType], DOMNode):
print(f"press {key!r} (char={char!r})")
key_event = events.Key(self, key, char)
driver.send_event(key_event)
- await asyncio.sleep(0.01)
+ # TODO: A bit of a fudge - extra sleep after tabbing to help guard against race
+ # condition between widget-level key handling and app/screen level handling.
+ # More information here: https://github.com/Textualize/textual/issues/1009
+ # This conditional sleep can be removed after that issue is closed.
+ if key == "tab":
+ await asyncio.sleep(0.05)
+ await asyncio.sleep(0.02)
await app._animator.wait_for_idle()
diff --git a/tests/snapshot_tests/__snapshots__/test_snapshots.ambr b/tests/snapshot_tests/__snapshots__/test_snapshots.ambr
index e5ffd0b4e..92eb75fc1 100644
--- a/tests/snapshot_tests/__snapshots__/test_snapshots.ambr
+++ b/tests/snapshot_tests/__snapshots__/test_snapshots.ambr
@@ -1,3 +1,189 @@
+# name: test_buttons_render
+ '''
+
+
+ '''
+# ---
# name: test_checkboxes
'''
+
+ '''
+# ---
+# name: test_css_property_snapshot[docs/examples/styles/align.py]
+ '''
+
+
+ '''
+# ---
+# name: test_css_property_snapshot[docs/examples/styles/background.py]
+ '''
+
+
+ '''
+# ---
+# name: test_css_property_snapshot[docs/examples/styles/border.py]
+ '''
+
+
+ '''
+# ---
+# name: test_css_property_snapshot[docs/examples/styles/box_sizing.py]
+ '''
+
+
+ '''
+# ---
+# name: test_css_property_snapshot[docs/examples/styles/color.py]
+ '''
+
+
+ '''
+# ---
+# name: test_css_property_snapshot[docs/examples/styles/content_align.py]
+ '''
+
+
+ '''
+# ---
+# name: test_css_property_snapshot[docs/examples/styles/display.py]
+ '''
+
+
+ '''
+# ---
+# name: test_css_property_snapshot[docs/examples/styles/grid.py]
+ '''
+
+
+ '''
+# ---
+# name: test_css_property_snapshot[docs/examples/styles/height.py]
+ '''
+
+
+ '''
+# ---
+# name: test_css_property_snapshot[docs/examples/styles/layout.py]
+ '''
+
+
+ '''
+# ---
+# name: test_css_property_snapshot[docs/examples/styles/links.py]
+ '''
+
+
+ '''
+# ---
+# name: test_css_property_snapshot[docs/examples/styles/margin.py]
+ '''
+
+
+ '''
+# ---
+# name: test_css_property_snapshot[docs/examples/styles/offset.py]
+ '''
+
+
+ '''
+# ---
+# name: test_css_property_snapshot[docs/examples/styles/opacity.py]
+ '''
+
+
+ '''
+# ---
+# name: test_css_property_snapshot[docs/examples/styles/outline.py]
+ '''
+
+
+ '''
+# ---
+# name: test_css_property_snapshot[docs/examples/styles/overflow.py]
+ '''
+
+
+ '''
+# ---
+# name: test_css_property_snapshot[docs/examples/styles/padding.py]
+ '''
+
+
+ '''
+# ---
+# name: test_css_property_snapshot[docs/examples/styles/scrollbar_gutter.py]
+ '''
+
+
+ '''
+# ---
+# name: test_css_property_snapshot[docs/examples/styles/scrollbar_size.py]
+ '''
+
+
+ '''
+# ---
+# name: test_css_property_snapshot[docs/examples/styles/scrollbars.py]
+ '''
+
+
+ '''
+# ---
+# name: test_css_property_snapshot[docs/examples/styles/text_align.py]
+ '''
+
+
+ '''
+# ---
+# name: test_css_property_snapshot[docs/examples/styles/text_opacity.py]
+ '''
+
+
+ '''
+# ---
+# name: test_css_property_snapshot[docs/examples/styles/text_style.py]
+ '''
+
+
+ '''
+# ---
+# name: test_css_property_snapshot[docs/examples/styles/tint.py]
+ '''
+
+
+ '''
+# ---
+# name: test_css_property_snapshot[docs/examples/styles/visibility.py]
+ '''
+
+
+ '''
+# ---
+# name: test_css_property_snapshot[docs/examples/styles/width.py]
+ '''
+
+
+ '''
+# ---
+# name: test_datatable_render
+ '''
+