start-os
start-os copied to clipboard
[feat]: List of objects not displaying properly in config
Prerequisites
- [X] I have searched for existing issues that already report this problem, without success.
EmbassyOS Version
72cb451f5a4be02ad651e2c0bf4973dd8f36f9b1
Device
Laptop/Desktop
Device OS
Linux
Device OS Version
Ubuntu 20.04
Browser
Firefox
Browser Version
98.0.1
Current Behavior
This config spec:
addnode:
name: Add Nodes
description: Add addresses of nodes to connect to.
type: list
subtype: object
range: "[0,*)"
default: []
spec:
type: object
nullable: false
name: "Peer"
description: "Peer to connect to"
spec:
hostname:
type: string
nullable: false
name: "Hostname"
description: "Domain or IP address of bitcoin peer"
masked: true
pattern: "(^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$)|((^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$)|(^[a-z2-7]{16}\\.onion$)|(^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$))"
pattern-description: Must be either a domain name, or an IPv4 or IPv6 address. Do not include protocol scheme (eg 'http://') or port.
port:
type: number
# nullable: false
nullable: true
name: "Port"
description: "Port that peer is listening on for inbound p2p connections"
# default: 8333
range: "[0,65535]"
integral: true
Renders like this:

Expected Behavior
The user should be able to see the port field. The port is inaccessible no matter what I do.
Steps to Reproduce
- Package s9pk with config spec as above
- Go to configure it
- Cannot access second field in object, when object is nested inside a list.
Anything else?
This is blocking https://github.com/Start9Labs/bitcoind-wrapper/issues/53
Looking at the posted config spec, there are some elements that are incorrect for lists of objects. See a working implementation of this type here. I recognize that the documentation for this type is wrong and will correct.
Does the issue persist with those adjustments to the config spec?
Updated to try:
addnode:
type: list
name: Add Nodes
description: Add addresses of nodes to connect to.
default: []
range: "[0,*)"
# subtype: string
subtype: object
spec:
unique-by: hostname
display-as: "{{hostname}}"
spec:
hostname:
type: string
nullable: false
name: "Hostname"
description: "Domain or IP address of bitcoin peer"
masked: true
pattern: "(^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(:[0-9]{1,5})?$)|((^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(:[0-9]{1,5})?$)|(^[a-z2-7]{16}\\.onion(:[0-9]{1,5})?$)|(^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9](:[0-9]{1,5})?$))"
pattern-description: Must be either a domain name, or an IPv4 or IPv6 address. Do not include protocol scheme (eg 'http://') or port.
port:
type: number
# nullable: false
nullable: true
name: "Port"
description: "Port that peer is listening on for inbound p2p connections"
# default: 8333
range: "[0,65535]"
integral: true
Not seeing any meaningful difference:

Actually now the hostname is covered up, too.
That makes no sense. What's in the console?
No errors in the console

@MattDHill more info: the full config spec type for this nested configuration is actually an object of objects which has a list of objects. I can input this into mocks and test it out, letting you know if I have questions.
Seems very relevant, I'll look into it.
Looks great, thanks!

Looks like this bug is back, on commit d2195411a64592054e0cdaa3713fbd172f79a46d
Steps to reproduce:
- install Bitcoin Core
- Config -> Advanced -> Peers -> Add Nodes -> +Add
- see this:
I can see from the screenshot this is not the latest code. We have since gotten rid of those red warning icons. Test on latest code.
You can see from the included git hash that this is not the latest code ;)
But this code is 4 days old, so I figured I'd report.
So this is definitely an improvement, but still not ideal. Now when I add a new node, it gives me this:
Then if I click to expand "Entry 1", the new fields are displayed:

My question is: why require the user to expand "Entry 1"? They've just added a new entry; this makes it feel like they've done something wrong. Ideally the first (required) field in the new entry (or just the first field with an error, which would be the same in this case) should be visible and selected, that way the user can quickly understand what they're supposed to do. The way it currently is, they have to stare at the screen for a moment and wonder why everything turned red, then just start clicking things until they see what the issue is.
Still happening

The accordions should automatically expand to the first entry with an error
The accordions should automatically expand to the first entry with an error
This is a separate feature request, please open a new issue.
Seems easier to just use this issue, but here you go: https://github.com/Start9Labs/embassy-os/issues/2107