-
-
Notifications
You must be signed in to change notification settings - Fork 2
feat(gui): add a sockets tool to the Tools tab #200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
cc8cbbd
0bfe57f
6278a00
57f3d91
00a10bf
88c104e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -132,11 +132,29 @@ | |
| # enough for the longest of the three words in the three languages (English | ||
| # "Warning", bold) so the check names after it line up. The render check measures | ||
| # it: a word that outgrows it is reported as clipped. | ||
| # | ||
| # The rest are the least a TABLE column may shrink to (``SortableTree(min_chars=)``, | ||
| # which widens for a longer header): `search` is the connection table's search box | ||
| # (24); `address` fits an IPv4 address with room, the connection table's remote-IP | ||
| # column (18) - an IPv6 one scrolls, the table is horizontal; `port`, `proto` and | ||
| # `process` are that table's own minimums (6, 5, 16); `tcp_state` fits the longest | ||
| # state name, SYN_RECEIVED (12). | ||
| CHARS = { | ||
| "help_button": 2, | ||
| "value": 26, | ||
| "pid": 10, | ||
| "state": 8, | ||
| "search": 24, | ||
| "address": 18, | ||
| "port": 6, | ||
| "proto": 5, | ||
| "process": 16, | ||
| "tcp_state": 12, | ||
|
Comment on lines
+147
to
+152
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
# Find the connection table's own width/height literals that these tokens duplicate.
fd -t f conns.py beantester/gui/pages --exec rg -n -C2 'min_chars|MIN_CHARS|width=|height=|\b(24|18|16)\b' {}Repository: donislawdev/BeanNetworkTester Length of output: 1726 🏁 Script executed: #!/bin/bash
set -e
printf '%s\n' '--- theme.py ---'
sed -n '120,170p' beantester/gui/theme.py
printf '%s\n' '--- conns.py imports and constants ---'
sed -n '1,115p' beantester/gui/pages/conns.py
printf '%s\n' '--- conns.py table construction ---'
sed -n '135,212p' beantester/gui/pages/conns.py
printf '%s\n' '--- conns.py token references ---'
rg -n -C2 'MIN_CHARS|CHARS|ROWS|width=24|height=18' beantester/gui/pages/conns.py
printf '%s\n' '--- changed-file diff ---'
git diff --unified=20 b78f1f9ca1810b946e6809d9a6d4b69ef4986502 57f3d91f6e4165ee0b8d6ed3772b66b55c44098c -- beantester/gui/theme.py beantester/gui/pages/conns.pyRepository: donislawdev/BeanNetworkTester Length of output: 27752 Make the connection table use the shared tokens.
Suggested fix-from ..theme import CONN_COLORS, style_menu
+from ..theme import CHARS, CONN_COLORS, ROWS, style_menu
...
-MIN_CHARS = {"proc": 16, "pid": 7, "proto": 5, "remote_ip": 18, "remote_port": 6,
- "local_port": 6, "packets": 7, "scoped": 7, "dropped": 8, "down": 8,
+MIN_CHARS = {"proc": CHARS["process"], "pid": 7, "proto": CHARS["proto"],
+ "remote_ip": CHARS["address"], "remote_port": CHARS["port"],
+ "local_port": CHARS["port"], "packets": 7, "scoped": 7, "dropped": 8, "down": 8,
...
-entry = ttk.Entry(top, textvariable=self.search_var, width=24)
+entry = ttk.Entry(top, textvariable=self.search_var, width=CHARS["search"])
...
- on_sort=self._on_sort, height=18,
+ on_sort=self._on_sort, height=ROWS["table"],🤖 Prompt for AI AgentsSource: Path instructions |
||
| } | ||
|
|
||
| # How many rows a table shows before it scrolls: the connection table's 18. | ||
| ROWS = { | ||
| "table": 18, | ||
| } | ||
|
|
||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
Annotate the new public action and menu APIs. The new functions and methods omit the parameter and return types required for public Python functions.
beantester/gui/field_actions.py#L44-L44: annotateblock_ip_address, including its accepted address type.beantester/gui/field_actions.py#L50-L50: annotateleave_process_alone, including its accepted name type.beantester/gui/widgets/sortable_tree.py#L566-L566: annotatebind_row_menuand its callback contract.beantester/gui/widgets/sortable_tree.py#L597-L597: annotaterow_menu_at_pointer.beantester/gui/widgets/sortable_tree.py#L611-L611: annotaterow_menu_from_keyboard.As per path instructions: "Type hints on public functions."
📍 Affects 2 files
beantester/gui/field_actions.py#L44-L44(this comment)beantester/gui/field_actions.py#L50-L50beantester/gui/widgets/sortable_tree.py#L566-L566beantester/gui/widgets/sortable_tree.py#L597-L597beantester/gui/widgets/sortable_tree.py#L611-L611🤖 Prompt for AI Agents
Source: Path instructions