Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions evidence/focus-geometry-demand-20261006/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Acquire focus ordering geometry together

The installed submit trace reaches native focus reset when the focused compose
editor becomes disabled. Screen previously sorted every displayed sibling,
including branches without a focus target. Each sort key reads virtual geometry.
For an omitted offscreen node, Compositor published another visible arrangement
retaining the accumulated reader paths plus that one node. Completeness stays
invalidated, so the next missing node repeated the operation.

Screen now acquires the focus subtree's membership, disabled/loading decisions,
inherited visibility, and allow-focus hooks once in this synchronous query.
Branches without any eligible target are pruned before requesting positions.
Ancestors of offscreen targets and visible descendants overriding a hidden
parent survive. Compositor receives the complete ordering demand together and
uses its original visible arrangement with existing committed reader paths.

The resulting branches are ordered through the original `_focus_sort_key`,
including subclass overrides and stable sibling ties. Containers precede their
children as before. Focus traps select the same original root. This does not
equate viewport paint membership with full focus eligibility.

`find_widget` delegates its original single-path acquisition to the same
Compositor method. No full-map invalidation rule, retained geometry, mutation
hold, virtual-region fallback or captured-descendant refusal was relaxed.
The local branch tuples live only for this synchronous query; there is no new
persistent geometry/focus cache, queue or reader authority. No Toad edit.

## Confirmation

22 focus/geometry checks passed in 1.66s, including existing focus trap, hook,
disabled, inherited visibility and traversal controls and strict original
capture scope. The new real `run_async` check disables a focused TextArea with
40 offscreen buttons: one visible arrangement acquires all ordering paths;
unfocusable source rows are omitted; previous committed placements survive;
the unsent draft survives; ordering matches a complete original arrangement.

One loaded source Toad App used its actual PromptTextArea disable watcher with
565 widgets / 10 tabs. Under cProfile the synchronous setter took 8.106ms:
one reset, one ordering key, one geometry acquisition, zero arrangements.
Exit zero, empty stderr, original unsent draft preserved, zero submitted inputs
or provider calls. This is not a measurement of the installed channel-send
workflow, terminal repaint, or an overall latency improvement.

Raw result/profile: `/home/ts/.cache/agent-scratch/focus-geometry-demand-20261006/`.
The supplied P7 trace remains unchanged. Its changed stacks do not establish
call counts or exact elapsed time in this method.

The original Package parser covered native 249, Toad 288 and Core 324 production
modules with zero omissions. Before/after sites are retained here. No tracked
production override of the sort-key declaration was found. Arbitrary extensions
mutating the DOM or focus predicates during a sort/layout query are not proved
by this static source pass or these checks.

Not installed. Parent owns the Toad sender and live frontend delivery; no
package, artifact, original session, recorder or public-owner operation occurred.
36 changes: 36 additions & 0 deletions evidence/focus-geometry-demand-20261006/RESULT.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"source_head": "3b138ec41ed7ef8a3fea7f0ad781118353d8f4b4",
"controls": "22 passed in 1.66s",
"app": {
"boundary": "source synchronous focused PromptTextArea.disabled watcher",
"disabled_seconds": 0.008106090012006462,
"calls": {
"_reset_focus": 1,
"_focus_sort_key": 1,
"acquire_geometry": 1,
"reflow_visible": 0,
"_arrange_root": 0
},
"tabs": 10,
"active_widgets": 565,
"inputs_submitted": 0,
"provider_calls": 0,
"draft_preserved": true
},
"app_exit": 0,
"stderr_bytes": 0,
"keepers": {
"src/textual/screen.py": "2579e6443bf554c39358dc086a6b5d16b2565f273f3c0a0d4d259ed5f71a8dde",
"src/textual/_compositor.py": "468e0303ea53acc17818bb809f8c6b07817f9f640b9b17109074a87d54033360",
"tests/test_geometry_reader_acquisition.py": "8548a4e4595012ae84195afa7eed112b47e711628a2b4c81844e5a99ef12a935",
"tests/focused_editor_disable_pilot.py": "05c99523c87dc7af056bbecfd514b7a9d65f3394debcc5eb339cf5a776ab5485",
"evidence/focus-geometry-demand-20261006/before.json": "0d3e26564bd7b6bf43343496549e90fed73398817bde175464f5a176ff0e58ab",
"evidence/focus-geometry-demand-20261006/after.json": "b2154e9902478d1861795382f6e3d494ea9dd249df031923b6ed2810460e78ca",
"evidence/focus-geometry-demand-20261006/controls.log": "d2a25651aafa6cce137d896aa47ff6d39c40666c916a57a74a3c28a713b57bc6",
"/home/ts/.cache/agent-scratch/focus-geometry-demand-20261006/app.stdout.log": "feab232e08191c811fedf2be2b8c36445154bd8ee9cbf18d46f8e3b358cc05da",
"/home/ts/.cache/agent-scratch/focus-geometry-demand-20261006/app.stderr.log": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"/home/ts/.cache/agent-scratch/focus-geometry-demand-20261006/app01/result.json": "feab232e08191c811fedf2be2b8c36445154bd8ee9cbf18d46f8e3b358cc05da",
"/home/ts/.cache/agent-scratch/focus-geometry-demand-20261006/app01/disable.pstats": "f6e21dd6c5b7826d34e3c13c761a26e7306580346b87a8be05f7a14cb16c3b62"
},
"installed": false
}
150 changes: 150 additions & 0 deletions evidence/focus-geometry-demand-20261006/after.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
{
"modules": 249,
"omissions": [],
"sites": [
[
"src/textual/_compositor.py",
1418,
"find_widget",
"FunctionDef"
],
[
"src/textual/_compositor.py",
1442,
"acquire_geometry",
"FunctionDef"
],
[
"src/textual/_compositor.py",
1246,
"find_widget",
"Attribute"
],
[
"src/textual/_compositor.py",
1432,
"acquire_geometry",
"Attribute"
],
[
"src/textual/_compositor.py",
1260,
"find_widget",
"Attribute"
],
[
"src/textual/await_remove.py",
61,
"_reset_focus",
"Attribute"
],
[
"src/textual/css/query.py",
476,
"_reset_focus",
"Attribute"
],
[
"src/textual/screen.py",
756,
"find_widget",
"FunctionDef"
],
[
"src/textual/screen.py",
788,
"focus_chain",
"FunctionDef"
],
[
"src/textual/screen.py",
1050,
"_reset_focus",
"FunctionDef"
],
[
"src/textual/screen.py",
880,
"focus_chain",
"Attribute"
],
[
"src/textual/screen.py",
1068,
"focus_chain",
"Attribute"
],
[
"src/textual/screen.py",
768,
"find_widget",
"Attribute"
],
[
"src/textual/screen.py",
839,
"acquire_geometry",
"Attribute"
],
[
"src/textual/screen.py",
1842,
"find_widget",
"Attribute"
],
[
"src/textual/screen.py",
2149,
"find_widget",
"Attribute"
],
[
"src/textual/selection.py",
413,
"find_widget",
"Attribute"
],
[
"src/textual/widget.py",
2589,
"_focus_sort_key",
"FunctionDef"
],
[
"src/textual/widget.py",
2664,
"find_widget",
"Attribute"
],
[
"src/textual/widget.py",
4880,
"_reset_focus",
"Attribute"
],
[
"src/textual/widget.py",
2490,
"find_widget",
"Attribute"
],
[
"src/textual/widget.py",
2503,
"find_widget",
"Attribute"
],
[
"src/textual/widget.py",
2515,
"find_widget",
"Attribute"
],
[
"src/textual/widget.py",
2541,
"find_widget",
"Attribute"
]
]
}
Loading
Loading