Skip to content

Commit 11d334c

Browse files
Rename TUI app files: drop 'demo', use 'app' suffix; rename tui_common to common
data_structures/tui/: stack_demo_tui.py → stack_app.py queue_demo_tui.py → queue_app.py deque_demo_tui.py → deque_app.py list_demo_tui.py → list_app.py singly_linked_list_tui.py → singly_linked_list_app.py doubly_linked_list_tui.py → doubly_linked_list_app.py tui_common.py → common.py Tests renamed to match; Makefile run-*-tui → run-*-app, test-*-tui → test-*-app. Internal imports updated; docs and AGENTS.md paths updated. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 3b7a8ee commit 11d334c

23 files changed

Lines changed: 71 additions & 71 deletions

‎AGENTS.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Several data structures have an interactive terminal UI built with [Textual](htt
3838

3939
### Base-class TUIs (`tui_common.py`)
4040

41-
All other linear-structure TUIs inherit from `BaseLinearStructureTUI` in `data_structures/tui/tui_common.py`. The base class provides:
41+
All other linear-structure TUIs inherit from `BaseLinearStructureTUI` in `data_structures/tui/common.py`. The base class provides:
4242

4343
- the Textual widget layout (`LinearPanel`, `RichLog`, `Input`, `Header`, `Footer`)
4444
- the shared command dispatcher (`_dispatch`) covering `/random`, `/clear`, `/save`, `/load`, `/undo`, `/redo`, `/show`, `/type`, scroll commands, and `/help`

‎Makefile‎

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ PYTEST = .venv/bin/pytest
55
RUN_ALIASES = run-bst run-deque run-dict run-dll run-graph run-heap \
66
run-list run-networkx run-queue run-set run-sll run-stack run-trie
77
TEST_ALIASES = test-bst test-deque test-dict test-dll test-graph test-heap \
8-
test-list test-networkx test-queue test-set test-sll test-stack test-stack-tui \
9-
test-queue-tui test-deque-tui test-list-tui test-sll-tui test-dll-tui test-trie
8+
test-list test-networkx test-queue test-set test-sll test-stack test-stack-app \
9+
test-queue-app test-deque-app test-list-app test-sll-app test-dll-app test-trie
1010

1111
.PHONY: install test $(RUN_ALIASES) $(TEST_ALIASES) \
12-
run-stack-tui run-queue-tui run-deque-tui run-list-tui run-sll-tui run-dll-tui
12+
run-stack-app run-queue-app run-deque-app run-list-app run-sll-app run-dll-app
1313

1414
# Create the virtual environment
1515
.venv:
@@ -38,24 +38,24 @@ run-sll: run-singly_linked_list
3838
run-stack: run-stack_demo
3939
run-trie: run-trie_demo
4040

41-
# TUI run targets (data_structures.tui.*)
42-
run-stack-tui:
43-
$(PYTHON) -m data_structures.tui.stack_demo_tui
41+
# App run targets (data_structures.tui.*)
42+
run-stack-app:
43+
$(PYTHON) -m data_structures.tui.stack_app
4444

45-
run-queue-tui:
46-
$(PYTHON) -m data_structures.tui.queue_demo_tui
45+
run-queue-app:
46+
$(PYTHON) -m data_structures.tui.queue_app
4747

48-
run-deque-tui:
49-
$(PYTHON) -m data_structures.tui.deque_demo_tui
48+
run-deque-app:
49+
$(PYTHON) -m data_structures.tui.deque_app
5050

51-
run-list-tui:
52-
$(PYTHON) -m data_structures.tui.list_demo_tui
51+
run-list-app:
52+
$(PYTHON) -m data_structures.tui.list_app
5353

54-
run-sll-tui:
55-
$(PYTHON) -m data_structures.tui.singly_linked_list_tui
54+
run-sll-app:
55+
$(PYTHON) -m data_structures.tui.singly_linked_list_app
5656

57-
run-dll-tui:
58-
$(PYTHON) -m data_structures.tui.doubly_linked_list_tui
57+
run-dll-app:
58+
$(PYTHON) -m data_structures.tui.doubly_linked_list_app
5959

6060
# Test aliases
6161
test-bst: test-binary_search_tree_demo
@@ -67,15 +67,15 @@ test-heap: test-heap_demo
6767
test-list: test-list_demo
6868
test-networkx: test-networkx_graph_demo
6969
test-queue: test-queue_demo
70-
test-queue-tui: test-queue_demo_tui
70+
test-queue-app: test-queue_app
7171
test-set: test-set_demo
7272
test-sll: test-singly_linked_list
73-
test-sll-tui: test-singly_linked_list_tui
73+
test-sll-app: test-singly_linked_list_app
7474
test-stack: test-stack_demo
75-
test-stack-tui: test-stack_demo_tui
76-
test-deque-tui: test-deque_demo_tui
77-
test-list-tui: test-list_demo_tui
78-
test-dll-tui: test-doubly_linked_list_tui
75+
test-stack-app: test-stack_app
76+
test-deque-app: test-deque_app
77+
test-list-app: test-list_app
78+
test-dll-app: test-doubly_linked_list_app
7979
test-trie: test-trie_demo
8080

8181
# Run a single non-TUI demo module: make run-<name>
@@ -93,13 +93,13 @@ run-%:
9393

9494
# Run a single test module: make test-<name>
9595
#
96-
# Valid names (same list as above, plus tui variants):
96+
# Valid names (same list as above, plus app variants):
9797
# binary_search_tree_demo deque_demo dictionary_demo
9898
# doubly_linked_list graph_demo heap_demo
9999
# list_demo networkx_graph_demo queue_demo
100-
# queue_demo_tui deque_demo_tui list_demo_tui
101-
# singly_linked_list singly_linked_list_tui
102-
# doubly_linked_list_tui set_demo stack_demo
103-
# stack_demo_tui trie_demo
100+
# queue_app deque_app list_app
101+
# singly_linked_list singly_linked_list_app
102+
# doubly_linked_list_app set_demo stack_demo
103+
# stack_app trie_demo
104104
test-%:
105105
$(PYTEST) tests/test_$*.py -v

‎README.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ The repo now includes interactive Textual TUIs for:
3434
- `singly_linked_list_tui`
3535
- `doubly_linked_list_tui`
3636

37-
Use targets such as `make run-stack-tui`, `make run-queue-tui`, or `make run-dll-tui`. Other demo modules do not yet have a `__main__` block, so their `run-*` targets verify a clean import but produce no output.
37+
Use targets such as `make run-stack-app`, `make run-queue-app`, or `make run-dll-app`. Other demo modules do not yet have a `__main__` block, so their `run-*` targets verify a clean import but produce no output.
3838

3939
For walkthroughs of the interactive apps, see:
4040
- `docs/StackTUI.md`
@@ -66,13 +66,13 @@ Valid `<name>` values (short alias or full name both work):
6666
| `list` | `list_demo` | `data_structures/list_demo.py` | `tests/test_list_demo.py` |
6767
| `networkx` | `networkx_graph_demo` | `data_structures/networkx_graph_demo.py` | `tests/test_networkx_graph_demo.py` |
6868
| `queue` | `queue_demo` | `data_structures/queue_demo.py` | `tests/test_queue_demo.py` |
69-
| `queue-tui` | `queue_demo_tui` | `data_structures/tui/queue_demo_tui.py` | `tests/test_queue_demo_tui.py` |
69+
| `queue-tui` | `queue_demo_tui` | `data_structures/tui/queue_app.py` | `tests/test_queue_demo_tui.py` |
7070
| `set` | `set_demo` | `data_structures/set_demo.py` | `tests/test_set_demo.py` |
7171
| `sll` | `singly_linked_list` | `data_structures/singly_linked_list.py` | `tests/test_singly_linked_list.py` |
72-
| `sll-tui` | `singly_linked_list_tui` | `data_structures/tui/singly_linked_list_tui.py` | `tests/test_singly_linked_list_tui.py` |
72+
| `sll-tui` | `singly_linked_list_tui` | `data_structures/tui/singly_linked_list_app.py` | `tests/test_singly_linked_list_tui.py` |
7373
| `stack` | `stack_demo` | `data_structures/stack_demo.py` | `tests/test_stack_demo.py` |
74-
| `stack-tui` | `stack_demo_tui` | `data_structures/tui/stack_demo_tui.py` | `tests/test_stack_demo_tui.py` |
75-
| `deque-tui` | `deque_demo_tui` | `data_structures/tui/deque_demo_tui.py` | `tests/test_deque_demo_tui.py` |
76-
| `list-tui` | `list_demo_tui` | `data_structures/tui/list_demo_tui.py` | `tests/test_list_demo_tui.py` |
77-
| `dll-tui` | `doubly_linked_list_tui` | `data_structures/tui/doubly_linked_list_tui.py` | `tests/test_doubly_linked_list_tui.py` |
74+
| `stack-tui` | `stack_demo_tui` | `data_structures/tui/stack_app.py` | `tests/test_stack_demo_tui.py` |
75+
| `deque-tui` | `deque_demo_tui` | `data_structures/tui/deque_app.py` | `tests/test_deque_demo_tui.py` |
76+
| `list-tui` | `list_demo_tui` | `data_structures/tui/list_app.py` | `tests/test_list_demo_tui.py` |
77+
| `dll-tui` | `doubly_linked_list_tui` | `data_structures/tui/doubly_linked_list_app.py` | `tests/test_doubly_linked_list_tui.py` |
7878
| `trie` | `trie_demo` | `data_structures/trie_demo.py` | `tests/test_trie_demo.py` |
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from textual.widgets import Footer, Header, Input, RichLog
55

66
from data_structures.deque_demo import DequeDemo
7-
from .tui_common import (
7+
from .common import (
88
BaseLinearStructureTUI,
99
LinearPanel,
1010
build_linear_view,

data_structures/tui/doubly_linked_list_tui.py renamed to data_structures/tui/doubly_linked_list_app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from textual.widgets import Footer, Header, Input, RichLog, Static
55

66
from data_structures.doubly_linked_list import DoublyLinkedList
7-
from .tui_common import (
7+
from .common import (
88
BaseLinearStructureTUI,
99
build_linear_parser,
1010
format_display_value,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from textual.widgets import RichLog
44

55
from data_structures.list_demo import ListDemo
6-
from .tui_common import (
6+
from .common import (
77
BaseLinearStructureTUI,
88
build_linear_parser,
99
format_value_batch,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from textual.widgets import RichLog
22

33
from data_structures.queue_demo import QueueDemo
4-
from .tui_common import (
4+
from .common import (
55
BaseLinearStructureTUI,
66
build_linear_parser,
77
format_value_batch,

data_structures/tui/singly_linked_list_tui.py renamed to data_structures/tui/singly_linked_list_app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from textual.widgets import Footer, Header, Input, RichLog, Static
55

66
from data_structures.singly_linked_list import SinglyLinkedList
7-
from .tui_common import (
7+
from .common import (
88
BaseLinearStructureTUI,
99
build_linear_parser,
1010
format_display_value,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from textual.app import ComposeResult
66
from textual.widgets import Footer, Header, Input, RichLog, Static
77

8-
from .tui_common import (
8+
from .common import (
99
BaseLinearStructureTUI,
1010
build_linear_parser,
1111
build_random_values,

0 commit comments

Comments
 (0)