Rename a Custom Component Group

I’d like to rename “Custom Labels”:
image

Currently, the only way to do that is to visit every matching Custom Component, and re-enter the same (new) group name.

When the group is small, it’s easy enough. But for a group with 10 or 20 (or more) components, that’s mind-numbingly tedious.

Of course, if you have a local copy of the source code, there is a workaround.

container:
  type: ColumnPanel
  properties: {role: null, tooltip: '', border: '', foreground: '', visible: true,
    wrap_on: mobile, col_spacing: medium, spacing_above: none, col_widths: '{}', spacing_below: none,
    background: ''}
components:
- type: Label
  properties: {role: text, align: left, tooltip: '', border: '', foreground: '', visible: true,
    text: '', font_size: null, font: '', spacing_above: none, icon_align: left, spacing_below: none,
    italic: false, background: yellow, bold: false, underline: false, icon: ''}
  name: label_1
  layout_properties: {grid_position: 'INDWES,GQRINB'}
  data_bindings: []
is_package: true
custom_component: true
toolbox_item: {group: Custom Labels}

One could do a multi-file search-and-replace on that final line, then commit, and push back to Anvil.

2 Likes

Would this help?

Not really. I’d still have to visit each of 10-20 components in turn, to change their group name individually. They might be scattered all over my client_code folder, so it could take awhile.

It would be better to rename the group right in the Palette, where it appears once per App, and you can immediately see all of the Custom Components in that group.

I also thought of dragging a Custom Component from one group to another, but that is a bit much to ask at this point. :grin:

1 Like

Obviously having a tool that allows to rename all the groups at once would be helpful. I like custom components, and I have liked your request. But I see it as something used so rarely that would hardly justify adding a command/tool/option.

I would take a more generic approach, that would improve the overall IDE user experience:

  1. Moving the “Use as custom component” to the right panel and keeping the current tab open.
  2. Allowing multiple component selection in a form
    • When multiple components are selected, only the properties shared by all selected components should be shown, and their values should be shown only if identical
    • If two selected components have different values, then the UI should show something like "<Varies>" for texts, numbers or dropdowns, and indeterminate status for checkboxes.
  3. Now that the properties stay put on the right and custom component settings are form properties, extend the multiple selection of components to forms, so multiple forms can be deleted or moved at once, and multiple form properties can be modified at once (today form properties don’t really exist, but custom component settings, form name, startup status and other properties would belong there.)

You are asking for a little tool to solve a specific little problem, and here I am saying “what about redesigning the whole UI”. :innocent:

1 Like

Yup, I’ve used IDEs that worked that way. When multi-select and -update are needed, there’s really no substitute!

I’m working on an AutoCAD plugin now, and the plugin settings will work just like that.

Unfortunately AutoCAD speaks C#, not Python, so I create a little prototype in Python, test it, and when I like it, I convert it to C#. It’s faster to build something from scratch in Python with successful tests, than rewriting what I already have from Python to C#. I love Python. I hate C#. And static typing. And fully compiling before executing. And…

1 Like