aboutsummaryrefslogtreecommitdiffstats
path: root/packaging
diff options
context:
space:
mode:
authoruser <user@clank>2026-08-13 22:07:45 +0200
committeruser <user@clank>2026-08-13 22:07:45 +0200
commita8ea4e888938e562885b1a0f009f5743939a879b (patch)
tree2ae5df21d4919cfe128830376b55dca814418496 /packaging
parentchecks: ignore __pycache__ (the up check imports a sibling check) (diff)
downloadsl0ppi-a8ea4e888938e562885b1a0f009f5743939a879b.tar.gz
sl0ppi-a8ea4e888938e562885b1a0f009f5743939a879b.tar.xz
sl0ppi-a8ea4e888938e562885b1a0f009f5743939a879b.zip
sl0p: keep a templated tab's purpose, so runtime tabs get a status bar
Clicking the bar's `+` made a tab with no status bar. The button only exposed it: pressing `n` in TAB mode did the same, in any `sl0ppi up` session. The chain: a generated layout had no default_tab_template, so a tab created at runtime had nothing to take a bar from. It had none because parse_tab_node_with_template read a tab node's name, cwd and focus but never its `purpose` -- so templating erased the purpose that IS identity here (`sl0ppi ls` finds project tabs by it), and the CLI worked around that by inlining the template into every tab instead of emitting it. Fixed at the root: a templated tab keeps its own purpose, and the CLI emits `default_tab_template` again. The generated layout also shrinks -- one copy of the bar's configuration instead of one per tab. The two properties trade off against each other, so sl0ppi-up-live.py now asserts both at once: `sl0ppi ls` still sees a tab per project, and every tab including one created at runtime has exactly one status bar. Confirmed by reverting each half separately: without the parser fix the tabs lose their purpose and `ls` shows "alpha —"; without the CLI change the runtime tab has zero bars, which is the reported bug. Two measurement traps cost an hour here and are now written down: counting bars by grepping dump-layout also counts the template and every swap layout ("4 bars for 3 tabs"), and list-panes stops reporting borderless plugin panes for a tab once a client has rendered it. Also in here, from the same session: - the split button check found buttons by searching for " + " on any row with a frame glyph, which matches the stack list's "+N more" once two panes sit side by side, and then reports the product broken. It now requires the frame corner the button is drawn against. - the checks killed their sessions but did not delete them, so each run left an "EXITED - attach to resurrect" entry: 35 had quietly filled the session picker. They now delete-session by name. - and the trap that cost the user their running client: I killed a bare `sl0ppij` because "there are no user sessions on this box". That was a guess, not evidence, and wrong. A check's processes always carry that run's own socket dir or `attach sl0ptest-...`; a bare `sl0ppij` with a cwd in the repo is a human's. Written into the handover next to the `pkill -f` trap, which is the same mistake in a different costume.
Diffstat (limited to 'packaging')
-rwxr-xr-xpackaging/checks/plugin-permissions-live.py4
-rwxr-xr-xpackaging/checks/sl0ppi-up-live.py56
-rwxr-xr-xpackaging/checks/split-button-live.py20
-rwxr-xr-xpackaging/checks/status-bar-live.py2
4 files changed, 78 insertions, 4 deletions
diff --git a/packaging/checks/plugin-permissions-live.py b/packaging/checks/plugin-permissions-live.py
index 7241504..3768ac6 100755
--- a/packaging/checks/plugin-permissions-live.py
+++ b/packaging/checks/plugin-permissions-live.py
@@ -170,6 +170,10 @@ def main():
subprocess.run(
[BIN, "-s", SESSION, "kill-session"], env=env, capture_output=True, text=True
)
+ # and delete it: a killed session stays in `list-sessions` as
+ # "EXITED - attach to resurrect", so a day of check runs silently fills
+ # the user's session picker with test sessions
+ subprocess.run([BIN, "delete-session", SESSION], env=env, capture_output=True, text=True)
try:
os.close(fd)
except OSError:
diff --git a/packaging/checks/sl0ppi-up-live.py b/packaging/checks/sl0ppi-up-live.py
index 82b84b9..f3739ad 100755
--- a/packaging/checks/sl0ppi-up-live.py
+++ b/packaging/checks/sl0ppi-up-live.py
@@ -156,6 +156,60 @@ def main():
# identity: the fork hangs a tab's purpose on its root layout, and the
# CLI inlines the template precisely so templating cannot eat it
+ # Identity: `sl0ppi ls` finds project tabs by the purpose on each tab.
+ # Emitting a tab template used to erase that -- which is why the CLI
+ # inlined instead, at the cost of runtime tabs having no bar. Both
+ # properties have to hold at once, so both are checked here.
+ listing = subprocess.run(
+ ["bun", CLI, "ls", "--root", root], env=env, capture_output=True, text=True, timeout=60
+ ).stdout
+ print("sl0ppi ls:", " | ".join(line.strip() for line in listing.strip().splitlines()))
+ for project in PROJECTS:
+ if project not in listing:
+ failures.append(f"`sl0ppi ls` does not see project {project!r}")
+ # a project with a tab reads "alpha tab 0 1 pane(s) ...";
+ # one without reads "alpha —"
+ if listing.count("tab ") < len(PROJECTS):
+ failures.append(f"`sl0ppi ls` does not see a tab per project: {listing.strip()!r}")
+ layout_dump = subprocess.run(
+ [BIN, "-s", SESSION, "action", "dump-layout"], env=env, capture_output=True, text=True
+ ).stdout
+ for project in PROJECTS:
+ if f'purpose="project:{project}"' not in layout_dump:
+ failures.append(f"tab for {project!r} lost its purpose= (identity is gone)")
+
+ # A tab made at RUNTIME must come up with a status bar too -- exactly
+ # one. This is what the bar's `+` button does and what the `n` keybinding
+ # does; while the CLI inlined its tab template instead of emitting one,
+ # both produced a bare tab, because there was no template for the new tab
+ # to take a bar from.
+ #
+ # Counted per tab from list-panes rather than by grepping dump-layout:
+ # that dump also contains the template itself and every swap layout, so
+ # substring counting there reports bars that are definitions, not panes.
+ #
+ # BEFORE any client attaches, too: list-panes stops reporting borderless
+ # plugin panes for a tab a client has rendered, which reads exactly like
+ # the bar being missing.
+ subprocess.run([BIN, "-s", SESSION, "action", "new-tab"], env=env, capture_output=True)
+ time.sleep(3)
+ per_tab = {}
+ panes = subprocess.run(
+ [BIN, "-s", SESSION, "action", "list-panes", "--json"],
+ env=env, capture_output=True, text=True, timeout=60,
+ ).stdout
+ for pane in json.loads(panes or "[]"):
+ if pane.get("is_suppressed"):
+ continue
+ tab = pane.get("tab_name") or pane.get("tab_position")
+ per_tab.setdefault(tab, 0)
+ if "zjstatus" in (pane.get("plugin_url") or ""):
+ per_tab[tab] += 1
+ print(f"status bars per tab after new-tab: {per_tab}")
+ for tab, count in per_tab.items():
+ if count != 1:
+ failures.append(f"tab {tab!r} has {count} status bars, expected exactly 1")
+
# The bar has to survive a client attaching, a resize, and auto_layout
# swapping the tab around. Read from the SCREEN: `list-panes` stops
# reporting the borderless plugin pane once a client is attached, which
@@ -192,6 +246,8 @@ def main():
return failures
finally:
subprocess.run([BIN, "-s", SESSION, "kill-session"], env=env, capture_output=True)
+ # delete too: killed sessions linger in `list-sessions` as resurrectable
+ subprocess.run([BIN, "delete-session", SESSION], env=env, capture_output=True)
ps = subprocess.run(["ps", "-eo", "pid,comm,args"], capture_output=True, text=True).stdout
for line in ps.splitlines():
fields = line.split(None, 2)
diff --git a/packaging/checks/split-button-live.py b/packaging/checks/split-button-live.py
index cb732e1..b22d372 100755
--- a/packaging/checks/split-button-live.py
+++ b/packaging/checks/split-button-live.py
@@ -210,17 +210,25 @@ def find_button(rows):
def find_buttons(rows):
"""Every drawn split button: (row, 0-based column of the `+`).
- A frame row can hold more than one, once panes sit side by side."""
+ A frame row can hold more than one, once panes sit side by side.
+
+ Identified by the CORNER it sits against: the button is the three columns
+ immediately left of a pane's top-right corner (`split_button_columns`). A
+ bare " + " search also matches the stack list's "+N more" and the short
+ multi-client indication, and those share a screen row with a real frame as
+ soon as two panes sit side by side -- which then reads as a button that does
+ nothing when clicked, i.e. as this feature's own bug.
+ """
found = []
for y, line in enumerate(rows):
- if "╭" not in line and "┌" not in line:
- continue
start = 0
while True:
at = line.find(" + ", start)
if at < 0:
break
- found.append((y, at + 1))
+ corner = line[at + 3] if at + 3 < len(line) else ""
+ if corner in ("╮", "┐"): # rounded / square top-right
+ found.append((y, at + 1))
start = at + 1
return found
@@ -423,6 +431,10 @@ def main():
subprocess.run(
[BIN, "-s", SESSION, "kill-session"], env=env, capture_output=True, text=True
)
+ # and delete it: a killed session stays in `list-sessions` as
+ # "EXITED - attach to resurrect", so a day of check runs silently fills
+ # the user's session picker with test sessions
+ subprocess.run([BIN, "delete-session", SESSION], env=env, capture_output=True, text=True)
# kill-session does not always take the server with it, and a leftover
# test session is how a "MY FOCUS" bug report gets filed against nobody.
#
diff --git a/packaging/checks/status-bar-live.py b/packaging/checks/status-bar-live.py
index e5ad8af..e1ef226 100755
--- a/packaging/checks/status-bar-live.py
+++ b/packaging/checks/status-bar-live.py
@@ -341,6 +341,8 @@ def main():
return failures
finally:
subprocess.run([BIN, "-s", SESSION, "kill-session"], env=env, capture_output=True)
+ # delete too: killed sessions linger in `list-sessions` as resurrectable
+ subprocess.run([BIN, "delete-session", SESSION], env=env, capture_output=True)
try:
os.close(fd)
except OSError: