Commit Graph
9 Commits
Author SHA1 Message Date
Jack Franklin af59080e20 [DataGrid] Don't attempt to re-focus column headers
We were being a bit keen when trying to re-focus a data-grid row if it
had lost focus due to being removed from the DOM and then added back in.
We don't need to apply that logic if the focused cell is a header,
because they are never removed from the DOM as the user scrolls.

Fixed: chromium:1173437
Change-Id: If27cbe70a4d3f7053581d0941869c30b827f2d57
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2667508
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2021-02-02 11:53:59 +00:00
Jack Franklin 021bc2ce45 Migrate data_grid_controller examples to TypeScript
Bug: chromium:1144106
Change-Id: Id5cbfd901d97013b0de5674ed557830967872e1d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2612862
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-01-08 10:40:27 +00:00
Jack Franklin 90b6613019 Reland "Add header context menu to data grid"
This reverts commit c2ad98d783.

Reason for revert: fixed flakey test

Original change's description:
> Revert "Add header context menu to data grid"
>
> This reverts commit 6bdb3622bd.
>
> Reason for revert: Interaction tests started failing on mac.
>
> https://ci.chromium.org/ui/p/devtools-frontend/builders/ci/Stand-alone%20Mac/2514/overview
>
> Original change's description:
> > Add header context menu to data grid
> >
> > This CL adds a default header context menu to the data grid that lists visible
> > and sortable columns much like the legacy data grid.
> >
> > Bug: 1150793
> > Change-Id: I84a8a9cc511d6be9fee1f89ba41a6e8649df54ec
> > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2600723
> > Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
> > Reviewed-by: Paul Lewis <aerotwist@chromium.org>
>
> TBR=aerotwist@chromium.org,jacktfranklin@chromium.org
>
> Change-Id: Ic8ef16044716d922d3a37b6a8fb32e13a75dee72
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 1150793
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2601962
> Reviewed-by: Jan Scheffler <janscheffler@chromium.org>
> Commit-Queue: Jan Scheffler <janscheffler@chromium.org>

TBR=aerotwist@chromium.org,szuend@chromium.org,janscheffler@chromium.org,jacktfranklin@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 1150793
Change-Id: Ibd352be261d2cefee6fccc4b18b438faaad57631
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2610596
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jan Scheffler <janscheffler@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2021-01-05 11:56:39 +00:00
Jan Scheffler c2ad98d783 Revert "Add header context menu to data grid"
This reverts commit 6bdb3622bd.

Reason for revert: Interaction tests started failing on mac.

https://ci.chromium.org/ui/p/devtools-frontend/builders/ci/Stand-alone%20Mac/2514/overview

Original change's description:
> Add header context menu to data grid
>
> This CL adds a default header context menu to the data grid that lists visible
> and sortable columns much like the legacy data grid.
>
> Bug: 1150793
> Change-Id: I84a8a9cc511d6be9fee1f89ba41a6e8649df54ec
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2600723
> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
> Reviewed-by: Paul Lewis <aerotwist@chromium.org>

TBR=aerotwist@chromium.org,jacktfranklin@chromium.org

Change-Id: Ic8ef16044716d922d3a37b6a8fb32e13a75dee72
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1150793
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2601962
Reviewed-by: Jan Scheffler <janscheffler@chromium.org>
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
2020-12-23 07:27:30 +00:00
Jack Franklin 6bdb3622bd Add header context menu to data grid
This CL adds a default header context menu to the data grid that lists visible
and sortable columns much like the legacy data grid.

Bug: 1150793
Change-Id: I84a8a9cc511d6be9fee1f89ba41a6e8649df54ec
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2600723
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-12-22 15:43:47 +00:00
Jack Franklin 4747e2779d [DataGrid] allow columns to be resized by the mouse
Bug: 1153066
Change-Id: Ica1b2f23479b091182507a8629e8f2ccb6eea901
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2560753
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-12-14 16:25:11 +00:00
Jack Franklin cfda4f910c [DataGrid]: swap hidden flag to visible + hideable
One of the features we need to support in the new DataGrid is a context
menu to hide/show columns. Therefore in preparation this CL updates the
API for a `column` from just the `hidden` field to `visible` and
`hideable`. The former denotes if the column is visible or not, and
`hideable` denotes if the user can hide/show it via the context menu.

There's no user facing change here, just type changes in preparation for
future work.

Bug: 1150793, 1125968
Change-Id: Idfa95a27aab741388548e10ff83263c6b7338724
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2550075
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-11-20 12:03:56 +00:00
Alfonso Castaño 405815877a Add title to DataGrid cells
This CL adds a title field to Cell. Title will be used in
stringValueForCell, as a replacement for cell.value or the renderer output.

Bug: chromium:1148760
Change-Id: I566276b5bb0536ee262d51fb70bae2a74b26390a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2536407
Commit-Queue: Alfonso Castaño <alcastano@google.com>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-11-16 10:55:39 +00:00
Jack Franklin f3ebb1429d New DataGrid component.
This CL introduces the new DataGrid component, and is split into two:

- DataGrid, which is a "plain" component that takes data and renders it.
- DataGridController, which is a "smart" component that can take the
data and manipulate it (e.g. sorting), before passing it into a DataGrid
to be rendered.

These components are not feature complete in that they do not support
all features of the incumbent `DataGrid.js` but they are not designed
to. The goal here is to land the initial data-grid components, and then
work on using them in DevTools (as part of the protocol monitor). At
that point we can extend functionality by seeing what is missing and
testing in DevTools, rather than testing in isolation.

This CL includes the implementation, unit tests and component
documentation examples of the functionality that does exist, along with
a README explaining the two components and when to use each one.

Bug: 1125966
Change-Id: I1b5c9a0174c4563be64b5b4adcc8251d1498b55d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2461772
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Andres Olivares <andoli@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-11-05 15:40:11 +00:00