Better handle some gtk tables that report themselves as lists.

This commit is contained in:
Storm Dragon committed 2026-10-17 15:49:37 -04:00
1 parent 824a4d2369
commit 3df96145f2
12 files changed
+381 -13

No files matched your search

+44
View File
@@ -0,0 +1,44 @@
# GTK tables exposed as lists
I38's run dialog uses a GTK TreeView whose accessible role is overridden to
`list`. It still exposes table selection and table cells. On the first Down,
GTK can send container focus, row selection and container focus again.
Cthulhu resolves this control's focus to its selected cell using the existing
table selection rules. Recognition requires the GTK toolkit, list role and
AT-SPI Table interface. Multiple selected rows retain container focus. Cell
capture preserves the table owner so subsequent arrows remain readable.
Ordinary lists and browser lists do not use this added normalization.
Window descriptions spoken during entry activation are remembered before the
first row selection. Changed or newly available help remains eligible for
speech. A list's name is supplied by list context when enabled, or by the
existing table-name presentation when list context is disabled.
Run the affected packages and isolated GTK checks:
```sh
go test -race ./internal/app ./internal/atspi ./internal/presentation -count=1
python3 tests/native_atspi.py --table-only
```
The native checks cover ordinary single- and multiple-selection tables, tables
with list roles, and combined focus/context/speech delivery. The speech check
uses Down twice and Shift+Tab: each row and the opening description occur once,
and the only list-exit announcement occurs on returning to the entry. The
fixture counts accessible children according to existing list-count behavior;
that count can include headers and individual cells.
Before submission, review the diff and test with the rebuilt reader:
1. Open I38 Run, wait for its instructions, and press Down several times, then
Up. Confirm the first result is readable without repeated help or a false
list-exit announcement. Return to the entry with Shift+Tab, type a filter,
re-enter the results, and close and reopen the dialog.
2. In a file manager and Cthulhu's preference tables, check Up/Down, Left/Right,
multiple selection and the full-row reading preference.
3. Check an ordinary GTK list, a menu and a browser list. Genuine container
exits must still be announced when enabled. Toggle list-context speech and
description speech, checking that enabled labels/help remain available.
4. Repeat the affected navigation with a physical Braille display when
available. Automated checks do not establish audible or physical acceptance.
+194
View File
@@ -20,12 +20,206 @@ package app
import (
"context"
"log/slog"
"os"
"os/exec"
"strings"
"testing"
"time"
"git.stormux.org/storm/cthulhu/internal/atspi"
"git.stormux.org/storm/cthulhu/internal/config"
"git.stormux.org/storm/cthulhu/internal/input"
"git.stormux.org/storm/cthulhu/internal/presentation"
)
func TestNativeGUIListTableSpeech(t *testing.T) {
if os.Getenv("CTHULHU_NATIVE_GUI_LIST_TABLE") != "1" {
t.Skip("requires isolated GTK table with list role")
}
ctx, cancel := context.WithTimeout(context.Background(), 12*time.Second)
defer cancel()
adapter := atspi.New()
if err := adapter.Start(ctx); err != nil {
t.Fatal(err)
}
defer func() {
stopCtx, stopCancel := context.WithTimeout(context.Background(), 3*time.Second)
defer stopCancel()
if err := adapter.Stop(stopCtx); err != nil {
t.Errorf("stop adapter: %v", err)
}
}()
tree, err := adapter.CaptureDesktop(ctx)
if err != nil {
t.Fatal(err)
}
var entry atspi.Snapshot
var window atspi.ObjectID
root, err := tree.Root()
if err != nil {
t.Fatal(err)
}
pending := []atspi.ObjectReference{root}
for len(pending) > 0 {
reference := pending[len(pending)-1]
pending = pending[:len(pending)-1]
snapshot, err := tree.Resolve(reference)
if err != nil {
t.Fatal(err)
}
if snapshot.Name == "Command" {
entry = snapshot
}
if snapshot.Name == "Table presentation probe" {
window = snapshot.ID()
}
for child, ok, err := tree.FirstChild(reference); ; child, ok, err = tree.NextSibling(child) {
if err != nil {
t.Fatal(err)
}
if !ok {
break
}
pending = append(pending, child)
}
}
if !entry.ID().Valid() || !window.Valid() {
t.Fatal("launcher entry or window missing")
}
queue := &fakeSpeechQueue{spoken: make(chan string, 32), requests: make(chan speechRequest, 32)}
logger := slog.New(slog.DiscardHandler)
state := &eventLoopState{}
state.presentationOptions = presentation.DefaultOptions()
state.focusedID, state.current = entry.ID(), entry
presenter := eventPresenter{state: state, logger: logger, speech: queue}
handler := accessibilityEventHandler{state: state, logger: logger}
speaker := &fakeSpeaker{spoken: make(chan string, 64)}
worker := newSpeechWorker(logger, speaker)
worker.reading = func() config.ReadingSettings { return config.DefaultSettings().Reading }
worker.verbosity = func() int { return 1 }
activation := atspi.NewEvent(atspi.WindowActivatedEvent, entry)
activation.Window, activation.WindowTitle = window, "Table presentation probe"
activation.WindowDescription = "Select an item and press Enter to open it."
presenter.speak(activation)
deliver := func() {
t.Helper()
for len(queue.requests) > 0 {
if err := worker.deliver(ctx, <-queue.requests); err != nil {
t.Fatal(err)
}
}
}
deliver()
for index, step := range []struct{ key, name string }{{"Down", "Alpha"}, {"Down", "Beta"}, {"shift+Tab", "Command"}} {
if err := exec.Command("xdotool", "key", step.key).Run(); err != nil {
t.Fatal(err)
}
matched:
for {
select {
case <-ctx.Done():
t.Fatalf("no focus/selection for %s", step.name)
case event := <-adapter.Events():
if !isFocusGainEvent(event) && !isManagedDescendantEvent(event.Type) {
continue
}
if !handler.acceptFocusedEvent(event, input.Activity{Sequence: uint64(index + 1)}) {
presenter.speak(event)
}
deliver()
if event.Source.Name == step.name {
break matched
}
}
}
}
var parts []string
for len(speaker.spoken) > 0 {
parts = append(parts, <-speaker.spoken)
}
text := strings.Join(parts, " | ")
t.Log(text)
if strings.Count(text, activation.WindowDescription) != 1 || strings.Count(text, "Leaving Probe items list.") != 1 ||
strings.Count(text, "Alpha") != 1 || strings.Count(text, "Beta") != 1 || strings.Count(text, "Probe items") != 2 {
t.Fatalf("unexpected launcher speech: %s", text)
}
// Exiting through Shift+Tab should produce the only list-exit message.
if len(parts) < 3 || parts[len(parts)-3] != "Leaving Probe items list." {
t.Fatalf("list exit occurred before returning to the entry: %s", text)
}
}
func TestGUIListTableNameHonorsContextSettings(t *testing.T) {
for _, contextEnabled := range []bool{true, false} {
state := &eventLoopState{}
state.presentationOptions = presentation.DefaultOptions()
reading := config.DefaultSettings().Reading
reading.SpeakContextList = contextEnabled
state.presentationOptions.Reading = &reading
list := atspi.Snapshot{BusName: ":1.24", Path: "/results", Role: "list", Name: "Results"}
cell := atspi.Snapshot{BusName: list.BusName, Path: "/results/alpha", Name: "Alpha", Role: "table cell",
GUITable: true, TablePath: list.Path, TableName: list.Name, SpeechContext: []atspi.Snapshot{list}}
event := atspi.NewManagedDescendantEvent(atspi.SelectionChangedEvent, list.Path, cell)
result := state.prepareGUITable(event, 1)
spoken, _ := state.decorateGUITable(event, presentation.Speech{Text: "Alpha"}, result)
want := "Alpha"
if !contextEnabled {
want = "Results, Alpha"
}
if spoken.Text != want {
t.Fatalf("list context enabled=%t: got %q, want %q", contextEnabled, spoken.Text, want)
}
}
}
func TestTableDescriptionAlreadyReadWithEntryActivation(t *testing.T) {
queue := &fakeSpeechQueue{spoken: make(chan string, 8), requests: make(chan speechRequest, 8)}
state := &eventLoopState{}
state.presentationOptions = presentation.DefaultOptions()
presenter := eventPresenter{state: state, logger: slog.New(slog.DiscardHandler), speech: queue}
window := atspi.NewObjectID(":1.24", "/launcher")
entry := atspi.NewSnapshot("/launcher/entry", "Command", "text", "", "")
entry.BusName = window.BusName
event := atspi.NewEvent(atspi.WindowActivatedEvent, entry)
event.Window, event.WindowTitle = window, "Launcher"
event.WindowDescription = "Choose a result and press Enter."
presenter.speak(event)
if got := (<-queue.requests).Text; got != "Launcher, Command, text, Choose a result and press Enter." {
t.Fatalf("entry activation = %q", got)
}
cell := atspi.NewSnapshot("/launcher/results/alpha", "Alpha", "table cell", "", "")
cell.BusName = window.BusName
event.Type, event.Source = atspi.SelectionChangedEvent, cell
presenter.speak(event)
if got := (<-queue.requests).Text; got != "Alpha" {
t.Fatalf("first result repeated window description: %q", got)
}
// Changed help and help in another window must still be presented.
event.WindowDescription = "Updated result help."
presenter.speak(event)
if got := (<-queue.requests).Text; got != "Alpha, Updated result help." {
t.Fatalf("changed description = %q", got)
}
event.Window = atspi.NewObjectID(window.BusName, "/other")
event.Source.Path = "/other/results/alpha"
presenter.speak(event)
if got := (<-queue.requests).Text; got != "Alpha, Updated result help." {
t.Fatalf("other window description = %q", got)
}
// Opening with descriptions disabled must not consume help which becomes
// enabled before the user enters the results.
state.presentationOptions.SpeakDescription = false
event.Type, event.Source, event.Window = atspi.WindowActivatedEvent, entry, window
presenter.speak(event)
<-queue.requests
state.presentationOptions.SpeakDescription = true
event.Type, event.Source = atspi.SelectionChangedEvent, cell
presenter.speak(event)
if got := (<-queue.requests).Text; got != "Alpha, Updated result help." {
t.Fatalf("newly enabled description = %q", got)
}
}
func TestTableWindowDescriptionSurvivesImmediateTableFocus(t *testing.T) {
speech := &fakeSpeechQueue{spoken: make(chan string, 3), requests: make(chan speechRequest, 3)}
adapter := &fakeAdapter{events: make(chan atspi.Event, 3)}
+8
View File
@@ -225,6 +225,14 @@ func (presenter *eventPresenter) speak(event atspi.Event, capturedIntent ...inpu
event.Source.Role == "terminal" && event.Type == atspi.TextInsertedEvent,
BypassFocusGate: eventBypassesXTermHandoff(event),
})
// Activation can describe the window while focus is still in its entry.
// Remember that help before the first table row is selected. Keep the
// immediate table-focus append timing owned by decorateGUITable.
if event.Type == atspi.WindowActivatedEvent && !prompt.activation &&
state.presentationOptions.SpeakDescription && event.Window.Valid() && event.WindowDescription != "" {
state.tableDescriptionWindow = event.Window
state.tableDescriptionText = event.WindowDescription
}
state.rememberGUITable(event, table)
if event.Source.LiveRegion {
state.lastLiveText, state.lastLiveAt = text, time.Now()
+17
View File
@@ -9,6 +9,7 @@ import (
"time"
"git.stormux.org/storm/cthulhu/internal/atspi"
"git.stormux.org/storm/cthulhu/internal/config"
"git.stormux.org/storm/cthulhu/internal/presentation"
)
@@ -24,6 +25,7 @@ func (state *eventLoopState) prepareGUITable(event atspi.Event, sequence uint64)
if event.Type == atspi.WindowActivatedEvent {
state.tableDescriptionWindow = atspi.ObjectID{}
state.tableDescriptionText = ""
state.tableDescriptionAt = time.Time{}
state.lastTable = atspi.ObjectID{}
state.lastTableCell = atspi.ObjectID{}
} else if isFocusGainEvent(event) && event.Source.Role != "table" && event.Source.Role != "table cell" {
@@ -65,8 +67,23 @@ func (state *eventLoopState) decorateGUITable(event atspi.Event, spoken presenta
result.table != state.lastTable && event.Source.TableName != "" &&
(isFocusGainEvent(event) || isManagedDescendantEvent(event.Type)) &&
event.Type != atspi.WindowActivatedEvent {
// A GTK table exposed as a list already gets its name from list
// context. Retain the table label when that context is disabled.
listContext := false
for _, ancestor := range event.Source.SpeechContext {
if ancestor.ID() == result.table && ancestor.Role == "list" && ancestor.Name == event.Source.TableName {
reading := config.DefaultSettings().Reading
if result.options.Reading != nil {
reading = *result.options.Reading
}
listContext = presentation.ContextEnabled("list", reading)
break
}
}
if !listContext {
spoken = spoken.Prepend(event.Source.TableName, ", ")
}
}
appendFocus := isFocusGainEvent(event) && event.Type != atspi.WindowActivatedEvent &&
state.tableDescriptionWindow.Valid() && event.Window == state.tableDescriptionWindow &&
time.Since(state.tableDescriptionAt) < 300*time.Millisecond
+2 -1
View File
@@ -27,7 +27,8 @@ gchar *cthulhu_table_context(AtspiAccessible *source, gint *rows, gint *columns,
}
if (tableAccessible == NULL) {
AtspiAccessible *parent = atspi_accessible_get_parent(source, NULL);
if (parent != NULL && atspi_accessible_get_role(parent, NULL) == ATSPI_ROLE_TABLE) {
if (parent != NULL && (atspi_accessible_get_role(parent, NULL) == ATSPI_ROLE_TABLE ||
cthulhu_is_gtk_list_table(parent))) {
tableAccessible = parent;
gint index = atspi_accessible_get_index_in_parent(source, NULL);
AtspiTable *parentTable = atspi_accessible_get_table_iface(parent);
@@ -52,9 +52,10 @@ func selectNativeEventTarget(event *C.AtspiEvent, eventType string) (*C.AtspiAcc
// A table's first selected child is its active child only when the
// selection is unique. Multi-selection changes use their own events.
targetRole := C.atspi_accessible_get_role(target, nil)
if targetRole == C.ATSPI_ROLE_MENU || targetRole == C.ATSPI_ROLE_TABLE {
listTable := targetRole == C.ATSPI_ROLE_LIST && C.cthulhu_is_gtk_list_table(target) != 0
if targetRole == C.ATSPI_ROLE_MENU || targetRole == C.ATSPI_ROLE_TABLE || listTable {
var child *C.AtspiAccessible
if targetRole == C.ATSPI_ROLE_TABLE {
if targetRole == C.ATSPI_ROLE_TABLE || listTable {
child = C.cthulhu_table_selected_child(target)
} else {
child = C.cthulhu_selected_child(target)
@@ -89,7 +90,7 @@ func selectNativeEventTarget(event *C.AtspiEvent, eventType string) (*C.AtspiAcc
// child list. Tab creation/removal makes that list stale.
C.atspi_accessible_clear_cache_single(event.source)
}
if C.atspi_accessible_get_role(event.source, nil) == C.ATSPI_ROLE_TABLE {
if C.atspi_accessible_get_role(event.source, nil) == C.ATSPI_ROLE_TABLE || C.cthulhu_is_gtk_list_table(event.source) != 0 {
target = C.cthulhu_table_selected_child(event.source)
} else {
target = C.cthulhu_selected_child(event.source)
+13
View File
@@ -84,6 +84,19 @@ AtspiAccessible *cthulhu_selected_child(AtspiAccessible *source) {
return child;
}
// GtkTreeView can override its role to LIST while retaining table cells and
// table selection. Ordinary lists and browser content keep their own policy.
gboolean cthulhu_is_gtk_list_table(AtspiAccessible *source) {
if (atspi_accessible_get_role(source, NULL) != ATSPI_ROLE_LIST) return FALSE;
AtspiTable *table = atspi_accessible_get_table_iface(source);
if (table == NULL) return FALSE;
g_object_unref(table);
gchar *toolkit = atspi_accessible_get_toolkit_name(source, NULL);
gboolean matches = g_ascii_strcasecmp(toolkit != NULL ? toolkit : "", "gtk") == 0;
g_free(toolkit);
return matches;
}
// Selection counts cells, so a single GTK row with two columns already has
// two selected children. Query the table's selected rows before treating its
// first selected cell as the focus target.
+1
View File
@@ -105,6 +105,7 @@ gchar *cthulhu_live_attribute(AtspiAccessible *source, const gchar *key);
AtspiAccessible *cthulhu_event_active_descendant(AtspiEvent *event);
AtspiAccessible *cthulhu_selected_child(AtspiAccessible *source);
AtspiAccessible *cthulhu_table_selected_child(AtspiAccessible *source);
gboolean cthulhu_is_gtk_list_table(AtspiAccessible *source);
void cthulhu_refresh_frame_children(AtspiAccessible *window);
AtspiAccessible *cthulhu_focused_descendant(AtspiAccessible *window);
AtspiAccessible *cthulhu_showing_web_document(AtspiAccessible *window);
+60 -1
View File
@@ -100,6 +100,61 @@ selectedRow:
}
}
func TestNativeGUIListTableFocus(t *testing.T) {
if os.Getenv("CTHULHU_NATIVE_GUI_LIST_TABLE") != "1" {
t.Skip("requires isolated GTK table with list role")
}
ctx, cancel := context.WithTimeout(context.Background(), 12*time.Second)
defer cancel()
adapter := New()
if err := adapter.Start(ctx); err != nil {
t.Fatal(err)
}
defer func() {
stopCtx, stopCancel := context.WithTimeout(context.Background(), 3*time.Second)
defer stopCancel()
if err := adapter.Stop(stopCtx); err != nil {
t.Errorf("stop adapter: %v", err)
}
}()
tree, err := adapter.CaptureDesktop(ctx)
if err != nil {
t.Fatal(err)
}
list := findNamedReference(t, tree, "Probe items")
snapshot, err := tree.Resolve(list)
if err != nil || snapshot.Role != "list" {
t.Fatalf("fixture list role = %q, %v", snapshot.Role, err)
}
for _, name := range []string{"Alpha", "Beta"} {
if err := exec.Command("xdotool", "key", "Down").Run(); err != nil {
t.Fatal(err)
}
selected:
for {
select {
case <-ctx.Done():
t.Fatalf("list table did not present %s", name)
case event := <-adapter.Events():
if event.Type != FocusEvent && event.Type != FocusedStateEvent && event.Type != SelectionChangedEvent {
continue
}
if event.Source.ID() == list.ID() {
t.Fatalf("list table focus was not normalized to its selected cell: %#v", event.Source)
}
if event.Source.Name != name {
continue
}
if event.Source.Role != "table cell" || !event.Source.GUITable ||
!event.Source.TablePositionKnown || event.Source.TablePath != list.ID().Path {
t.Fatalf("list table selected cell = %#v", event.Source)
}
break selected
}
}
}
}
func TestNativeGUITableFocusPresentsSelectedChild(t *testing.T) {
if os.Getenv("CTHULHU_NATIVE_GUI_TABLE") != "1" {
t.Skip("requires isolated GTK table fixture")
@@ -203,7 +258,11 @@ func TestNativeGUITableMultiselectionFocus(t *testing.T) {
if event.Source.Role == "button" || event.Source.Role == "push button" {
continue
}
if event.Source.Role != "table" || event.Source.Name != "Probe items" {
wantRole := "table"
if os.Getenv("CTHULHU_NATIVE_GUI_LIST_TABLE") == "1" {
wantRole = "list"
}
if event.Source.Role != wantRole || event.Source.Name != "Probe items" {
t.Fatalf("multiselection focus guessed a row: %#v", event.Source)
}
return
+1 -1
View File
@@ -14,7 +14,7 @@ xterm-focus-handoff,src/cthulhu/input_event_manager.py,input,Suspend Cthulhu whi
focus-speech,src/cthulhu/scripts/default.py,speech,Speak the focused accessible object including common control states and range values,Storm Dragon,internal/atspi internal/presentation internal/app,in-progress,go test ./internal/atspi ./internal/presentation ./internal/app -count=1,Maintainer accepted post-change YAD value and LibreOffice focus value and menu behavior on physical Xorg on 2026-09-12. The combined log had no accessibility-event speech or sound queue overflow; 599 debug diagnostics were dropped during a LibreOffice state-event burst.,,Maintainer reported that all combined YAD I38 and LibreOffice tests worked great on 2026-09-12.,,Focus presentation includes common states and range values. Focused value changes speak only the value; non-focused state and value events are filtered; menu selection and table-cell verbosity are reduced. Relations position context background progress updates complete role-specific formatting and diagnostics saturation acceptance remain pending. Parity review corrections and remaining physical gates: docs/testing/parity-review-follow-up.md. September 25 review: window-owned title tracking suppresses repeated name events and preserves empty-to-restored title changes; event-loop regression passes. Combo selection follow-up: focus/name/value event regressions verify selection-only speech without repeated combo cues and restore the cue on re-entry; focused app/presentation race checks pass. Physical listening pending.
terminal-caret-character,src/cthulhu/scripts/default.py,terminal,Speak the character at the caret,Storm Dragon,internal/app,in-progress,go test ./internal/atspi ./internal/presentation ./internal/app -count=1,Maintainer accepted terminal caret behavior in the launcher's LXTerminal test application on Xorg during the Stage 1 physical checklist on 2026-09-11.,,Maintainer heard terminal caret speech during the accepted Stage 1 physical Xorg checklist on 2026-09-11.,,Uses AT-SPI character granularity with line fallback debounces caret movement and suppresses unchanged path-and-announcement combinations; broader terminal application and editing coverage remains pending.
terminal-text-change-echo,src/cthulhu/scripts/terminal/script.py,terminal,Speak sanitized inserted or deleted text from terminals and editable text controls,Storm Dragon,internal/app,in-progress,go test ./internal/atspi ./internal/presentation ./internal/app -count=1,"Maintainer accepted terminal insertion in LXTerminal on Xorg on 2026-09-11, accepted the post-change LibreOffice Writer typing behavior on physical Xorg on 2026-09-12, and confirmed YAD close-and-prompt coalescing on physical Xorg on 2026-09-13. Physical acceptance of terminal deletion-redraw coalescing is pending.",,"Maintainer accepted terminal insertion, Writer duplicate suppression, and YAD close-and-prompt behavior on physical Xorg.",,Text changes are limited to terminals and editable text or paragraph roles. A change suppresses the next caret event from the same object so typing does not replay the line. Same-terminal insertion within the event-coalescing window suppresses a redundant interrupting terminal-focus presentation. A terminal deletion waits 50 ms and is suppressed only when the same terminal inserts replacement text at the same AT-SPI offset; standalone and different-offset deletions remain presentable. Debug speech delivery records retain the final utterance with cause and policy metadata; normal logging omits speech content. Broader application coverage remains incomplete.
managed-descendant-presentation,src/cthulhu/scripts/default.py,focus,Resolve focused container selection and active-descendant changes to the managed child,Storm Dragon,internal/atspi internal/app,in-progress,go test ./internal/atspi ./internal/app -count=1; python3 tests/native_x11.py,The isolated GTK/Xvfb/D-Bus selection fixture and physical I38 run-dialog completion selection speech passed on 2026-09-12 without regressing X11 pass-through command consumption release ordering lock states lifecycle or grab cleanup.,,Maintainer accepted I38 run-dialog completion selection speech on physical Xorg on 2026-09-12.,,The generic adapter registers both selection and active-descendant events resolves their managed child preserves the originating container path and filters events unless the container or child owns focus. Duplicate target presentations are suppressed. No I38-specific workaround was added. Broader GTK and Qt managed-descendant coverage remains pending.
managed-descendant-presentation,src/cthulhu/scripts/default.py,focus,Resolve focused container selection and active-descendant changes to the managed child,Storm Dragon,internal/atspi internal/app,in-progress,go test ./internal/atspi ./internal/app -count=1; python3 tests/native_x11.py; python3 tests/native_atspi.py --table-only,The isolated GTK/Xvfb/D-Bus selection fixture and physical I38 run-dialog completion selection speech passed on 2026-09-12 without regressing X11 pass-through command consumption release ordering lock states lifecycle or grab cleanup.,,Maintainer accepted I38 run-dialog completion selection speech on physical Xorg on 2026-09-12.,,The generic adapter registers both selection and active-descendant events resolves their managed child preserves the originating container path and filters events unless the container or child owns focus. Duplicate target presentations are suppressed. No I38-specific workaround was added. Broader GTK and Qt managed-descendant coverage remains pending. October 17: GTK controls with list role and Table interface retain selected-cell focus and table ownership without normalizing ordinary lists or choosing among multiple selected rows. Private native focus and recorded-speech tests cover first Down and genuine Shift+Tab exit; activation descriptions are not repeated on first row selection. Current physical listening and Braille acceptance remain pending. See docs/testing/gui-list-tables.md.
ssip-speak-cancel,src/cthulhu/speechdispatcherfactory.py,speech,Send speech and cancellation through SSIP,Storm Dragon,internal/speech,in-progress,go test ./internal/speech -count=1,Maintainer accepted audible non-consuming Control/Shift interruption in the Stage 1 physical Xorg checklist on 2026-09-11.,,Maintainer heard lifecycle and terminal speech plus Control/Shift interruption during the accepted Stage 1 physical Xorg checklist on 2026-09-11.,,Protocol replies 230 and 225 were confirmed against the local service; broader backend and X11 coverage remains pending.
web-structural-navigation,src/cthulhu/scripts/web/script.py,web,Move by headings and other document structure,Storm Dragon,internal/input internal/review internal/app,in-progress,go test -race ./... -count=1; python3 tests/native_browser.py,Private Brave/Xvfb structural and mode/chrome sequences pass on 2026-09-20.,,Physical Xorg listening and wrap acceptance pending.,,Structural navigation follows native caret movement. Echo suppression ends on subsequent input. Failed same-object context capture retries. Delayed document carets cannot override editable focus and stale results cannot overwrite unresolved unrelated focus. All 27 browse symbols pass through after routing is disabled. Complete Python structural settings and dialogs remain pending. Parity review corrections and remaining physical gates: docs/testing/parity-review-follow-up.md.
web-document-recapture,src/cthulhu/ax_object.py,web,Recover heading navigation after browser document replacement,Storm Dragon,internal/atspi internal/review internal/app,in-progress,go test -race ./... -count=1; python3 tests/native_browser.py,Private Brave/Xvfb passes immediate H after loading a new page and after activating its return link on 2026-09-20.,,Physical forum listening acceptance pending.,,Native caches refresh on recapture. Load completion retains the new root and resets browser context and pending reading. Worker page epochs retire queued and in-flight results across reused paths. Native reload and mode/chrome tests remain covered. Installed Go preview and Brave Origin are not verified. On 2026-09-21 semantic invalidation was scoped to captured objects so browser chrome and other applications cannot discard the document. Focused race tests and the full private Brave suite pass; heading/link jumps assert capture reuse. Large-page latency and logged stale-object failures still require physical retesting. September 22 log regressions: native invalid text-end recovery and bounded embedded text expansion; web name-event suppression; background load preserves verified chrome focus. Focused race tests and private Brave proofs pass. See docs/testing/chromium-browser.md for reference behavior and remaining physical gates. September 23 ownership correction rejects loads outside the current application or known window and after owner loss; accepted loads update the focus owner for correct defunct recovery. Five event-loop regressions and app race tests pass; physical acceptance remains pending. September 24 same-geometry window recovery now requires fresh active/showing/non-iconified state before foreground correlation; private recovery regression fails on the earlier preview and passes on the rebuilt one. Address changes outside the owned field are suppressed; popup-associated typing remains supported. September 25 review: recovery now checks the fresh tree when text/geometry recapture discovers a removed focus; deterministic regression and focused race checks pass.
1 id python_source subsystem behavior owner go_destination status automated_evidence x11_evidence wayland_evidence speech_evidence braille_evidence notes
14 focus-speech src/cthulhu/scripts/default.py speech Speak the focused accessible object including common control states and range values Storm Dragon internal/atspi internal/presentation internal/app in-progress go test ./internal/atspi ./internal/presentation ./internal/app -count=1 Maintainer accepted post-change YAD value and LibreOffice focus value and menu behavior on physical Xorg on 2026-09-12. The combined log had no accessibility-event speech or sound queue overflow; 599 debug diagnostics were dropped during a LibreOffice state-event burst. Maintainer reported that all combined YAD I38 and LibreOffice tests worked great on 2026-09-12. Focus presentation includes common states and range values. Focused value changes speak only the value; non-focused state and value events are filtered; menu selection and table-cell verbosity are reduced. Relations position context background progress updates complete role-specific formatting and diagnostics saturation acceptance remain pending. Parity review corrections and remaining physical gates: docs/testing/parity-review-follow-up.md. September 25 review: window-owned title tracking suppresses repeated name events and preserves empty-to-restored title changes; event-loop regression passes. Combo selection follow-up: focus/name/value event regressions verify selection-only speech without repeated combo cues and restore the cue on re-entry; focused app/presentation race checks pass. Physical listening pending.
15 terminal-caret-character src/cthulhu/scripts/default.py terminal Speak the character at the caret Storm Dragon internal/app in-progress go test ./internal/atspi ./internal/presentation ./internal/app -count=1 Maintainer accepted terminal caret behavior in the launcher's LXTerminal test application on Xorg during the Stage 1 physical checklist on 2026-09-11. Maintainer heard terminal caret speech during the accepted Stage 1 physical Xorg checklist on 2026-09-11. Uses AT-SPI character granularity with line fallback debounces caret movement and suppresses unchanged path-and-announcement combinations; broader terminal application and editing coverage remains pending.
16 terminal-text-change-echo src/cthulhu/scripts/terminal/script.py terminal Speak sanitized inserted or deleted text from terminals and editable text controls Storm Dragon internal/app in-progress go test ./internal/atspi ./internal/presentation ./internal/app -count=1 Maintainer accepted terminal insertion in LXTerminal on Xorg on 2026-09-11, accepted the post-change LibreOffice Writer typing behavior on physical Xorg on 2026-09-12, and confirmed YAD close-and-prompt coalescing on physical Xorg on 2026-09-13. Physical acceptance of terminal deletion-redraw coalescing is pending. Maintainer accepted terminal insertion, Writer duplicate suppression, and YAD close-and-prompt behavior on physical Xorg. Text changes are limited to terminals and editable text or paragraph roles. A change suppresses the next caret event from the same object so typing does not replay the line. Same-terminal insertion within the event-coalescing window suppresses a redundant interrupting terminal-focus presentation. A terminal deletion waits 50 ms and is suppressed only when the same terminal inserts replacement text at the same AT-SPI offset; standalone and different-offset deletions remain presentable. Debug speech delivery records retain the final utterance with cause and policy metadata; normal logging omits speech content. Broader application coverage remains incomplete.
17 managed-descendant-presentation src/cthulhu/scripts/default.py focus Resolve focused container selection and active-descendant changes to the managed child Storm Dragon internal/atspi internal/app in-progress go test ./internal/atspi ./internal/app -count=1; python3 tests/native_x11.py go test ./internal/atspi ./internal/app -count=1; python3 tests/native_x11.py; python3 tests/native_atspi.py --table-only The isolated GTK/Xvfb/D-Bus selection fixture and physical I38 run-dialog completion selection speech passed on 2026-09-12 without regressing X11 pass-through command consumption release ordering lock states lifecycle or grab cleanup. Maintainer accepted I38 run-dialog completion selection speech on physical Xorg on 2026-09-12. The generic adapter registers both selection and active-descendant events resolves their managed child preserves the originating container path and filters events unless the container or child owns focus. Duplicate target presentations are suppressed. No I38-specific workaround was added. Broader GTK and Qt managed-descendant coverage remains pending. The generic adapter registers both selection and active-descendant events resolves their managed child preserves the originating container path and filters events unless the container or child owns focus. Duplicate target presentations are suppressed. No I38-specific workaround was added. Broader GTK and Qt managed-descendant coverage remains pending. October 17: GTK controls with list role and Table interface retain selected-cell focus and table ownership without normalizing ordinary lists or choosing among multiple selected rows. Private native focus and recorded-speech tests cover first Down and genuine Shift+Tab exit; activation descriptions are not repeated on first row selection. Current physical listening and Braille acceptance remain pending. See docs/testing/gui-list-tables.md.
18 ssip-speak-cancel src/cthulhu/speechdispatcherfactory.py speech Send speech and cancellation through SSIP Storm Dragon internal/speech in-progress go test ./internal/speech -count=1 Maintainer accepted audible non-consuming Control/Shift interruption in the Stage 1 physical Xorg checklist on 2026-09-11. Maintainer heard lifecycle and terminal speech plus Control/Shift interruption during the accepted Stage 1 physical Xorg checklist on 2026-09-11. Protocol replies 230 and 225 were confirmed against the local service; broader backend and X11 coverage remains pending.
19 web-structural-navigation src/cthulhu/scripts/web/script.py web Move by headings and other document structure Storm Dragon internal/input internal/review internal/app in-progress go test -race ./... -count=1; python3 tests/native_browser.py Private Brave/Xvfb structural and mode/chrome sequences pass on 2026-09-20. Physical Xorg listening and wrap acceptance pending. Structural navigation follows native caret movement. Echo suppression ends on subsequent input. Failed same-object context capture retries. Delayed document carets cannot override editable focus and stale results cannot overwrite unresolved unrelated focus. All 27 browse symbols pass through after routing is disabled. Complete Python structural settings and dialogs remain pending. Parity review corrections and remaining physical gates: docs/testing/parity-review-follow-up.md.
20 web-document-recapture src/cthulhu/ax_object.py web Recover heading navigation after browser document replacement Storm Dragon internal/atspi internal/review internal/app in-progress go test -race ./... -count=1; python3 tests/native_browser.py Private Brave/Xvfb passes immediate H after loading a new page and after activating its return link on 2026-09-20. Physical forum listening acceptance pending. Native caches refresh on recapture. Load completion retains the new root and resets browser context and pending reading. Worker page epochs retire queued and in-flight results across reused paths. Native reload and mode/chrome tests remain covered. Installed Go preview and Brave Origin are not verified. On 2026-09-21 semantic invalidation was scoped to captured objects so browser chrome and other applications cannot discard the document. Focused race tests and the full private Brave suite pass; heading/link jumps assert capture reuse. Large-page latency and logged stale-object failures still require physical retesting. September 22 log regressions: native invalid text-end recovery and bounded embedded text expansion; web name-event suppression; background load preserves verified chrome focus. Focused race tests and private Brave proofs pass. See docs/testing/chromium-browser.md for reference behavior and remaining physical gates. September 23 ownership correction rejects loads outside the current application or known window and after owner loss; accepted loads update the focus owner for correct defunct recovery. Five event-loop regressions and app race tests pass; physical acceptance remains pending. September 24 same-geometry window recovery now requires fresh active/showing/non-iconified state before foreground correlation; private recovery regression fails on the earlier preview and passes on the rebuilt one. Address changes outside the owned field are suppressed; popup-associated typing remains supported. September 25 review: recovery now checks the fresh tree when text/geometry recapture discovers a removed focus; deterministic regression and focused race checks pass.
+23 -5
View File
@@ -5,7 +5,9 @@ import gi
import os
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
gi.require_version("Gdk", "3.0")
gi.require_version("Atk", "1.0")
from gi.repository import Atk, Gdk, Gtk
window = Gtk.Window(title="Table presentation probe")
@@ -27,21 +29,37 @@ view.append_column(name_column)
kind_renderer = Gtk.CellRendererText()
view.append_column(Gtk.TreeViewColumn("Kind", kind_renderer, text=1))
multi = os.environ.get("CTHULHU_GTK_TABLE_MULTI") == "1"
listRole = os.environ.get("CTHULHU_GTK_TABLE_LIST") == "1"
if multi:
view.get_selection().set_mode(Gtk.SelectionMode.MULTIPLE)
if multi or listRole:
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
button = Gtk.Button(label="Before table")
box.pack_start(button, False, False, 0)
before = Gtk.Entry() if listRole else Gtk.Button(label="Before table")
if listRole:
before.get_accessible().set_name("Command")
view.get_accessible().set_role(Atk.Role.LIST)
def on_entry_key_press(_entry, event):
if event.keyval == Gdk.KEY_Down:
view.grab_focus()
view.get_selection().select_path(0)
return True
return False
before.connect("key-press-event", on_entry_key_press)
box.pack_start(before, False, False, 0)
box.pack_start(view, True, True, 0)
window.add(box)
else:
window.add(view)
view.get_selection().select_path(0)
if listRole and not multi:
view.get_selection().unselect_all()
if multi:
view.get_selection().select_path(1)
window.show_all()
if multi:
button.grab_focus()
if multi or listRole:
before.grab_focus()
else:
view.grab_focus()
Gtk.main()
+14 -2
View File
@@ -35,6 +35,9 @@ def run_inside():
run_probe("box", flat=True, terminal=True, terminal_mode="prompt")
run_table_probe()
run_table_probe(multi=True)
run_table_probe(list_role=True)
run_table_probe(multi=True, list_role=True)
run_table_probe(list_role=True, speech=True)
if os.environ.get("CTHULHU_TEST_THUNAR") == "1":
run_thunar_probe()
@@ -71,10 +74,12 @@ def run_thunar_probe():
fixture.wait(timeout=3)
def run_table_probe(multi: bool = False, screen_lock: bool = False) -> None:
def run_table_probe(multi: bool = False, screen_lock: bool = False, list_role: bool = False, speech: bool = False) -> None:
fixture_env = dict(os.environ)
if multi:
fixture_env["CTHULHU_GTK_TABLE_MULTI"] = "1"
if list_role:
fixture_env["CTHULHU_GTK_TABLE_LIST"] = "1"
fixture = subprocess.Popen([sys.executable, str(Path(__file__).with_name("gtk_table.py"))], env=fixture_env)
try:
def find_window():
@@ -87,6 +92,8 @@ def run_table_probe(multi: bool = False, screen_lock: bool = False) -> None:
window = wait_for(find_window, "GTK table probe window missing")
subprocess.run(["xdotool", "windowfocus", window], check=True)
environment = dict(os.environ, CTHULHU_NATIVE_GUI_TABLE="1", CTHULHU_GUI_TABLE_WINDOW=window)
if list_role:
environment["CTHULHU_NATIVE_GUI_LIST_TABLE"] = "1"
if multi:
environment["CTHULHU_NATIVE_GUI_TABLE_MULTI"] = "1"
environment.setdefault("GOCACHE", "/tmp/cthulhu-cache")
@@ -95,8 +102,10 @@ def run_table_probe(multi: bool = False, screen_lock: bool = False) -> None:
test_name = "^TestNativeGUITableScreenLockRecovery$"
elif multi:
test_name = "^TestNativeGUITableMultiselectionFocus$"
elif list_role:
test_name = "^TestNativeGUIListTableSpeech$" if speech else "^TestNativeGUIListTableFocus$"
subprocess.run(
["go", "test", "./internal/atspi", "-run", test_name, "-count=1", "-timeout=20s"],
["go", "test", "./internal/app" if speech else "./internal/atspi", "-v", "-run", test_name, "-count=1", "-timeout=20s"],
cwd=Path(__file__).resolve().parents[1], env=environment, check=True, timeout=25,
)
finally:
@@ -165,6 +174,9 @@ def main() -> None:
if len(sys.argv) == 2 and sys.argv[1] == "--inside-table":
run_table_probe()
run_table_probe(multi=True)
run_table_probe(list_role=True)
run_table_probe(multi=True, list_role=True)
run_table_probe(list_role=True, speech=True)
return
with tempfile.TemporaryDirectory(prefix="cthulhu-atspi-"):
read_fd, write_fd = os.pipe()