[GH-ISSUE #1385] [Bug] Grid URL property's edit button #546

Closed
opened 2026-03-23 20:37:44 +00:00 by mirror · 14 comments
Owner

Originally created by @richardshiue on GitHub (Oct 27, 2022).
Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/1385

Originally assigned to: @onyicodes on GitHub.

Bug Description

In a grid with a URL property, hovering in any other field in the same row triggers the edit button to show up in the URL cell.

How to Reproduce

  1. Go to a grid with a URL property
  2. Hover over a row, on a property apart from the URL property
  3. Observe that the editor URL button appears

Expected Behavior

The button should only show when the user hovers over the exact cell, not the row in general

Operating System

Fedora Linux 36

AppFlowy Version(s)

v0.0.6

Screenshots

image

Additional Context

No response

Originally created by @richardshiue on GitHub (Oct 27, 2022). Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/1385 Originally assigned to: @onyicodes on GitHub. ### Bug Description In a grid with a URL property, hovering in any other field in the same row triggers the edit button to show up in the URL cell. ### How to Reproduce 1. Go to a grid with a URL property 2. Hover over a row, on a property apart from the URL property 3. Observe that the editor URL button appears ### Expected Behavior The button should only show when the user hovers over the exact cell, not the row in general ### Operating System Fedora Linux 36 ### AppFlowy Version(s) v0.0.6 ### Screenshots ![image](https://user-images.githubusercontent.com/71320345/198276005-74a620f0-bf9c-454f-ab36-5b3af7754de3.png) ### Additional Context _No response_
Author
Owner

@onyicodes commented on GitHub (Oct 29, 2022):

Hi @richardshiue, I will like to work on this. Please can you assign this to me?

<!-- gh-comment-id:1295891094 --> @onyicodes commented on GitHub (Oct 29, 2022): Hi @richardshiue, I will like to work on this. Please can you assign this to me?
Author
Owner

@richardshiue commented on GitHub (Oct 30, 2022):

Hello @Onyedikareal, thanks for offering to help on this! I'm not a maintainer so I can't do that for you, sorry. Ping @annieappflowy

<!-- gh-comment-id:1296293359 --> @richardshiue commented on GitHub (Oct 30, 2022): Hello @Onyedikareal, thanks for offering to help on this! I'm not a maintainer so I can't do that for you, sorry. Ping @annieappflowy
Author
Owner

@onyicodes commented on GitHub (Oct 30, 2022):

Alright, thanks @richardshiue.
Hi @annieappflowy, please can you assign this to me.

<!-- gh-comment-id:1296301015 --> @onyicodes commented on GitHub (Oct 30, 2022): Alright, thanks @richardshiue. Hi @annieappflowy, please can you assign this to me.
Author
Owner

@annieappflowy commented on GitHub (Nov 7, 2022):

Hi @Onyedikareal , thanks for offering the help. I just assigned the issue to you.
@richardshiue , I've added you to our org as a collaborator. Going forward, you will be able to manage issues for AppFlowy. You should receive an invite from GitHub to accept your new role!
image

<!-- gh-comment-id:1305361243 --> @annieappflowy commented on GitHub (Nov 7, 2022): Hi @Onyedikareal , thanks for offering the help. I just assigned the issue to you. @richardshiue , I've added you to our org as a collaborator. Going forward, you will be able to manage issues for AppFlowy. You should receive an invite from GitHub to accept your new role! ![image](https://user-images.githubusercontent.com/12026239/200281294-9dd7fe53-39d4-473a-9858-b59f247339dd.png)
Author
Owner

@richardshiue commented on GitHub (Nov 7, 2022):

Hi @Onyedikareal , thanks for offering the help. I just assigned the issue to you. @richardshiue , I've added you to our org as a collaborator. Going forward, you will be able to manage issues for AppFlowy. You should receive an invite from GitHub to accept your new role! image

Thanks, that'd be an honor

<!-- gh-comment-id:1305588941 --> @richardshiue commented on GitHub (Nov 7, 2022): > Hi @Onyedikareal , thanks for offering the help. I just assigned the issue to you. @richardshiue , I've added you to our org as a collaborator. Going forward, you will be able to manage issues for AppFlowy. You should receive an invite from GitHub to accept your new role! ![image](https://user-images.githubusercontent.com/12026239/200281294-9dd7fe53-39d4-473a-9858-b59f247339dd.png) Thanks, that'd be an honor
Author
Owner

@onyicodes commented on GitHub (Nov 8, 2022):

Hi @Onyedikareal , thanks for offering the help. I just assigned the issue to you. @richardshiue , I've added you to our org as a collaborator. Going forward, you will be able to manage issues for AppFlowy. You should receive an invite from GitHub to accept your new role! image

Thanks

<!-- gh-comment-id:1306789773 --> @onyicodes commented on GitHub (Nov 8, 2022): > Hi @Onyedikareal , thanks for offering the help. I just assigned the issue to you. @richardshiue , I've added you to our org as a collaborator. Going forward, you will be able to manage issues for AppFlowy. You should receive an invite from GitHub to accept your new role! ![image](https://user-images.githubusercontent.com/12026239/200281294-9dd7fe53-39d4-473a-9858-b59f247339dd.png) Thanks
Author
Owner

@richardshiue commented on GitHub (Jan 4, 2023):

Hey there @Onyedikareal, do you have any update on this?

<!-- gh-comment-id:1370523592 --> @richardshiue commented on GitHub (Jan 4, 2023): Hey there @Onyedikareal, do you have any update on this?
Author
Owner

@onyicodes commented on GitHub (Jan 5, 2023):

Hi @richardshiue , thanks for asking. Unfortunately I'm hooked here. Will appreciate it if someone can assist me on this.

<!-- gh-comment-id:1371742861 --> @onyicodes commented on GitHub (Jan 5, 2023): Hi @richardshiue , thanks for asking. Unfortunately I'm hooked here. Will appreciate it if someone can assist me on this.
Author
Owner

@richardshiue commented on GitHub (Jan 5, 2023):

Okay I'll look into it and let you know if I find something

<!-- gh-comment-id:1371781538 --> @richardshiue commented on GitHub (Jan 5, 2023): Okay I'll look into it and let you know if I find something
Author
Owner

@richardshiue commented on GitHub (Jan 7, 2023):

Sorry I took so long to get back to you. The problem is that we want the primary cells (aka non-deletable title field) to show the open as page accessory just by hovering over it or any other cell in the row. See app_flowy/lib/plugins/grid/presentation/widgets/cell/cell_container.dart

image

the onEnter stores the state of the hover event. So when a row is hovered, the cell also "gets hovered" in effect. The problem is that it's not happening only to the primary cells but the URL ones as well. So here, we should remove the update clause and replace the ChangeNotifierProxy with ChangeNotifierProvider<_CellContainerNotifier>. You can also remove rowStateNotifier field as well.

With this change primary cells won't have the previous behavior. To bring it back, we need to pass the isPrimary flag into CellContainer (I'll let you figure out from where) and then into _GridCellEnterRegion. Then, change out the Selector for a Selector2 with the selector clause being

return Selector2<RegionStateNotifier, _CellContainerNotifier, bool>(
  selector: (context, regionNotifier, cellNotifier) => !cellNotifier.isFocus && (cellNotifier.onEnter || regionNotifier.onEnter && isPrimary),
...

I think the logic is pretty self-explanatory. If you have another way fix it, feel free to submit a PR, but I think that's the gist of the problem. If you have further questions, please don't hesitate to reach out to me on the Discord server.

<!-- gh-comment-id:1374512431 --> @richardshiue commented on GitHub (Jan 7, 2023): Sorry I took so long to get back to you. The problem is that we want the primary cells (aka non-deletable title field) to show the open as page accessory just by hovering over it or any other cell in the row. See `app_flowy/lib/plugins/grid/presentation/widgets/cell/cell_container.dart` ![image](https://user-images.githubusercontent.com/71320345/211156478-29f7dff0-8fc4-4ccf-8ea4-42e0eaf5b395.png) the onEnter stores the state of the hover event. So when a row is hovered, the cell also "gets hovered" in effect. The problem is that it's not happening only to the primary cells but the URL ones as well. So here, we should remove the update clause and replace the `ChangeNotifierProxy` with `ChangeNotifierProvider<_CellContainerNotifier>`. You can also remove `rowStateNotifier` field as well. With this change primary cells won't have the previous behavior. To bring it back, we need to pass the `isPrimary` flag into `CellContainer` (I'll let you figure out from where) and then into `_GridCellEnterRegion`. Then, change out the `Selector` for a `Selector2` with the selector clause being ``` return Selector2<RegionStateNotifier, _CellContainerNotifier, bool>( selector: (context, regionNotifier, cellNotifier) => !cellNotifier.isFocus && (cellNotifier.onEnter || regionNotifier.onEnter && isPrimary), ... ``` I think the logic is pretty self-explanatory. If you have another way fix it, feel free to submit a PR, but I think that's the gist of the problem. If you have further questions, please don't hesitate to reach out to me on the Discord server.
Author
Owner

@richardshiue commented on GitHub (Jan 14, 2023):

@Onyedikareal gentle ping :)

<!-- gh-comment-id:1382673989 --> @richardshiue commented on GitHub (Jan 14, 2023): @Onyedikareal gentle ping :)
Author
Owner

@onyicodes commented on GitHub (Jan 14, 2023):

@richardshiue Thanks for the gentle ping ;-) . I'm just seeing your first response. Will apply your suggestion and see if that fixes the problem.
Thanks so much.

<!-- gh-comment-id:1382738278 --> @onyicodes commented on GitHub (Jan 14, 2023): @richardshiue Thanks for the gentle ping ;-) . I'm just seeing your first response. Will apply your suggestion and see if that fixes the problem. Thanks so much.
Author
Owner

@onyicodes commented on GitHub (Jan 16, 2023):

@richardshiue Thanks so much for the help. I've sorted this issue out with your guide.

<!-- gh-comment-id:1383366028 --> @onyicodes commented on GitHub (Jan 16, 2023): @richardshiue Thanks so much for the help. I've sorted this issue out with your guide.
Author
Owner

@richardshiue commented on GitHub (Jan 16, 2023):

@onyicodes That's awesome! Hoping to see your PR soon

<!-- gh-comment-id:1383514838 --> @richardshiue commented on GitHub (Jan 16, 2023): @onyicodes That's awesome! Hoping to see your PR soon
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#546
No description provided.