Preserve insertion order for expanded object properties in console [devtools/devtools-frontend : main]

0 views
Skip to first unread message

Helmut Januschka (Gerrit)

unread,
Mar 11, 2026, 7:10:56 PM (12 days ago) Mar 11
to Helmut Januschka, Wolfgang Beyer, Devtools-frontend LUCI CQ, devtools-rev...@chromium.org
Attention needed from Wolfgang Beyer

Helmut Januschka added 1 comment

Patchset-level comments
File-level comment, Patchset 2 (Latest):
Helmut Januschka . resolved

this one requires the 3 way dance -> http://crrev.com/c/7646648 (silences errors)

Open in Gerrit

Related details

Attention is currently required from:
  • Wolfgang Beyer
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: devtools/devtools-frontend
Gerrit-Branch: main
Gerrit-Change-Id: I2976648db054031491a26ea6b8995041467a2b85
Gerrit-Change-Number: 7644688
Gerrit-PatchSet: 2
Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
Gerrit-Reviewer: Wolfgang Beyer <wo...@chromium.org>
Gerrit-CC: Devtools-frontend LUCI CQ <devtools-fro...@luci-project-accounts.iam.gserviceaccount.com>
Gerrit-Attention: Wolfgang Beyer <wo...@chromium.org>
Gerrit-Comment-Date: Wed, 11 Mar 2026 23:10:51 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Wolfgang Beyer (Gerrit)

unread,
Mar 12, 2026, 8:57:52 AM (12 days ago) Mar 12
to Helmut Januschka, Devtools-frontend LUCI CQ, devtools-rev...@chromium.org
Attention needed from Helmut Januschka

Wolfgang Beyer added 1 comment

Patchset-level comments
Wolfgang Beyer . unresolved

Thanks for taking this on!

This does not yet cover all cases. I posted a counter-example at https://crbug.com/423838364#comment10.
I believe more counter-examples can probably be found when comparing the logic in `ObjectPropertiesSection.compareProperties` with the logic in `RemoteObjectPreviewFormatter`

Open in Gerrit

Related details

Attention is currently required from:
  • Helmut Januschka
Submit Requirements:
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: devtools/devtools-frontend
    Gerrit-Branch: main
    Gerrit-Change-Id: I2976648db054031491a26ea6b8995041467a2b85
    Gerrit-Change-Number: 7644688
    Gerrit-PatchSet: 2
    Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
    Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
    Gerrit-Reviewer: Wolfgang Beyer <wo...@chromium.org>
    Gerrit-CC: Devtools-frontend LUCI CQ <devtools-fro...@luci-project-accounts.iam.gserviceaccount.com>
    Gerrit-Attention: Helmut Januschka <hel...@januschka.com>
    Gerrit-Comment-Date: Thu, 12 Mar 2026 12:57:48 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    open
    diffy

    Helmut Januschka (Gerrit)

    unread,
    Mar 12, 2026, 6:19:43 PM (12 days ago) Mar 12
    to Helmut Januschka, Wolfgang Beyer, Devtools-frontend LUCI CQ, devtools-rev...@chromium.org
    Attention needed from Wolfgang Beyer

    Helmut Januschka added 1 comment

    Patchset-level comments
    File-level comment, Patchset 2:
    Wolfgang Beyer . resolved

    Thanks for taking this on!

    This does not yet cover all cases. I posted a counter-example at https://crbug.com/423838364#comment10.
    I believe more counter-examples can probably be found when comparing the logic in `ObjectPropertiesSection.compareProperties` with the logic in `RemoteObjectPreviewFormatter`

    Helmut Januschka

    Thanks removed underscore-based reordering in compareProperties and added regression tests for underscore-prefixed keys, mixed function/data properties, and enumerable/non-enumerable buckets; do you know any other places, or do you have ideas how to find other affected places (guess even if we miss a spot; it would not end the world?)

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Wolfgang Beyer
    Submit Requirements:
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: devtools/devtools-frontend
      Gerrit-Branch: main
      Gerrit-Change-Id: I2976648db054031491a26ea6b8995041467a2b85
      Gerrit-Change-Number: 7644688
      Gerrit-PatchSet: 3
      Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
      Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
      Gerrit-Reviewer: Wolfgang Beyer <wo...@chromium.org>
      Gerrit-CC: Devtools-frontend LUCI CQ <devtools-fro...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Attention: Wolfgang Beyer <wo...@chromium.org>
      Gerrit-Comment-Date: Thu, 12 Mar 2026 22:19:40 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Wolfgang Beyer <wo...@chromium.org>
      unsatisfied_requirement
      open
      diffy

      Wolfgang Beyer (Gerrit)

      unread,
      Mar 13, 2026, 11:31:50 AM (11 days ago) Mar 13
      to Helmut Januschka, Philip Pfaffe, Devtools-frontend LUCI CQ, devtools-rev...@chromium.org
      Attention needed from Helmut Januschka and Philip Pfaffe

      Wolfgang Beyer added 2 comments

      Patchset-level comments
      File-level comment, Patchset 2:
      Wolfgang Beyer . unresolved

      Thanks for taking this on!

      This does not yet cover all cases. I posted a counter-example at https://crbug.com/423838364#comment10.
      I believe more counter-examples can probably be found when comparing the logic in `ObjectPropertiesSection.compareProperties` with the logic in `RemoteObjectPreviewFormatter`

      Helmut Januschka

      Thanks removed underscore-based reordering in compareProperties and added regression tests for underscore-prefixed keys, mixed function/data properties, and enumerable/non-enumerable buckets; do you know any other places, or do you have ideas how to find other affected places (guess even if we miss a spot; it would not end the world?)

      Wolfgang Beyer

      I was able to create another counter-example, this time using a symbol.
      As long as the sorting for the expanded view in `compareProperties` and the sorting for the collapsed view in `RemoteObjectPreviewFormatter` don't follow the same logic, there can be discrepancies.
      What would happen if `compareProperties` was completely removed/not called? I see 3 call sites but I haven't investigated what each of them do exactly. Maybe @pfaffe who touched this code recently has some more context.

      File-level comment, Patchset 3 (Latest):
      Wolfgang Beyer . resolved

      Philip, do you have relevant knowledge you can share?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Helmut Januschka
      • Philip Pfaffe
      Submit Requirements:
        • requirement is not satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: devtools/devtools-frontend
        Gerrit-Branch: main
        Gerrit-Change-Id: I2976648db054031491a26ea6b8995041467a2b85
        Gerrit-Change-Number: 7644688
        Gerrit-PatchSet: 3
        Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
        Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
        Gerrit-Reviewer: Philip Pfaffe <pfa...@chromium.org>
        Gerrit-Reviewer: Wolfgang Beyer <wo...@chromium.org>
        Gerrit-CC: Devtools-frontend LUCI CQ <devtools-fro...@luci-project-accounts.iam.gserviceaccount.com>
        Gerrit-Attention: Helmut Januschka <hel...@januschka.com>
        Gerrit-Attention: Philip Pfaffe <pfa...@chromium.org>
        Gerrit-Comment-Date: Fri, 13 Mar 2026 15:31:47 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Helmut Januschka <hel...@januschka.com>
        Comment-In-Reply-To: Wolfgang Beyer <wo...@chromium.org>
        unsatisfied_requirement
        open
        diffy

        Philip Pfaffe (Gerrit)

        unread,
        Mar 16, 2026, 4:19:55 AM (8 days ago) Mar 16
        to Helmut Januschka, Wolfgang Beyer, Devtools-frontend LUCI CQ, devtools-rev...@chromium.org
        Attention needed from Helmut Januschka

        Philip Pfaffe added 2 comments

        Patchset-level comments
        Wolfgang Beyer . unresolved

        Thanks for taking this on!

        This does not yet cover all cases. I posted a counter-example at https://crbug.com/423838364#comment10.
        I believe more counter-examples can probably be found when comparing the logic in `ObjectPropertiesSection.compareProperties` with the logic in `RemoteObjectPreviewFormatter`

        Helmut Januschka

        Thanks removed underscore-based reordering in compareProperties and added regression tests for underscore-prefixed keys, mixed function/data properties, and enumerable/non-enumerable buckets; do you know any other places, or do you have ideas how to find other affected places (guess even if we miss a spot; it would not end the world?)

        Wolfgang Beyer

        I was able to create another counter-example, this time using a symbol.
        As long as the sorting for the expanded view in `compareProperties` and the sorting for the collapsed view in `RemoteObjectPreviewFormatter` don't follow the same logic, there can be discrepancies.
        What would happen if `compareProperties` was completely removed/not called? I see 3 call sites but I haven't investigated what each of them do exactly. Maybe @pfaffe who touched this code recently has some more context.

        Philip Pfaffe

        Any option we choose here will make some people unhappy I'm afraid. Especially if we change this to address a small-ish UX inconsistency. Should we maybe make this configurable instead?

        Except in the wasm case, I don't think I'd ever worry about the insertion order. I certainly rely on the alphabetical order though, in order to find specific properties I'm looking for. How about this approach:

        • Stop sorting wasm properties by default.
        • Keep sorting JS properties by default.
        • Have a context menu entry to toggle.
        Commit Message
        Line 11, Patchset 3 (Latest):Bug: 423838364
        Philip Pfaffe . unresolved

        Does this also fix crbug.com/40833016?

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Helmut Januschka
        Submit Requirements:
        • requirement is not satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: devtools/devtools-frontend
        Gerrit-Branch: main
        Gerrit-Change-Id: I2976648db054031491a26ea6b8995041467a2b85
        Gerrit-Change-Number: 7644688
        Gerrit-PatchSet: 3
        Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
        Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
        Gerrit-Reviewer: Philip Pfaffe <pfa...@chromium.org>
        Gerrit-Reviewer: Wolfgang Beyer <wo...@chromium.org>
        Gerrit-CC: Devtools-frontend LUCI CQ <devtools-fro...@luci-project-accounts.iam.gserviceaccount.com>
        Gerrit-Attention: Helmut Januschka <hel...@januschka.com>
        Gerrit-Comment-Date: Mon, 16 Mar 2026 08:19:51 +0000
        unsatisfied_requirement
        open
        diffy

        Helmut Januschka (Gerrit)

        unread,
        Mar 20, 2026, 5:16:12 AM (4 days ago) Mar 20
        to Helmut Januschka, Philip Pfaffe, Wolfgang Beyer, Devtools-frontend LUCI CQ, devtools-rev...@chromium.org
        Attention needed from Philip Pfaffe and Wolfgang Beyer

        Helmut Januschka added 2 comments

        Patchset-level comments
        File-level comment, Patchset 2:
        Wolfgang Beyer . resolved

        Thanks for taking this on!

        This does not yet cover all cases. I posted a counter-example at https://crbug.com/423838364#comment10.
        I believe more counter-examples can probably be found when comparing the logic in `ObjectPropertiesSection.compareProperties` with the logic in `RemoteObjectPreviewFormatter`

        Helmut Januschka

        Thanks removed underscore-based reordering in compareProperties and added regression tests for underscore-prefixed keys, mixed function/data properties, and enumerable/non-enumerable buckets; do you know any other places, or do you have ideas how to find other affected places (guess even if we miss a spot; it would not end the world?)

        Wolfgang Beyer

        I was able to create another counter-example, this time using a symbol.
        As long as the sorting for the expanded view in `compareProperties` and the sorting for the collapsed view in `RemoteObjectPreviewFormatter` don't follow the same logic, there can be discrepancies.
        What would happen if `compareProperties` was completely removed/not called? I see 3 call sites but I haven't investigated what each of them do exactly. Maybe @pfaffe who touched this code recently has some more context.

        Philip Pfaffe

        Any option we choose here will make some people unhappy I'm afraid. Especially if we change this to address a small-ish UX inconsistency. Should we maybe make this configurable instead?

        Except in the wasm case, I don't think I'd ever worry about the insertion order. I certainly rely on the alphabetical order though, in order to find specific properties I'm looking for. How about this approach:

        • Stop sorting wasm properties by default.
        • Keep sorting JS properties by default.
        • Have a context menu entry to toggle.
        Helmut Januschka

        thanks philip, see newest PS it has the context menu entry and you suggested applied

        Commit Message
        Line 11, Patchset 3:Bug: 423838364
        Philip Pfaffe . resolved

        Does this also fix crbug.com/40833016?

        Helmut Januschka

        yes, added it to commit footer

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Philip Pfaffe
        • Wolfgang Beyer
        Submit Requirements:
          • requirement is not satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: devtools/devtools-frontend
          Gerrit-Branch: main
          Gerrit-Change-Id: I2976648db054031491a26ea6b8995041467a2b85
          Gerrit-Change-Number: 7644688
          Gerrit-PatchSet: 6
          Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
          Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
          Gerrit-Reviewer: Philip Pfaffe <pfa...@chromium.org>
          Gerrit-Reviewer: Wolfgang Beyer <wo...@chromium.org>
          Gerrit-CC: Devtools-frontend LUCI CQ <devtools-fro...@luci-project-accounts.iam.gserviceaccount.com>
          Gerrit-Attention: Wolfgang Beyer <wo...@chromium.org>
          Gerrit-Attention: Philip Pfaffe <pfa...@chromium.org>
          Gerrit-Comment-Date: Fri, 20 Mar 2026 09:16:08 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Helmut Januschka <hel...@januschka.com>
          Comment-In-Reply-To: Philip Pfaffe <pfa...@chromium.org>
          Comment-In-Reply-To: Wolfgang Beyer <wo...@chromium.org>
          unsatisfied_requirement
          open
          diffy

          Philip Pfaffe (Gerrit)

          unread,
          Mar 20, 2026, 10:24:51 AM (4 days ago) Mar 20
          to Helmut Januschka, Wolfgang Beyer, Devtools-frontend LUCI CQ, devtools-rev...@chromium.org
          Attention needed from Helmut Januschka and Wolfgang Beyer

          Philip Pfaffe added 4 comments

          File front_end/panels/console/ConsoleViewMessage.ts
          Line 901, Patchset 6: const sortPropertiesAlphabetically = obj.subtype !== 'wasmvalue' && obj.subtype !== 'webassemblymemory';
          Philip Pfaffe . unresolved

          We should check this inside of ObjectPropertiesSection so that it applies to all objects. Also, I'm not sure we should force the sorting of webassemblymemory objects, WDYT?

          File front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts
          Line 163, Patchset 6: #sortPropertiesAlphabetically: boolean;
          Philip Pfaffe . unresolved

          I think we should not store this in a dedicated property and instead write changes through to the options. And that means that we need to copy the options instead of storing the object.

          Alternatively, we need to always pass fresh objects to the ObjectTreeNodeBase constructor.

          Line 679, Patchset 6: if (sortPropertiesAlphabetically) {
          Philip Pfaffe . unresolved

          What about the underscores?

          File test/e2e/elements/sidebar-event-listeners.test.ts
          Line 124, Patchset 6 (Parent): ['useCapture', 'false'],
          Philip Pfaffe . unresolved

          If we're still sorting by default, what are these results changing?

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Helmut Januschka
          • Wolfgang Beyer
          Submit Requirements:
            • requirement is not satisfiedCode-Owners
            • requirement is not satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • requirement is not satisfiedReview-Enforcement
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: devtools/devtools-frontend
            Gerrit-Branch: main
            Gerrit-Change-Id: I2976648db054031491a26ea6b8995041467a2b85
            Gerrit-Change-Number: 7644688
            Gerrit-PatchSet: 6
            Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
            Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
            Gerrit-Reviewer: Philip Pfaffe <pfa...@chromium.org>
            Gerrit-Reviewer: Wolfgang Beyer <wo...@chromium.org>
            Gerrit-CC: Devtools-frontend LUCI CQ <devtools-fro...@luci-project-accounts.iam.gserviceaccount.com>
            Gerrit-Attention: Helmut Januschka <hel...@januschka.com>
            Gerrit-Attention: Wolfgang Beyer <wo...@chromium.org>
            Gerrit-Comment-Date: Fri, 20 Mar 2026 14:24:47 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            unsatisfied_requirement
            open
            diffy

            Helmut Januschka (Gerrit)

            unread,
            Mar 23, 2026, 6:35:03 PM (13 hours ago) Mar 23
            to Helmut Januschka, Philip Pfaffe, Wolfgang Beyer, Devtools-frontend LUCI CQ, devtools-rev...@chromium.org
            Attention needed from Philip Pfaffe and Wolfgang Beyer

            Helmut Januschka added 4 comments

            File front_end/panels/console/ConsoleViewMessage.ts
            Line 901, Patchset 6: const sortPropertiesAlphabetically = obj.subtype !== 'wasmvalue' && obj.subtype !== 'webassemblymemory';
            Philip Pfaffe . resolved

            We should check this inside of ObjectPropertiesSection so that it applies to all objects. Also, I'm not sure we should force the sorting of webassemblymemory objects, WDYT?

            Helmut Januschka

            moved to ObjectPropertiesSection. and well i think it is not worth the extra code to force any special case on wasm, reverted.

            File front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts
            Line 163, Patchset 6: #sortPropertiesAlphabetically: boolean;
            Philip Pfaffe . resolved

            I think we should not store this in a dedicated property and instead write changes through to the options. And that means that we need to copy the options instead of storing the object.

            Alternatively, we need to always pass fresh objects to the ObjectTreeNodeBase constructor.

            Helmut Januschka

            removed the dedicated sort field and now write the value through `options.sortPropertiesAlphabetically`

            Line 679, Patchset 6: if (sortPropertiesAlphabetically) {
            Philip Pfaffe . resolved

            What about the underscores?

            Helmut Januschka

            good catch, restored the underscore.

            File test/e2e/elements/sidebar-event-listeners.test.ts
            Line 124, Patchset 6 (Parent): ['useCapture', 'false'],
            Philip Pfaffe . resolved

            If we're still sorting by default, what are these results changing?

            Helmut Januschka

            Done

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Philip Pfaffe
            • Wolfgang Beyer
            Submit Requirements:
              • requirement is not satisfiedCode-Owners
              • requirement is not satisfiedCode-Review
              • requirement is not satisfiedReview-Enforcement
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: comment
              Gerrit-Project: devtools/devtools-frontend
              Gerrit-Branch: main
              Gerrit-Change-Id: I2976648db054031491a26ea6b8995041467a2b85
              Gerrit-Change-Number: 7644688
              Gerrit-PatchSet: 10
              Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
              Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
              Gerrit-Reviewer: Philip Pfaffe <pfa...@chromium.org>
              Gerrit-Reviewer: Wolfgang Beyer <wo...@chromium.org>
              Gerrit-CC: Devtools-frontend LUCI CQ <devtools-fro...@luci-project-accounts.iam.gserviceaccount.com>
              Gerrit-Attention: Philip Pfaffe <pfa...@chromium.org>
              Gerrit-Attention: Wolfgang Beyer <wo...@chromium.org>
              Gerrit-Comment-Date: Mon, 23 Mar 2026 22:35:00 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: No
              Comment-In-Reply-To: Philip Pfaffe <pfa...@chromium.org>
              unsatisfied_requirement
              open
              diffy
              Reply all
              Reply to author
              Forward
              0 new messages