-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix various issues on the Dashboard (#10256)
- Fix React DevTools not working in Firefox - Fix selection of asset names when editing them, not working at all in Firefox - Convert tick/cross buttons when editing assets, and the "plus" and "reload" buttons on the "shared with" column, "labels" column, and keyboard shortcuts table, to match more with the rest of the design - Update clip path when the container resizes, so that the icons for hidden columns never overlap the actual table header - Fix #10184 - Fix renames being committed even when cancelling - Fix duplicate name detection - previously, all asset types only checked folders with the same name, not assets with the same name - I'm not 100% sure this is the correct behavior still - Stop using `kbd` (`aria.Keyboard`) to display keyboard shortcuts, since they should not be displayed in a monospace font. - Fix "plus" and "reload" buttons going past the right side of their parent table cell - Limit length of `PermissionDisplay` - if the username of a user with permission is too long, it uses a tooltip instead - Update the username dynamically for all permissions owned by self, when changing username in the settings. - This avoids having to fully invalidate the directory tree every time the username changes, given that nothing changes about the assets' metadata themselves. - Cache children in the Drive tree - This avoids loading spinners when closing a folder and immediately reopening it. - Note that children are still re-fetched on reopen to ensure freshness # Important Notes - This MAY be split into multiple smaller PRs. However, I think it's better to QA as a single PR, to avoid duplicating work checking behavior that may be changed by a sibling PR (assuming the PR was split into multiple).
- Loading branch information
1 parent
83ec24d
commit b5641aa
Showing
78 changed files
with
1,215 additions
and
987 deletions.
There are no files selected for viewing
This file contains 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
65 changes: 65 additions & 0 deletions
65
app/ide-desktop/lib/dashboard/docs/browser_specific_behavior.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# Browser-specific behavior | ||
|
||
This document details behavior that is inconsistent between browsers and needs | ||
to be worked around. | ||
|
||
## List of inconsistent behaviors | ||
|
||
### Drag event missing coordinates | ||
|
||
Firefox sets `MouseEvent.pageX` and `MouseEvent.pageY` to `0` for `drag` | ||
events. | ||
|
||
#### Fix | ||
|
||
Pass the `drag` event handlers to `dragover` event as well, and wrap all `drag` | ||
event handlers in: | ||
|
||
````ts | ||
if (event.pageX !== 0 || event.pageY !== 0) { | ||
// original body here | ||
} | ||
``` | ||
|
||
#### Affected files | ||
|
||
- [`DragModal.tsx`](../src/modals/DragModal.tsx) | ||
|
||
### Drag event propagation in text inputs | ||
|
||
Text selection in text inputs DO NOT WORK on Firefox, when the text input is a | ||
child of an element with `draggable="true"`. | ||
See [Firefox bug 800050]. | ||
To solve this problem, use `useDraggable` from | ||
[`dragAndDropHooks.ts`] on ALL elements that MAY contain a text input. | ||
|
||
[Firefox bug 800050]: https://bugzilla.mozilla.org/show_bug.cgi?id=800050 | ||
|
||
#### Fix | ||
|
||
Merge `useDraggable` from [`dragAndDropHooks.ts`] on ALL elements that MAY | ||
contain a text input. | ||
|
||
It is recommended to use `aria.mergeProps` to combine these props with existing | ||
props. | ||
|
||
```tsx | ||
import * as dragAndDropHooks from "#/hooks/dragAndDropHooks.ts"; | ||
const draggableProps = dragAndDropHooks.useDraggable(); | ||
return <div {...draggableProps}></div>; | ||
```` | ||
[`draggableHooks.ts`]: ../src/hooks/dragAndDropHooks.ts | ||
#### Affected browsers | ||
- Firefox (all versions) | ||
#### Affected files | ||
- [`EditableSpan.tsx`](../src/components/EditableSpan.tsx) - the text inputs | ||
that are affected | ||
- [`AssetRow.tsx`](../src/components/dashboard/AssetRow.tsx) - fixes text | ||
selection in `EditableSpan.tsx` |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.