Skip to content

Conversation

@mvollmer mvollmer added the no-test For doc/workflow changes, or experiments which don't need a full CI run, label Dec 18, 2025
cockpituous

This comment was marked as outdated.

@mvollmer mvollmer force-pushed the dick branch 2 times, most recently from bdda053 to 2dd5f8c Compare December 19, 2025 10:20
cockpituous

This comment was marked as outdated.

cockpituous

This comment was marked as outdated.

cockpituous

This comment was marked as outdated.

cockpituous

This comment was marked as outdated.

cockpituous

This comment was marked as outdated.

@mvollmer mvollmer force-pushed the dick branch 4 times, most recently from b174978 to 39357ad Compare December 19, 2025 15:13
@mvollmer mvollmer marked this pull request as ready for review December 19, 2025 15:19
@mvollmer mvollmer removed the no-test For doc/workflow changes, or experiments which don't need a full CI run, label Dec 19, 2025
@mvollmer mvollmer force-pushed the dick branch 3 times, most recently from 454c423 to 18df4c6 Compare December 19, 2025 16:18
@mvollmer mvollmer force-pushed the dick branch 2 times, most recently from 0d4455c to bb59c19 Compare December 22, 2025 15:29
- value.remove(index)

If the current value is an array, remove the element at "index".
It is important to use this function instead of just "value.set()"
Copy link
Member

@tomasmatus tomasmatus Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a "bug" or performance loss to use set over all of the add, remove, etc?

I feel like using set and pass it a modified version of array is more of a "javascript" approach similarly how you use setState and give it a new array instead of in-place editing which is not right.

Or maybe not a JS approach but immediately obvious way how to handle this :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, I should have read the block bellow 👍🏻

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a "bug" or performance loss to use set over all of the add, remove, etc?

Yeah, it's not a bug, but very good practice to avoid spurious re-validation.

dlg.value("list").forEach(v => {
v.validate(vv => {
if (vv == ".")
return "No dots";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This added line is not executed by any test. Details

Comment on lines +286 to +287
await cockpit.spawn(["ls", "--no-such-option"], { err: "message" });
} else if (values.error == "random") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These 2 added lines are not executed by any test. Details

/>
{
// Calling "map" on a non-array should just do nothing.
dlg.value("text").map((v, i) => <span key={i}>{v.get()}</span>)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This added line is not executed by any test. Details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants