Skip to content

Commit c1eb24f

Browse files
MrFlounderclaude
andcommitted
fix(wip): restore to current workspace, show project-level WIPs by default
- `crab wip restore` now defaults to the current workspace instead of the original workspace the WIP was saved from. `--to <ws>` still overrides. - `crab wip ls` now always shows project-level WIPs by default. Use `--ws` to filter to the current workspace. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent fc37b80 commit c1eb24f

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

src/crabcode

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9554,17 +9554,15 @@ main() {
95549554
wip_save "$num" "$do_restart" "$custom_name"
95559555
;;
95569556
"ls"|"list")
9557-
# List is global by default, unless --ws flag or physically in workspace
9557+
# List is project-level by default, unless --ws flag
95589558
local dir_ws=$(detect_workspace_from_dir)
95599559
if [ "${3:-}" = "--ws" ] && [ -n "$num" ]; then
95609560
# Explicitly request workspace-specific list
95619561
wip_list "$num"
9562-
elif [ -n "$dir_ws" ] && [ "${3:-}" != "--all" ] && [ "${3:-}" != "-a" ]; then
9563-
# Physically in workspace directory, show workspace-specific
9562+
elif [ "${3:-}" = "--ws" ] && [ -n "$dir_ws" ]; then
95649563
wip_list "$dir_ws"
9565-
echo -e "${GRAY}Use 'crab wip ls --all' to see all workspaces${NC}"
95669564
else
9567-
# Global view (default when not physically in workspace)
9565+
# Project-level view (default)
95689566
wip_list_global
95699567
fi
95709568
;;
@@ -9597,6 +9595,11 @@ main() {
95979595
esac
95989596
done
95999597

9598+
# Default to current workspace if no --to specified
9599+
if [ -z "$target_ws" ] && [ -n "$num" ]; then
9600+
target_ws="$num"
9601+
fi
9602+
96009603
if [ -z "$index" ]; then
96019604
# Interactive restore
96029605
wip_restore_global "$target_ws" "$open_after"

0 commit comments

Comments
 (0)