-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
added clipboard copy button #2051
base: main
Are you sure you want to change the base?
Conversation
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nice start! I think we'd want a few more things before this could be merged.
- The original issue calls out the fact that the context lists several dictionaries one after another with no delimiter. This PR may need to do something about that. The goal is to have something that can be copied and pasted into a shell (looking at the original issue). Please consider that workflow and let me know what you think.
- Some selenium tests which may be annoying, but we need something to automatically test this
What do you think 'Copy' button would wrap these dictionaries inside a list format? So, instead of copying: {"data": "smth"}
{"data2": "smth2"} It would copy: [
{"data": "smth"},
{"data2": "smth2"}
] |
I think that's better. The alternative is allowing them to copy each dict one at a time. This would require a small UI change to add some more vertical spacing between the dictionaries. I wonder if we should use a dictionary with keys identifying where each of the contexts have come from. That's a bit bigger of a change and should be a separate issue. Last aside, some of the values are not valid primitives or common classes. They are things like |
Oh dang. I'm sorry, I definitely didn't understand things properly. I thought the multiple dictionaries were coming from the context processors. They aren't. This is new to me. Apparently the context for a template is stacked, which is why we have the list here. Though when the template is rendered, it just shows the flattened version. So, yes I think a list of dictionaries is appropriate here. Though I think we may want to create an issue to inform the developer about this. The developer should be aware that multiple contexts are used for the view and what the flattened context dictionary was effectively used to render the template.
I actually think we can punt on this part. When the serializable branch gets merged, it's going to be converted to JSON and at that point, this will be "solved". Or at least decided for us. It seems like the main change is the copy button (done, but needs tests) and displaying the contexts as a list. @matthiask any opinions? |
Description
Added a 'Copy' button for template context with unicode handling.
Fixes #1840
Hi @tim-schilling, please give me your feedback, thank you!