Skip to content

Commit c3ae424

Browse files
MrFlashAccountFrizi
authored andcommitted
Fix bugs around mass selection/single selection/drag and drop (#11942)
Closes: enso-org/cloud-v2#1633 This PR: 1. Refactors the Selection Brush component - improve visuals, improved performance, added support for scrolling containers 2. Now dragging can only be started over a selected row. 3. If a row is not selected, Brush selection is applied 4. This PR isolates the root view from Portals, this guaranties that portals will always be over the root view 5. Adds new utilities and hooks. 6. Fixes floating bug when selection doesn't happen on click 7. Changes the behavior of unselection: from blacklist (everything except a few elements) to whitelist (if user clicks on Special component - unselect). Special component can be placed anywhere we want. clicks on other elements are ignored
1 parent 9171330 commit c3ae424

File tree

25 files changed

+1275
-348
lines changed

25 files changed

+1275
-348
lines changed

app/common/src/services/Backend.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export const S3ObjectVersionId = newtype.newtypeConstructor<S3ObjectVersionId>()
7373

7474
/** Unique identifier for an arbitrary asset. */
7575
export type AssetId = IdType[keyof IdType]
76+
export const AssetId = newtype.newtypeConstructor<AssetId>()
7677

7778
/** Unique identifier for a payment checkout session. */
7879
export type CheckoutSessionId = newtype.Newtype<string, 'CheckoutSessionId'>

app/gui/integration-test/dashboard/actions/DrivePageActions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ export default class DrivePageActions<Context> extends PageActions<Context> {
212212
dragRowToRow(from: number, to: number) {
213213
return self.step(`Drag drive table row #${from} to row #${to}`, async (page) => {
214214
const rows = locateAssetRows(page)
215+
rows.nth(from).click()
215216
await rows.nth(from).dragTo(rows.nth(to), {
216217
sourcePosition: ASSET_ROW_SAFE_POSITION,
217218
targetPosition: ASSET_ROW_SAFE_POSITION,

app/gui/src/dashboard/components/AriaComponents/Dialog/Dialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import { DIALOG_BACKGROUND } from './variants'
2828
const MotionDialog = motion(aria.Dialog)
2929

3030
const OVERLAY_STYLES = tv({
31-
base: 'fixed inset-0 isolate flex items-center justify-center bg-primary/20 z-tooltip',
31+
base: 'fixed inset-0 isolate flex items-center justify-center bg-primary/20',
3232
variants: {
3333
isEntering: { true: 'animate-in fade-in duration-200 ease-out' },
3434
isExiting: { true: 'animate-out fade-out duration-200 ease-in' },

app/gui/src/dashboard/components/AriaComponents/Dialog/Popover.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export interface PopoverProps
2929
}
3030

3131
export const POPOVER_STYLES = twv.tv({
32-
base: 'shadow-xl w-full overflow-clip z-tooltip',
32+
base: 'shadow-xl w-full overflow-clip',
3333
variants: {
3434
isEntering: {
3535
true: 'animate-in fade-in placement-bottom:slide-in-from-top-1 placement-top:slide-in-from-bottom-1 placement-left:slide-in-from-right-1 placement-right:slide-in-from-left-1 ease-out duration-200',

app/gui/src/dashboard/components/AriaComponents/Tooltip/Tooltip.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import * as text from '../Text'
1212
// =================
1313

1414
export const TOOLTIP_STYLES = twv.tv({
15-
base: 'group flex justify-center items-center text-center text-balance [overflow-wrap:anywhere] z-tooltip',
15+
base: 'group flex justify-center items-center text-center text-balance [overflow-wrap:anywhere]',
1616
variants: {
1717
variant: {
1818
custom: '',

app/gui/src/dashboard/components/Badge/Badge.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export interface BadgeProps extends VariantProps<typeof BADGE_STYLES> {
1515
}
1616

1717
export const BADGE_STYLES = tv({
18-
base: 'flex items-center justify-center px-[5px] border-[0.5px]',
18+
base: 'flex items-center justify-center px-[5px] border-[0.5px] min-w-6',
1919
variants: {
2020
variant: {
2121
solid: 'border-transparent bg-[var(--badge-bg-color)] text-[var(--badge-text-color)]',

0 commit comments

Comments
 (0)