Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Table layout pages section: interactive previews are not updating content #6582

Open
twiro opened this issue Jul 29, 2024 · 1 comment
Open
Labels
type: bug 🐛 Is a bug; fixes a bug

Comments

@twiro
Copy link

twiro commented Jul 29, 2024

Description:

If a toggle field is included as a column in a list of pages in table layout the preview of the field behaves buggy/irritating:

A) Example A

Blueprint:

example_a:
  label: Table
  type: pages
  layout: table
  columns:
    toggle:
      label: Toggle Field Table Preview

Screenshot of the resulting table:

Bildschirmfoto 2024-07-29 um 14 26 24

Expected behavior / Problem:

With that preview given (especially as the UI feels fully functional) I'd expect the toggle value to get saved whenever I use a toggle in the table – only, it doesn't!

More Context:

Looks like this preview was originally implementend for the structure field and works there. (Haven't tested that actually)

B) Example B

In the forum I ran across the idea to use type: text for the preview of a toggle field in table layout, but that doesn't result in a satisfying experience either:

Blueprint:

example_b:
  label: Table
  type: pages
  layout: table
  columns:
    toggle:
      label: Toggle Field Table Preview
      type: text

Screenshot of the resulting table:

Bildschirmfoto 2024-07-29 um 14 27 01

Expected behavior / Problem:

If changing the preview of a toggle field to text in a table column is actually possible, I'd expect to see the toggle text values I defined in my blueprint (Ja, Nein) or at least the default text values for the given language (an, aus) – but all i get is true and false.

C) Example C

Thinking about the text values of the toggle field preview a little more neither true and false nor the default text values of the given language (an and aus) do feel really convincing here – if the values can be customized in the blueprint, the only really satisfying solution for the field preview would be to have it customazible there too. If not automatically, then at least by redefining the values in the columns-settings of the table:

Blueprint:

example_c:
  label: Table
  type: pages
  layout: table
  columns:
    toggle:
      label: Toggle Field Table Preview
      type: toggle
      text:
        - "Nein"
        - "Ja"

Screenshot of the resulting table:

Bildschirmfoto 2024-07-29 um 14 26 24

Expected behavior / Problem:

Apart from the missing saving-functionality described in example A, I'd expect to see Ja and Nein used instead of an and aus.

Setup / System

  • Kirby Version: 4.3.0
  • OS: macOS 10.15.7
  • Browser: Firefox
  • Version: 128
@distantnative distantnative changed the title UI/UX struggles with the toggle field table preview Pages section: UI/UX struggles with the toggle field table preview Jul 29, 2024
@distantnative
Copy link
Member

@twiro For me, this really boils down to the issue in (A). As you spotted yourself, the preview was initially created for the structure field and then they are getting re-used now for the tables layout of sections. However, we need to fix them that they either really update the page content or that in sections they are display only without any interaction.

(B) works as intended and expected, displaying the content field value as text. We aren't looking up the field type in addition when the column type is defined, it gets treated as that type.

(C) I don't see much value here currently in re-implemnting the logic twice. You can define the texts for the different states on the actual field.

@distantnative distantnative added the type: bug 🐛 Is a bug; fixes a bug label Aug 11, 2024
@distantnative distantnative changed the title Pages section: UI/UX struggles with the toggle field table preview Table layout pages section: interactive previews are not updating content Aug 11, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
type: bug 🐛 Is a bug; fixes a bug
Projects
None yet
Development

No branches or pull requests

2 participants