-
-
Notifications
You must be signed in to change notification settings - Fork 73
ability to include column headers when copying-and-pasting #318
Comments
dash-table
- include column headers when copying-and-pasting [Sponsored: Due May 1]dash-table
- ability to include column headers when copying-and-pasting [Sponsored: Due May 1]
dash-table
- ability to include column headers when copying-and-pasting [Sponsored: Due May 1]
There are two scenarios to cover here:
The basic implementation is very simple with a flag but, the UX for this seems confusing as a user would have very strong expectations for the selection to match the pasted value. As the headers were not selected, they are not expected. I would advice against implementing this as-is. This looks more like a special Considering this PR, #313, #314, maybe we want to include an operations/menu bar at the top of the table for the various special operations to live in, somewhat similar to the action bar in plotly.js instead of considering each in isolation. In this scenario, the flag would make this operation available instead of changing the copy/paste behavior. Also wondering about the impact of this on a theoritical multi-zone selection feature in the future. Also, maybe we make the headers selectable/part of navigation. Multi-cell headers are the edge case to consider. @alexcjohnson Maybe you'll have additional insight from how the menu bar came into existence in Plotly.js |
Expanding on some thoughts from a Slack DM with @Marc-Andre-Rivet. I think something like Ctrl+Ins, makes the most sense as a shortcut for this behaviour — either that or make column headers specifically selectable. That shortcut has precedent, including for this behaviour specifically. I think this would be preferable over a
For this type of behaviour et al, I think a context menu would be more appropriate. But this jars with the current "keyboard selection only" behaviour. Another option is to just make the headers selectable as well. This is probably the most obvious UX behaviour for a table user. Again, not sure if it's worth it in terms of implementation difficulty. |
The plotly.js menu bar serves basically two purposes: 1) to change how mouse actions behave (click-drag and hover) and 2) to do certain actions (download, autoscale...) in a discoverable way, without having to teach users new key combos. I do like the menu bar in light of #313 and #314, in which case I'd say "copy with headers" should just be an action you do from the menu bar, rather than a mode you choose from the menu bar. We could also give it a new key combo, and use the menu bar tooltips to tell users what that key combo is. If we do that, There's a question then of where to put the menu bar; on a graph it's easy to use some space at the top, which is usually a margin, esp. if the menu bar is only shown when the mouse is over the graph. Tables don't have margins like that... I suppose we can just make it opt in (perhaps with options for either always visible or only while the mouse is over the table... as long as hiding it doesn't reflow) and put it at the top (right or left)? Re: making headers explicitly selectable - I'd also think you want to be able to omit the top row(s) and still copy headers, which you couldn't do with selectable headers under the current selection paradigm. |
I agree in general that we could benefit from a broader UI for these types of issues. However, for this particular issue, the end-user is looking for a copy & paste behavior for a very particular workflow. In other words, consider this feature for apps that have a very defined/structured workflow to-and-from Excel. This is a workflow that they are "trained in" and so they expect a very structured behavior. So, in advance of the broader UI menu bar design, I'd vote in favor of making this a simple flag to start to in order to satisfy the requirements for this particular workflow. |
Discussion notes: This will be implemented as a flag changing the behavior and this flag will be documented as |
Currently, when you copy and paste contents from the DataTable into Excel, only the currently selected contents are included. This item would enable the copy-and-paste to include the column headers when pasting the data.
This setting would be set by the Dash developer through a property like “
include_headers_on_copy_and_paste=True
”.Note that this would be independent of the rows or columns (#317) that have been selected
The text was updated successfully, but these errors were encountered: