Repository navigation
Conversation
The explorer accepts a drop of files from the desktop, but nothing can be dragged out of it. Anyone who wants an object's URI somewhere else — a notebook cell, a chat box, a form field, an application embedding Onyxia — has to open the row menu, copy the URI, and paste it. Rows are now draggable. A drag publishes the S3 URIs twice: as `text/plain`, newline separated, which is what makes a drop onto an ordinary text field useful without the target knowing anything about Onyxia; and as `application/x-onyxia-s3-objects`, JSON, for a consumer that needs to tell "these are S3 objects" from "the user dropped some text". Nothing is read and nothing is modified — only the URIs travel. Three details that are easy to get wrong, so they are pure functions with tests rather than logic inside the component: - Which rows a drag carries is not "the selection". Dragging an unselected row drags that row alone; returning the selection there would carry files the user cannot see they had selected, since this list is virtualized. - Rows mid-upload or mid-delete are not draggable, and are dropped from a multi-row drag rather than refusing the whole gesture. - Detection during dragover reads `types` and never `getData()`. The DataTransfer is in protected mode while a drag is in flight, so every value reads back empty — a check written against `getData()` passes its unit test and refuses every real drag. A drag beginning on the row checkbox or a row action button is that control's gesture and does not become a row drag. Signed-off-by: Islam Eldemery <islam.eldemery@gmail.com>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What
Rows in the S3 explorer become draggable, so an object or a prefix can be dragged out and dropped somewhere else.
Why
The explorer accepts a drop of files from the desktop, but nothing can be dragged out of it. Anyone who wants an object's URI elsewhere — a notebook cell, a chat box, a form field, an application embedding Onyxia — has to open the row menu, copy the URI, and paste it.
What a drag carries
Two formats, always both:
text/plain, newline separated. This is what makes a drop onto an ordinary text field useful without the target knowing anything about Onyxia.application/x-onyxia-s3-objects, JSON. For a consumer that needs to tell "these are S3 objects" from "the user dropped some text".Nothing is read and nothing is modified — only the URIs travel.
Three details that are easy to get wrong
They are pure functions with tests rather than logic inside the component, following the existing convention in
src/uiof testing functions rather than rendering:dragoverreadstypes, nevergetData(). The DataTransfer is in protected mode while a drag is in flight, so every value reads back empty. A check written againstgetData()passes its unit test and refuses every real drag.A drag beginning on the row checkbox or a row action button is that control's gesture and does not become a row drag.
Notes
S3ExplorerMainView.spec.mdupdated.tsc,eslintandvite buildclean.