feat: v0.12.0 Settings window, per-session Remote Control, delete conversations
- Settings (⋯ → Settings…, palette): theme, terminal text size, interface size, notifications, Remote Control & privacy. The ⋯ menu shrinks. - Remote Control per session: registry choice > Settings default > DEVDESK_REMOTE_CONTROL. Switching an idle session restarts its Claude on the same conversation; busy sessions change at the next start. rc_active comes from the running process; RC tag on sessions. - --delete-convo: remove a conversation's local transcript and subagent files; refused while in use. Delete… in Search past conversations. Closes #61 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WHRLCCdXYm41Qx5kNhehaP
This commit is contained in:
+71
-1
@@ -25,7 +25,9 @@ setup() {
|
||||
#!/bin/bash
|
||||
printf '%s\n' "$*" >>"$FAKE_LOG/$DEVDESK_SESSION"
|
||||
[ -z "${FAKE_EXIT:-}" ] || exit "$FAKE_EXIT"
|
||||
exec sleep 300
|
||||
# Keeps its arguments in /proc/PID/cmdline (Remote Control is read from there)
|
||||
# and ends on SIGTERM, like Claude.
|
||||
exec bash -c 'sleep 300 & wait' fake-claude "$@"
|
||||
EOF
|
||||
chmod +x "$CLAUDE_BIN"
|
||||
}
|
||||
@@ -1338,3 +1340,71 @@ last_json() { tail -n1 <<<"$output"; }
|
||||
run devdesk attach --fs-grep alpha - ''
|
||||
[ "$status" -ne 0 ]
|
||||
}
|
||||
|
||||
@test "Remote Control is per session: Settings default, live state, restart when idle (#61)" {
|
||||
start_server
|
||||
devdesk new alpha
|
||||
run claude_args alpha
|
||||
[[ $output != *remote-control* ]]
|
||||
run devdesk attach --list
|
||||
[ "$(jq -c '[.remote_control_default, (.sessions[] | select(.name=="alpha") | .remote_control, .rc_active)]' <<<"$output")" = '[false,false,false]' ]
|
||||
|
||||
# Default on for new sessions
|
||||
run devdesk attach --settings remote-control-default on
|
||||
[ "$(jq -r .remote_control_default <<<"$output")" = true ]
|
||||
devdesk new beta
|
||||
run claude_args beta
|
||||
[[ $output == *"--remote-control devdesk-beta"* ]]
|
||||
for _ in $(seq 1 30); do
|
||||
[ "$(devdesk attach --list | jq -r '.sessions[] | select(.name=="beta") | .rc_active')" = true ] && break
|
||||
sleep 0.1
|
||||
done
|
||||
[ "$(devdesk attach --list | jq -r '.sessions[] | select(.name=="beta") | .rc_active')" = true ]
|
||||
|
||||
# alpha (idle): switching restarts Claude with the flag, no exit menu
|
||||
run devdesk attach --remote-control alpha on
|
||||
[ "$(jq -r .applied <<<"$output")" = now ]
|
||||
for _ in $(seq 1 50); do [ "$(wc -l <"$FAKE_LOG/alpha")" -ge 2 ] && break; sleep 0.1; done
|
||||
[[ "$(tail -n1 "$FAKE_LOG/alpha")" == *"--remote-control devdesk-alpha"* ]]
|
||||
[ ! -e "$DEVDESK_STATE_DIR/restart/alpha" ]
|
||||
|
||||
# working: saved for the next start, Claude untouched
|
||||
mkdir -p "$DEVDESK_STATE_DIR/state"
|
||||
printf '{"state":"working","since":1}' >"$DEVDESK_STATE_DIR/state/alpha.json"
|
||||
run devdesk attach --remote-control alpha off
|
||||
[ "$(jq -r .applied <<<"$output")" = next-start ]
|
||||
sleep 0.5
|
||||
[ "$(wc -l <"$FAKE_LOG/alpha")" -eq 2 ]
|
||||
[ "$(jq -r .sessions.alpha.remote_control "$DEVDESK_STATE_DIR/registry.json")" = false ]
|
||||
# an explicit off beats the default on
|
||||
[ "$(devdesk attach --list | jq -r '.sessions[] | select(.name=="alpha") | .remote_control')" = false ]
|
||||
|
||||
run devdesk attach --remote-control nope on
|
||||
[ "$status" -ne 0 ]
|
||||
run devdesk attach --remote-control alpha maybe
|
||||
[ "$status" -ne 0 ]
|
||||
}
|
||||
|
||||
@test "delete-convo removes a conversation's local files, never one in use (#61)" {
|
||||
start_server
|
||||
export CLAUDE_CONFIG_DIR="$TMP/claude"
|
||||
id=11111111-2222-3333-4444-555555555555
|
||||
other=99999999-2222-3333-4444-555555555555
|
||||
d="$CLAUDE_CONFIG_DIR/projects/-x"
|
||||
mkdir -p "$d/$id/subagents" "$d/$other"
|
||||
echo '{}' >"$d/$id.jsonl" && echo '{}' >"$d/$id/subagents/a.jsonl" && echo '{}' >"$d/$other.jsonl"
|
||||
devdesk new alpha
|
||||
jq --arg id "$id" '.sessions.alpha.claude_session_id = $id | .sessions.dormant = {dir: "/tmp", claude_session_id: $id}' \
|
||||
"$DEVDESK_STATE_DIR/registry.json" >"$TMP/r" && mv "$TMP/r" "$DEVDESK_STATE_DIR/registry.json"
|
||||
run devdesk attach --delete-convo "$id"
|
||||
[ "$status" -ne 0 ] && [[ $output == *"session alpha is using"* ]] && [ -f "$d/$id.jsonl" ]
|
||||
devdesk end alpha
|
||||
run devdesk attach --delete-convo "$id"
|
||||
[ "$status" -eq 0 ]
|
||||
[ ! -e "$d/$id.jsonl" ] && [ ! -e "$d/$id" ] && [ -f "$d/$other.jsonl" ]
|
||||
[ "$(jq -r '.sessions.dormant.claude_session_id // "none"' "$DEVDESK_STATE_DIR/registry.json")" = none ]
|
||||
run devdesk attach --delete-convo "$id"
|
||||
[ "$status" -ne 0 ]
|
||||
run devdesk attach --delete-convo "../../etc/passwd"
|
||||
[ "$status" -ne 0 ]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user