AppFlowy icon indicating copy to clipboard operation
AppFlowy copied to clipboard

feat: fetch url meta data on creating row

Open zoli opened this issue 1 year ago • 10 comments

On submitting a new row in board view, if the setting is enabled and the text is a URL fetch url metadata and fill the row with it.

closes #5963

Feature Preview

https://github.com/user-attachments/assets/26ffc1c1-e009-4079-be28-a1c92c3a1861

PR Checklist

  • [x] My code adheres to AppFlowy's Conventions
  • [x] I've listed at least one issue that this PR fixes in the description above.
  • [ ] I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes.
  • [ ] All existing tests are passing.

zoli avatar Aug 30 '24 20:08 zoli

🥷 Ninja i18n – 🛎️ Translations need to be updated

Project /project.inlang

lint rule new reports level link
Missing translation 81 warning contribute (via Fink 🐦)

github-actions[bot] avatar Aug 30 '24 20:08 github-actions[bot]

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 75.26%. Comparing base (7ecf213) to head (347d0fc). Report is 30 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6130      +/-   ##
==========================================
+ Coverage   74.41%   75.26%   +0.84%     
==========================================
  Files         245      232      -13     
  Lines        6566     6828     +262     
  Branches     1057      964      -93     
==========================================
+ Hits         4886     5139     +253     
+ Misses       1628     1626       -2     
- Partials       52       63      +11     
Flag Coverage Δ
appflowy_web_app 75.26% <ø> (+0.84%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Aug 30 '24 20:08 codecov[bot]

At first, I wanted to also enable this feature in grid view on filling URL field, but filling other fields inside EditableURLCell isn't that straightforward. So I put it aside for maybe in the future.

The next step can be adding the description and image of URL metadata in the row page.

zoli avatar Aug 30 '24 20:08 zoli

After inputting the URL, there's a noticeable delay before the parsed URL is inserted (I understand this is due to fetching metadata). This lag affects the user experience. We should consider a better way to handle this. For example:

  1. insert the raw URL text immediately.
  2. create a new item with the raw URL text.
  3. update the cell content with parsed metadata once it's available.

@zoli What do you think?

Screenshots: Screenshot 2024-09-09 at 09 34 59 Screenshot 2024-09-09 at 09 35 04 Screenshot 2024-09-09 at 09 35 10

LucasXu0 avatar Sep 09 '24 01:09 LucasXu0

@LucasXu0 By creating a new item do you mean sending CreateRow event to the backend? I think creating a pseudo card while fetching the URL is better, Maybe with less opacity so the user knows it's not final yet.

zoli avatar Sep 09 '24 07:09 zoli

What should the behavior be when there are more than one URL fields?

richardshiue avatar Sep 17 '24 06:09 richardshiue

What should the behavior be when there are more than one URL fields?

I can change the settings to choose a specific field, for now, I thought selecting the first URL field type would be good enough.

zoli avatar Sep 17 '24 08:09 zoli

@richardshiue will choosing specific field in settings and pseudo card while fetching the URL be enough for this?

zoli avatar Sep 19 '24 20:09 zoli

Hi @zoli , please add bloc tests or integration test.

appflowy avatar Sep 21 '24 08:09 appflowy

@appflowy, Added both bloc and integration tests. @richardshiue, Enabled choosing the field (URL type) to fill the URL. @LucasXu0, Added loading state.

zoli avatar Sep 23 '24 11:09 zoli

@richardshiue What do you think about it? I'm thinking that the toggle function should be an option for the URL field type, not in the global settings of the database.

LucasXu0 avatar Dec 30 '24 11:12 LucasXu0