Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Implement Variable Labels from Var-Dumper Context in Frontend UI #154

Closed
butschster opened this issue Jun 5, 2024 · 1 comment
Closed
Assignees
Labels
enhancement New feature or request module:var-dumper
Milestone

Comments

@butschster
Copy link
Member

butschster commented Jun 5, 2024

Currently, when using the dump() function to output multiple variables, it's not immediately clear which dump corresponds to which variable if no labels are provided. This can be particularly confusing when debugging complex data structures or when multiple dumps are present on the same page.

Feature Request:
Enhance the frontend UI to display variable labels from the var-dumper context, making it easier to identify the relationship between the dumps and the variables.

Consider the scenario where two variables are dumped without explicit labels:

dump($foo, $bar);

In the current setup, $foo and $bar would be assigned default numeric labels such as 1 and 2. The corresponding JSON payload might look like this:

{
  "uuid": "018ff255-37b1-7146-a984-53528d523f70",
  "project": null,
  "type": "var-dump",
  "payload": {
    "context": {...},
    "payload": {
      "label": "2",
      "type": "string",
      "value": "Here is a random phrase"
    }
  },
  "timestamp": 1717757622.194
}

However, if named labels are used:

dump(label1: $foo, label2: $bar);

The JSON payload should reflect these labels, aiding in clearer debugging:

{
  "uuid": "018ff255-37b1-7146-a984-53528d523f70",
  "project": null,
  "type": "var-dump",
  "payload": {
    "context": {...},
    "payload": {
      "label": "label2",
      "type": "string",
      "value": "Here is a random phrase"
    }
  },
  "timestamp": 1717757622.194
}

It would be great to put a label in a dump event

image

Benefits:
Improves clarity and traceability of variable dumps.

@butschster butschster added enhancement New feature or request module:var-dumper labels Jun 5, 2024
@butschster butschster changed the title use label from vr-dumper context Implement Variable Labels from Var-Dumper Context in Frontend UI Jun 7, 2024
@butschster butschster added this to the 1.0 milestone Jun 7, 2024
Kreezag added a commit that referenced this issue Jun 7, 2024
butschster added a commit that referenced this issue Jun 7, 2024
@roxblnfk
Copy link
Member

roxblnfk commented Jun 7, 2024

Looks solved

@Kreezag Kreezag closed this as completed Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request module:var-dumper
Projects
Archived in project
Development

No branches or pull requests

3 participants