diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-13 13:49:21 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-13 13:49:21 -0500 |
| commit | f537150ff3f67899d27a7f121bc302f61a307c1c (patch) | |
| tree | 325145d96c398575991d7be5006fdc5cb0f8895f /scripts | |
| parent | 25bde1f7e342cdf428dbb9468d0d14323be34db6 (diff) | |
| download | rulesets-f537150ff3f67899d27a7f121bc302f61a307c1c.tar.gz rulesets-f537150ff3f67899d27a7f121bc302f61a307c1c.zip | |
feat(hooks): title sessions host-project with a hyphen, no space
The SessionStart hook joined host and project with a space ("ratio rulesets"), which reads as two words in the claude.ai/code and mobile session lists. I changed the join to "$host-$project" ("ratio-rulesets") so the title is one token, and updated the three session-title-hook.bats expectations test-first.
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/tests/session-title-hook.bats | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/tests/session-title-hook.bats b/scripts/tests/session-title-hook.bats index 60b633d..5ce8b6a 100644 --- a/scripts/tests/session-title-hook.bats +++ b/scripts/tests/session-title-hook.bats @@ -1,6 +1,6 @@ #!/usr/bin/env bats # hooks/session-title.sh — SessionStart hook that titles the session -# "<host> <project>" (uname -n + git-toplevel basename, cwd basename outside +# "<host>-<project>" (uname -n + git-toplevel basename, cwd basename outside # a repo) so remote sessions are identifiable on web/mobile. It only sets a # title when the session doesn't have one yet: a /rename or an earlier run # must not be clobbered on resume. @@ -25,13 +25,13 @@ run_hook() { fi } -@test "titles host + repo basename inside a git repo" { +@test "titles host-repo basename inside a git repo" { git -C "$TMPDIR_T" init -q -b main mkdir -p "$TMPDIR_T/sub/dir" run run_hook "$TMPDIR_T" [ "$status" -eq 0 ] title=$(echo "$output" | jq -r '.hookSpecificOutput.sessionTitle') - [ "$title" = "$HOST $(basename "$TMPDIR_T")" ] + [ "$title" = "$HOST-$(basename "$TMPDIR_T")" ] } @test "uses the repo toplevel basename from a subdirectory" { @@ -40,7 +40,7 @@ run_hook() { run run_hook "$TMPDIR_T/sub/dir" [ "$status" -eq 0 ] title=$(echo "$output" | jq -r '.hookSpecificOutput.sessionTitle') - [ "$title" = "$HOST $(basename "$TMPDIR_T")" ] + [ "$title" = "$HOST-$(basename "$TMPDIR_T")" ] } @test "falls back to cwd basename outside a git repo" { @@ -48,7 +48,7 @@ run_hook() { run run_hook "$TMPDIR_T/chime" [ "$status" -eq 0 ] title=$(echo "$output" | jq -r '.hookSpecificOutput.sessionTitle') - [ "$title" = "$HOST chime" ] + [ "$title" = "$HOST-chime" ] } @test "emits valid SessionStart hookSpecificOutput" { |
