Pass empty placement explicitly in bar replace

cmd_replace fed $PLACEMENT_FROM_SECTION/$PLACEMENT_FROM_INDEX to jq
without ever calling parse_placement, so they were always empty
strings that implied flag support which does not exist. Pass literal
empties with a comment stating replace resolves by widget id only.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
David Heinemeier Hansson
2026-07-02 22:14:33 -07:00
co-authored by Claude Fable 5
parent 54539b4a83
commit 03f7420d72
+4 -2
View File
@@ -756,11 +756,13 @@ cmd_replace() {
| .bar.layout[\$source.section][\$source.index].id = \$new
JQ
)
# resolve_source finds by widget id when no placement is given; replace
# takes no placement flags, so pass empty placement explicitly.
commit "$prog" \
--arg widgetId "$old" \
--arg new "$new" \
--arg fromSection "$PLACEMENT_FROM_SECTION" \
--arg fromIndex "$PLACEMENT_FROM_INDEX"
--arg fromSection "" \
--arg fromIndex ""
echo "Replaced $old with $new"
}