Repository navigation
fix(command sender): treat Ignore Range Checks as hazardous and restore hazardous highlighting #4059
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(command sender): treat Ignore Range Checks as hazardous and restore hazardous highlighting #4059
Changes from all commits
f3fbace
1712100
461ea49
c254163
e45dc92
4930586
6fc802d
b52ae86
7b9c382
608835b
4469bb8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,7 +18,7 @@ | |
| ref="targetPacketChooser" | ||
| :initial-target-name="targetName" | ||
| :initial-packet-name="commandName" | ||
| :disabled="sendDisabled" | ||
| :disabled="sendDisabled || commandLoading" | ||
| :disable-button-text="readOnly ? 'Viewers cannot send commands' : null" | ||
| :button-text="showCommandButton ? 'Send' : null" | ||
| :show-queue-select="showQueueSelect" | ||
|
|
@@ -176,6 +176,9 @@ export default { | |
| targetName: '', | ||
| commandName: '', | ||
| commandDescription: '', | ||
| // Keep Send disabled until the selected command's parameters and | ||
| // descriptions are loaded so we never send with stale values | ||
| commandLoading: false, | ||
| ignoredParams: [], | ||
| computedRows: [], | ||
| reservedItemNames: [ | ||
|
|
@@ -250,6 +253,7 @@ export default { | |
| this.computedRows = [] | ||
| this.hazardousParameters = {} | ||
| if (this.targetName && this.commandName) { | ||
| this.commandLoading = true | ||
| this.api | ||
| .get_target(this.targetName) | ||
| .then( | ||
|
|
@@ -263,6 +267,7 @@ export default { | |
| ) | ||
| .then( | ||
| (command) => { | ||
| this.commandLoading = false | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
set -euo pipefail
rg -n -C 6 'add-item|button-text|:disabled|buildCmd|getCmdString|populateParametersFromParsed|parsedParameters' \
openc3-cosmos-init/plugins/packages/openc3-vue-common/src/components/CommandEditor.vue \
openc3-cosmos-init/plugins/packages/openc3-vue-common/src/components/TargetPacketItemChooser.vue \
openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdsender/src/tools/CommandSender/CommandSender.vueRepository: OpenC3/cosmos Length of output: 29667 🏁 Script executed: set -euo pipefail
python3 - <<'PY'
from pathlib import Path
files = [
Path("openc3-cosmos-init/plugins/packages/openc3-vue-common/src/components/TargetPacketItemChooser.vue"),
Path("openc3-cosmos-init/plugins/packages/openc3-vue-common/src/components/CommandEditor.vue"),
Path("openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdsender/src/tools/CommandSender/CommandSender.vue"),
]
ranges = {
files[0]: [(1, 220)],
files[1]: [(160, 285), (315, 375), (450, 510)],
files[2]: [(500, 565)],
}
for path in files:
lines = path.read_text().splitlines()
print(f"===== {path} =====")
for lo, hi in ranges[path]:
print(f"--- lines {lo}-{hi} ---")
for n in range(lo, min(hi, len(lines)) + 1):
print(f"{n}: {lines[n-1]}")
PY
printf '%s\n' '===== history/editor references ====='
rg -n -F --glob '*.vue' -e 'getCmdString' -e 'command-loaded' -e 'populateParametersFromParsed' -e 'parsedParameters' \
openc3-cosmos-init/plugins/packages | head -200Repository: OpenC3/cosmos Length of output: 23319 🏁 Script executed: set -euo pipefail
python3 - <<'PY'
from pathlib import Path
path = Path("openc3-cosmos-init/plugins/packages/openc3-vue-common/src/components/TargetPacketItemChooser.vue")
lines = path.read_text().splitlines()
for lo, hi in [(220, 430)]:
print(f"===== {path}:{lo}-{hi} =====")
for n in range(lo, min(hi, len(lines)) + 1):
print(f"{n}: {lines[n-1]}")
path = Path("openc3-cosmos-init/plugins/packages/openc3-vue-common/src/components/CommandEditor.vue")
lines = path.read_text().splitlines()
print(f"===== {path}:100-165 =====")
for n in range(100, min(165, len(lines)) + 1):
print(f"{n}: {lines[n-1]}")
PYRepository: OpenC3/cosmos Length of output: 8773 Keep Send disabled until history values are applied.
Clear 🐛 Suggested fix- this.commandLoading = false
if (command) {
...
} else {
+ this.commandLoading = false
this.$emit('command-loaded', null)
...
) {
+ this.commandLoading = false
return
}
...
this.computedRows.forEach((row) => {
...
}
})
+ this.commandLoading = false
}, 100)🤖 Prompt for AI Agents |
||
| if (command) { | ||
| // Identify length fields that are auto-managed by variable_bit_size arrays | ||
| // These should be shown but disabled - they will be set when the array is written | ||
|
|
@@ -343,6 +348,7 @@ export default { | |
| } | ||
| }, | ||
| (error) => { | ||
| this.commandLoading = false | ||
| console.error('Error getting command parameters:', error) | ||
| this.$emit('command-loaded', null) | ||
| }, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.