Compare commits

...
289 Commits
Author SHA1 Message Date
Lucas.Xu 430325c731 chore: bump version 0.2.2 (#2804) 2023-06-15 18:55:21 +08:00
Lucas.Xu d5884ad2b5 fix: unable insert a reference database (#2798)
* fix: unable insert a reference database

* test: add reference database tests

* feat: set min height for document inside database
2023-06-15 16:33:44 +08:00
Kilu.He 95f8b2e9a4 chore: create redo/undo bridge (#2760)
* chore: create redo/undo bridge

* chore: update test

* chore: review update

* chore: review update

* chore: react redo/undo

* chore: review update

* chore: add test

* chore: review update

* chore: generate document id

* chore: update undo/redo

* chore: update cargo lock
2023-06-15 10:37:51 +08:00
Nathan.foooandLucas.Xu 27dd719aa8 feat: row document (#2792)
* chore: create orphan view handler

* feat: save icon url and cover url in view

* feat: implement emoji picker UI

* chore: config ui

* chore: config ui again

* chore: replace RowPB with RowMetaPB to exposing more row information

* fix: compile error

* feat: show emoji in row

* chore: update

* test: insert emoji test

* test: add update emoji test

* test: add remove emoji test

* test: add create field tests

* test: add create row and delete row integration tests

* test: add create row from row menu

* test: document in row detail page

* test: delete, duplicate row in row detail page

* test: check the row count displayed in grid page

* test: rename existing field in grid page

* test: update field type of exisiting field in grid page

* test: delete field test

* test: add duplicate field test

* test: add hide field test

* test: add edit text cell test

* test: add insert text to text cell test

* test: add edit number cell test

* test: add edit multiple number cells

* test: add edit checkbox cell test

* feat: integrate editor into database row

* test: add edit create time and last edit time cell test

* test: add edit date cell by selecting a date test

* chore: remove unused code

* chore: update checklist bg color

* test: add update database layout test

---------

Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
2023-06-14 22:16:33 +08:00
Yijing HuangandLucas.Xu b8983e4466 feat: language selector on welcome page (#2796)
* feat: add language selector on welcome page

* feat: add hover effect and refactor layout

* test: add basic languge selector testing

* chore: increate place holder width

* fix: add catch error for setLocale and finish the testing

* chore: update comment

* feat: refactor the skip login in page and add tests

---------

Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
2023-06-14 19:14:41 +08:00
Kilu.HeandLucas.Xu 00c0934df6 Support text block add link (#2730)
* feat: support text block href attribute

* fix: double click didn't select range

* fix: link update

* chore: ts lint

* chore: add new line

Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>

* chore: update get word indices function

---------

Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
2023-06-13 15:59:18 +08:00
Lucas.Xu aca3c90eb3 chore: optimize the integration test UI 2023-06-12 21:53:39 +08:00
Lucas.Xu 8b4d1868e5 test: add integration test 2023-06-12 20:13:25 +08:00
Lucas.Xu 5bcf48a4f9 fix: the markdown file name doesn't update after renaming the document (#2777)
* fix: the markdown file name doesn't update after renaming the document

* test: add integration test
2023-06-12 14:29:09 +08:00
Lucas.Xu 335861706e feat: support importing multiple md files all at once (#2778) 2023-06-12 14:27:38 +08:00
Nathan.foooandLucas.Xu 4f5672c2af refactor: create view interface (#2772)
* refactor: create view interface

* chore: update doc

Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>

---------

Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
2023-06-12 12:57:01 +08:00
Lucas.Xu b5d9a73194 chore: bump version 0.2.1 (#2762) 2023-06-11 17:02:09 +08:00
Nathan.fooo 619d82f115 chore: bump up collab ref (#2764) 2023-06-11 16:24:41 +08:00
Lucas.Xu d5887b0a12 chore: enable codecov action (#2741)
* chore: enable codecov action

* test: fix integration test

* test: fix switch_folder_test
2023-06-11 14:19:44 +08:00
c7f73551c7 fix: update database layout in document (#2757)
* fix: update database layout in document

* feat: create or ref calendar

* Update frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/calendar/calendar_menu_item.dart

Co-authored-by: Mathias Mogensen <42929161+Xazin@users.noreply.github.com>

* fix: stop listen

* feat: remove the redundant database view files

* chore: rename the grid state

---------

Co-authored-by: Mathias Mogensen <42929161+Xazin@users.noreply.github.com>
Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
2023-06-11 08:49:10 +08:00
Lucas.Xu ed04e247ba fix: the share markdown feature doesn't work in 0.2.0 (#2756)
* chore: bump version 0.2.0

* fix: the share markdown feature doesn't work in 0.2.0

* test: add integration test for share button
2023-06-10 22:38:25 +08:00
Nathan.fooo 2ecd0a67ad feat: hide url cell accessory when the content is empty (#2754) 2023-06-10 15:48:56 +08:00
Nathan.fooo 4ce94a9ceb fix: adding vertical padding for progress bar (#2753) 2023-06-10 14:57:52 +08:00
Nathan.fooo d4e39389d2 fix: show calendar layout (#2752) 2023-06-10 13:23:29 +08:00
Nathan.fooo ab5a3dae3c chore: upgrade rust version to 1.70 (#2749)
* chore: upgrade rust version to 1.70

* ci: fix wanrings

* ci: fix clippy warings
2023-06-09 22:23:07 +08:00
Nathan.fooo 133ac72317 ci: fix docker ci (#2745)
* ci: fix permission
2023-06-09 19:48:16 +08:00
Nathan.fooo e9be37a961 test: add database event tests (#2744)
* chore: add tests

* test: add tests

* test: add tests
2023-06-09 18:57:29 +08:00
chirag paneliyaandLucas.Xu 0f9f5251f2 feat: added enter icon in add field. (#2707)
* [FR] Added Enter Icon In Add Field.

* Update frontend/appflowy_flutter/lib/plugins/database_view/widgets/row/cells/select_option_cell/select_option_editor.dart

Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>

* Update frontend/appflowy_flutter/lib/plugins/database_view/widgets/row/cells/select_option_cell/select_option_editor.dart

Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>

* Update frontend/appflowy_flutter/lib/plugins/database_view/widgets/row/cells/select_option_cell/select_option_editor.dart

Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>

* fix : missing trailing comma and code enhancement.

* chore: format code

---------

Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
2023-06-08 21:07:41 +08:00
Lucas.Xu 02b7149514 fix: can't input url in Grid (#2737)
* fix: launch url in url cell

* fix: can't input url in Grid

* feat: support selecting or deselecting all items in export page

* fix: remove the circle shape

* fix: light mode toolbar color

* chore: update language and adjust the launch page
2023-06-08 15:46:33 +08:00
Nathan.fooo 37547a6485 chore: bump up collab (#2740)
* chore: update collab version

* chore: log the error when open collab db

* chore: add log
2023-06-08 14:20:31 +08:00
Nathan.fooo 6e27d551d9 chore: bump up collab version (#2736) 2023-06-08 12:20:18 +08:00
Kilu.He d02b8c609b Copy and paste appflowy editor data (#2714)
* feat: copy and paste appflowy editor data

* fix: review suggestion
2023-06-08 12:17:00 +08:00
Lucas.Xu f86a98cd51 fix: add cover image using url issue (#2733)
* fix: add cover image using url issue

* chore: update editor
2023-06-08 08:34:11 +08:00
Nathan.fooo 3e3bdb59ae chore: update workspace id from nanoid to uuid (#2731)
* chore: update workspace id

* ci: enable RUST_BACKTRACE

* chore: update patch
2023-06-07 22:27:13 +08:00
Yatendra KumarandLucas.Xu 95d620931f feat: added analysis options + formatted complete code (#2725)
* feat: added analysis options + formatted complete code

* fix: formatted code

---------

Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
2023-06-07 16:25:37 +08:00
Lucas.Xu cb7bb390e6 chore: update editor 1.0.0 (#2727)
* chore: update editor version 1.0.0

* chore: enable integration test on develop branch

* chore: disable flutter integration test
2023-06-07 15:04:32 +08:00
Nathan.fooo ce8cee5637 test: add databaase event test (#2728)
* test: add tests and fix modify primary field bug

* test: add more test

* fix: tauri buiuld

* chore: disable share link button
2023-06-07 14:52:35 +08:00
nathan 1b56538a2f feat: update folder snapshot config 2023-06-07 14:33:12 +08:00
Mathias MogensenandLucas.Xu b1729ab3eb fix: add new row issue (#2723)
* fix: add new row issue

* fix: remove redundant dispose

* fix: review comments

* chore: remove the unused anmaition key

---------

Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
2023-06-07 12:56:02 +08:00
chirag paneliya bfe6c8074a fix: http:// prefix issue fix (#2719) 2023-06-07 07:57:12 +08:00
Nathan.fooo 381d2e6c71 fix: reorder view when sibling view was deleted (#2724)
* fix: reorder view when sibling view was deleted

* ci: fix test

* ci: rust fmt
2023-06-07 00:05:27 +08:00
Lucas.Xuandnathan e3eee76609 feat: support align and upgrade appflowy_editor (#2712)
* feat: support align and upgrade appflowy_editor

* chore: try to fix linux analyze error

* fix: error after inserting callout block

* feat: add inline board / grid plugin

* feat: refactor insert_page

* fix: ref view in document

* chore: add asset name and description to option align type

* fix: linux flutter analyze

* chore: disable file export and log

* fix: the window always back to center after relaunching

* fix: potential data lost in nested list

* feat: re-design login page

* fix: can't remove background color

* chore: rename bundle id and change the macos app to non sandbox app

---------

Co-authored-by: nathan <nathan@appflowy.io>
2023-06-06 17:19:53 +08:00
Nathan.fooo e96bea0de5 chore: auto focus checklist editing (#2720) 2023-06-06 17:15:33 +08:00
Nathan.fooo bf121623ae feat: save snapshot to sqlite db (#2718)
* chore: snapshot

* chore: impl sqlite snapshot

* feat: snapshot config

* feat: update patch

* ci: fix tauri ci

* ci: add cache path

* chore: save snapshot

* chore: update patch

* ci: fix s fmt
2023-06-06 16:03:29 +08:00
Nathan.fooo f2dd58a4f1 chore: remove unused sqlite table (#2704)
* chore: remove unused sqlite table

* ci: fix tests
2023-06-05 18:30:14 +08:00
Nathan.foooandLucas.Xu e24a8aabeb chore: implement import csv ui (#2710)
* chore: implement import csv ui

* feat: support importing CSV

---------

Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
2023-06-05 18:29:52 +08:00
Nathan.fooo 5b59800449 ci: cache target (#2711) 2023-06-05 18:28:36 +08:00
Askarbek Zadaulyandqinluhe 6a43dd871d Fix/tauri board events (#2678)
* chore: focus name input on field edit

* fix: remove random id for duplicated view

* fix: use alias for imports

* fix: folder, grid, board bugs

* chore: remove log

* fix: update options list on add

* chore: close on delete option

* chore: show and hide field

* chore: add field with specific type

* chore: small cleanup

* fix: create view on another folder and views notifier reorganize

---------

Co-authored-by: qinluhe <qinluhe.twodog@gmail.com>
2023-06-05 16:48:34 +08:00
Nathan.fooo 4f2585baed test: Folder event test (#2709)
* test: add event tests

* test: add folder event test

* ci: rust fmt
2023-06-05 16:09:18 +08:00
Lucas.Xuandnathan 80a273edae fix: create document (#2701)
* fix: create a new document

* fix: the banner don't show after deleteing the page

* fix: inserting a divider through the slash menu the cursor should stay active in the next line

* fix: the overlay doesn't dismiss after selecting a page

* fix: typo

* fix: delete the page in document if it has been deleted

* chore: l10n

* chore: rename events

* ci: rm install_diesel in ci

* fix: cover color not working

* ci: fix tauri build

---------

Co-authored-by: nathan <nathan@appflowy.io>
2023-06-05 13:10:14 +08:00
Lucas.Xu 2bd90ba7ab chore: speed up flutter_ci (#2702) 2023-06-05 09:49:13 +08:00
Nathan.fooo a50c940282 feat: delete the view from the db when the view is deleted (#2703) 2023-06-05 09:42:11 +08:00
Nathan.fooo bec8122178 fix: disable edit primary field (#2695)
* refactor: field editor

* chore: disable edit type option of primary field
2023-06-04 09:28:13 +08:00
Nathan.fooo edd58ede45 refactor: updated at and created at (#2692)
* refactor: updated at and created at

* chore: update patch ref

* ci: fix tests
2023-06-03 23:35:55 +08:00
Lucas.Xu 561d0f0808 feat: public the json to document data pb api (#2694)
* feat: public the json to document data pb api

* test: add test for convert_data_to_document_internal

* chore: apply review suggestion

* chore: update folder path
2023-06-03 20:43:46 +08:00
Lucas.Xuandnathan ee52bf4b0e fix: create build in document (#2687)
* feat: support create multiple level views

* refactor: rm document data wrapper

* chore: add docs

---------

Co-authored-by: nathan <nathan@appflowy.io>
2023-06-03 13:55:43 +08:00
Nathan.fooo 4fa39f298c fix: ref view in document (#2685)
* fix: remove set ref view in document as the current view

* ci: fix tests

* ci: fix tauri build
2023-06-03 13:40:12 +08:00
chirag paneliya 5994cc135f fix: update ar language not found issue. (#2599) 2023-06-03 12:36:05 +08:00
Nathan.fooo 265177e444 feat: hide ref database view (#2682) 2023-06-02 12:04:14 +08:00
Nathan.fooo 82dcd4b99e feat: save csv data to local file (#2681) 2023-06-02 12:02:47 +08:00
Kilu.He 8cee792b94 Refactor text block delta and across block selection (#2671)
* fix: add block menu comment

* refactor: separation of abstract delta and editor, and optimization across block selections
2023-06-02 10:05:38 +08:00
Nathan.foooandLucas.Xu 33e0f8d26d feat: switch database layout (#2677)
* chore: rename update at and create at

* chore: support switching view layout

* chore: implement ui

* chore: update layout type

* refactor: board/calendar/grid setting button

* chore: update UI after switch to other layout type

* fix: no date display in calendar

* chore: update patch

* chore: fix create ref view in document

* chore: fix flutter analyze

* ci: warnings

* chore: rename board and grid keys

* fix: calendar row event update

---------

Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
2023-06-01 20:23:27 +08:00
Lucas.Xuandnathan 2ef72f3203 feat: load the readme file when first time launch (#2676)
* chore: bump version 0.2.0

* test: add migration test

* feat: support exporting document data to afdoc format (#2610)

* feat: support exporting document data to afdoc format

* feat: export database

* fix: resolve comment issues

* fix: add error tips when exporting files failed

---------

Co-authored-by: nathan <nathan@appflowy.io>

* feat: rename delta

* feat: add built-in readme

* fix: use independent children id

* fix: comment typo

* chore: add icons

* fix: floating toolbar style

* fix: markdown export test

* chore: disbale moveup/movedown action

* fix: unit test

---------

Co-authored-by: nathan <nathan@appflowy.io>
2023-06-01 20:18:40 +08:00
Nathan.fooo 012b6c0066 feat: cloud storage test (#2663)
* chore: show default user name

* chore: update

* feat: change collab storage type after auth type changed

* chore: reload folder

* chore: initial the group controller if need

* chore: update patch

* chore: update patch ref
2023-05-31 17:42:14 +08:00
Nathan.fooo 09d61c79c9 chore: rename update at and create at (#2672) 2023-05-31 17:34:41 +08:00
Richard Shiueandnathan 80f08d4bec feat: drag and drop events to reschedule (#2558)
* chore: send DateCellDataPB instead of timestamp

* chore: separate event card into own widget

* chore: add hover effect to event card itself

* feat: draggable event cards

* feat: drag target WIP

* chore: revert "chore: send DateCellDataPB instead of timestamp"

This reverts commit 1faaf21c6a50ac67da70ddf3bcfa8278ca5963d4.

* chore: remove timezone from date cell data

* fix: #2498 open calendar event faster

* chore: remove unused timezone

* feat: implement logic for rescheduling events

* fix: reschedule doesn't show up on UI

* fix: reorganize gesture detection layering

* fix: layout fix

* test: fix date single sort test

* chore: remove unused chrono-tz

* chore: add hint to unscheduled event popover

* chore: apply suggestions to 3 files

* fix: #2569 fix overflow

* chore: add timezone data to DateTypeOption

* test: make date tests run on Etc/UTC timezone

* chore: fix clippy warnings

* fix: use the right get db function

* chore: code cleanup

* test: run tests in utc

* test: fix tests

---------

Co-authored-by: nathan <nathan@appflowy.io>
2023-05-31 16:52:37 +08:00
Nathan.fooo 188b36cae6 feat: import cvs from file (#2667)
* refactor: import file

* chore: fix tarui build
2023-05-31 14:08:54 +08:00
Nathan.fooo 2247fa8edb chore: add default text when adding a new field (#2664) 2023-05-30 17:11:16 +08:00
Daniyar Nurmukhamet acc1d779c5 feature: changed url field ux to be directly editable (#2523)
* feature: changed url field ux to be directly editable

* feature: added link svg icon
2023-05-30 15:27:26 +08:00
Lucas.XuandAkarsh Jain dac4bd88e0 feat: Implement window size settings saving (#2648)
This commit addresses the feature request to save the window size settings.
The application will now remember the user's preferred window size, allowing
for a more personalized and seamless user experience.

Fixes: #2544

Co-authored-by: Akarsh Jain <akarsh.jain.790@gmail.com>
2023-05-30 11:06:23 +08:00
Nathan.fooo 65a910291b fix: disable edit update or create field (#2657)
* feat: enable hide the grid property in row detail page

* feat: disable update the updatedAt or createdAt cell
2023-05-30 10:43:19 +08:00
Nathan.fooo f0c440dcad feat: enable hide the grid property in row detail page (#2656) 2023-05-30 10:30:32 +08:00
Nathan.fooo 107662dceb feat: checklist improve (#2653)
* feat: improve checklist

* feat: reimplement checklist

* test: fix
2023-05-30 09:41:33 +08:00
Lucas.Xu dc73df4203 chore: update editor version (#2654)
* fix: revert remove action container space in mobile

* fix: setup the background color of the slash menu when clicking the add button

* fix: #2634 Visual bug in divider between main editor area and top area

* fix: v0.2 bugs

* feat: implement auto scroll when selection updated

* chore: update intl
2023-05-30 07:55:58 +08:00
chirag paneliya 57389d1fdd fix: color not show issue when change cover photo color. (#2624)
* fixe: color not show issue when change cover photo color.

* fix:added missing a required comma. and toColor() extension
2023-05-29 22:08:56 +08:00
Nathan.fooo 6bbdc7ceff refactor: group event (#2640)
* refactor: group event

* fix: tauri build
2023-05-28 22:54:03 +08:00
Nathan.fooo 75d40b79d0 fix: some bugs (#2639)
* fix: invalid index when insert row

* fix: auto fill 0 in front of number start with .

* fix: #2591

* chore: split the update at and create at test

* chore: fix tauri build
2023-05-28 16:14:25 +08:00
Mathias Mogensen cdfb634aa6 chore: upgrade flutter to 3.10.1 (#2619)
* chore: upgrade flutter and dart

* ci: upgrade flutter in cicd

* fix: remove textstyle_extensions from flowy_infra

* ci: upgrade flutter in cicd

* fix: update flutter.toml

* fix: deprecations and ffi

* fix: move json_annotation to dependencies

Must have accidentally moved it to dev_dependencies when upgrading dependencies

* fix: update editor ref and use fold

* chore: try with generate true
2023-05-28 12:09:39 +08:00
Nathan.fooo 45d0d41830 chore: import history database (#2638) 2023-05-27 21:29:18 +08:00
Askarbek Zadauly 6935653e15 chore: Edit Row changes (#2564)
* chore: checklist value and popup

* chore: properties side panel

* chore: reorganize checklist field

* chore: delete property promt

* chore: delete property reorganize

* fix: dnd bug of checklist field

* fix: whitespace on empty fields

* chore: new checklist item

* fix: duplicate view

* fix: named checklist bars

* chore: checklist padding

* fix: onclick

* chore: change to nullish coalescing operator

* chore: remove empty string from use translation

* fix: add missing translations

* chore: refactor select option and checklist field editors
2023-05-27 21:12:14 +08:00
Mohammad Zolfaghariandnathan 9a213fa562 feat: created at and updated at field type (#2572)
* feat: created at and updated at field type

* style: context for rust asserts, change checks in flutter

* fix: mistake in if condition

* style: add comma end of array

* feat: created at and updated at field type

* fix: typo in const variable

* style: cargo fmt

* refactor: opti cell insert

* chore: remove redundant clone

* refactor: date type option

* fix: tauri build

---------

Co-authored-by: nathan <nathan@appflowy.io>
2023-05-26 18:34:17 +08:00
Richard Shiue a85cc62a58 fix: flutter windows ci (#2621) 2023-05-26 09:55:40 +08:00
Lucas.Xu 386182e295 fix: slash menu background color (#2616) 2023-05-26 09:52:47 +08:00
Nathan.fooo 70bb7f2ad6 Feat: import and export csv (#2617)
* feat: import csv

* feat: export

* chore: implement import export csv in the backend

* chore: patch
2023-05-25 23:22:23 +08:00
Lucas.Xu 2746666123 feat: optimzie the hover block action (#2607)
* feat: optimzie the hover block action

* fix: duplicate view CI error
2023-05-24 10:45:28 +08:00
Nathan.fooo 65cc2040e5 fix: view name update (#2606)
* fix: update the view name

* fix: pass invalid view id
2023-05-24 08:57:58 +08:00
Nathan.fooo 056e2d49d0 feat: integrate postgres storage (#2604)
* chore: env config

* chore: get user workspace

* feat: enable postgres storage

* chore: add new env

* chore: add set env ffi

* chore: pass env before backend init

* chore: update

* fix: ci tests

* chore: commit the generate env file

* chore: remove unused import
2023-05-23 23:55:21 +08:00
Lucas.Xu 51a7954af7 fix: always open the readme file (#2603) 2023-05-23 19:55:43 +08:00
Lucas.Xu 74ff6772db feat: support import document from v0.1.x (#2601) 2023-05-23 19:42:53 +08:00
Lucas.Xu ffff628359 feat: document migration from 0.1.x to 0.2.0 (#2583)
* chore: migrate the rewrite feature

* chore: rename flowy-document

* feat: add initial_data interface

* chore: rename the document event

* fix: font name error

* fix: export page UI issues

* feat: implement editor migration 0.1.x -> 0.2.0

* feat: support import old json

* fix: nested list error

* chore: update pubspec
2023-05-23 16:13:12 +08:00
Mathias Mogensen f8d09e4894 fix: select all in code block handler (#2538)
* fix: select all in code block handler

Closes: #2320

* fix: do not force unwrap in toDocument

* fix: refactor unwrapping and selection
2023-05-22 10:54:08 +08:00
Kilu.He b41b212b0d Support block toolbar (#2566)
* feat: support block toolbar in left side

* fix: export delete and duplicate

* feat: slash menu
2023-05-22 09:33:37 +08:00
Nathan.fooo ca7777e891 fix: implement move row in backend (#2575) 2023-05-21 22:47:08 +08:00
Lucas.Xuandnathan d842f228e8 feat: Integrate supabase (#2551)
* feat: integrate supabase auth service

* chore: ignore the sercet

* feat: separate and inject the auth service

* chore: integrate auth service into sign in/up page

* feat: integrate github and google sign in

* chore: update user trait

* feat: box any params in UserCloudService trait

* feat: add flowy-server crate

* refactor: user trait

* docs: doc ThirdPartyAuthPB

* feat: server provider

* feat: pass the uuid to rust side

* feat: pass supabase config to rust side

* feat: integrate env file

* feat: implement login as guest

* feat: impl postgrest

* test: use env

* chore: upper case key

* feat: optimize the file storage

* fix: don't call set auth when user login in local

* docs: add docs

* feat: create/update/get user using postgrest

* feat: optimize the login as guest

* feat: create user workspace

* feat: create user default workspace

* feat: redesign the setting path location page

* feat: use uuid as view id

* feat: send auth info to rust backend

* fix: sign up

* fix: skip to wrong page after login

* fix: integrate test error

* fix: indent command error

* feat: add discord login in type

* fix: flutter analyze

* ci: fix rust tests

* ci: fix tauri build

* ci: fix tauri build

---------

Co-authored-by: nathan <nathan@appflowy.io>
2023-05-21 18:53:59 +08:00
Nathan.fooo 5cc8340e05 chore: Merge main 521 (#2574)
* chore: merge main branch

* chore: remove document plugins

* chore: add color generator

* ci: tests
2023-05-21 15:08:50 +08:00
Nathan.fooo eaa1dcdeb9 chore: refresh UI after deleting all sorts (#2573)
* chore: disable snapshot for now

* chore: notify the fronted to refresh after deleting all the sorts
2023-05-21 12:08:14 +08:00
Nathan.fooo 6c31cf9555 fix: number sort (#2570)
* chore: remove sign

* fix: sort number

* chore: update patch

* ci: fix dart test

* chore: fmt
2023-05-21 11:13:22 +08:00
Richard Shiue bb681bdd1e refactor: clean up code (#2550) 2023-05-19 18:28:13 +08:00
Kilu.He f23c6098a7 Support to show text action toolbar when the selection exists and the range is not collapsed (#2525)
* feat: support text action menu

* fix: selection bugs

* fix: review suggestions

* fix: ci tsc failed
2023-05-19 14:56:43 +08:00
Nathan.fooo f04d64a191 feat: config (#2552)
* feat: save project config

* feat: implement dart key value store
2023-05-17 16:33:44 +08:00
Lucas.Xu d01afab96e feat: optimize startup task and integrate supabase 2023-05-17 13:54:26 +08:00
Nathan.foooandLucas.Xu 19ee0ea44d refactor: kv (#2548)
* refactor: kv

* Update frontend/rust-lib/flowy-sqlite/src/kv/kv.rs

Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>

---------

Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
2023-05-17 12:46:48 +08:00
Lucas.Xu 623f182bba feat: add toggle list and integrate add block button (#2547) 2023-05-17 11:02:55 +08:00
Nathan.fooo bc66f43f47 Refactor: delete unused crates (#2543)
* refactor: delete user model

* refactor: delete user model crate

* refactor: rm flowy-server-sync crate

* refactor: rm flowy-database and flowy-folder

* refactor: rm folder-model

* refactor: rm database model

* refactor: rm flowy-sync

* refactor: rm document-model

* refactor: rm flowy-document

* refactor: rm flowy-client-sync

* refactor: rm ws-model

* refactor: rm flowy-revisoin

* refactor: rm revision-model

* refactor: rm flowy-folder

* refactor: rm flowy-client-ws

* refactor: move crates

* chore: move configuration file

* ci: fix tauri build'

* ci: fix flutter build

* ci: rust test script

* ci: tauri pnpm version conflict

* ci: tauri build
2023-05-17 09:49:39 +08:00
Lucas.Xuandnathan 2202326278 feat: integrate new editor (#2536)
* feat: update editor

* feat: integrate new editor

* feat: integrate the document2 into folder2

* feat: integrate the new editor

* chore: cargo fix

* chore: active document feature for flowy-error

* feat: convert the editor action to collab action

* feat: migrate the grid and board

* feat: migrate the callout block

* feat: migrate the divider

* chore: migrate the callout and math equation

* feat: migrate the code block

* feat: add shift + enter command in code block

* feat: support tab and shift+tab in code block

* fix: cursor error after inserting divider

* feat: migrate the grid and board

* feat: migrate the emoji picker

* feat: migrate openai

* feat: integrate floating toolbar

* feat: migrate the smart editor

* feat: migrate the cover

* feat: add option block action

* chore: implement block selection and delete option

* feat: support background color

* feat: dismiss color picker afer setting color

* feat: migrate the cover block

* feat: resize the font

* chore: cutomsize the padding

* chore: wrap the option button with ignore widget

* feat: customize the heading style

* chore: optimize the divider line height

* fix: the option button can't dismiss

* ci: rust test

* chore: flutter analyze

* fix: code block selection

* fix: dismiss the emoji picker after selecting one

* chore: optimize the transaction adapter

* fix: can't save the new content

* feat: show export page when some errors happen

* feat: implement get_view_data for document

---------

Co-authored-by: nathan <nathan@appflowy.io>
2023-05-16 14:58:24 +08:00
Kilu.He 99c48f7100 Support range selection and refactor data update mechanism and optimize outdent/indent operations (#2514)
* refactor: simplify data update logic and optimize outdent/indent operations

* feat: support range selection

* fix: review suggestions
2023-05-16 10:54:40 +08:00
Nathan.fooo f9862c501c chore: fix typo (#2540) 2023-05-16 08:53:09 +08:00
Nathan.fooo 6dcf69f151 chore: build collab with appflowy collab builder (#2537) 2023-05-15 22:16:05 +08:00
a978b29748 chore: merge remote-tracking branch 'main' into develop (#2530)
* feat: show unscheduled events in calendar toolbar (#2411)

* refactor: use same show row detail function

* fix: adjust popover offset

* feat: show unscheduled events in toolbar

* chore: apply suggestions from Xazin

* refactor: refactor list item into separate widget

---------

Co-authored-by: Nathan.fooo <86001920+appflowy@users.noreply.github.com>

* fix: default include time (#2444)

* fix: default include time

* chore: clarify logic and add comments

* chore: bump version 0.1.4 (#2455)

* chore: Update README.md

Update product screenshots

* fix: wrong day of week (#2468)

* feat: select which properties to show in calendar (#2482)

* feat: improve sidebar item dragged appearance (#2471)

* fix: show delete icon for document icon properly (#2475)

* feat: add hover effect on an event card (#2487)

* chore: delete unncessary openCard method in RowCardContainer

* chore: delete unnessary code and add comment

* chore: update editor v0.1.12 and format the readme (#2489)

* fix: number sort (#2507)

* bump version 0.1.5 (#2506)

* chore: bump version 0.1.5

* fix: could not trigger slash menu after inserting an emoji

* Revert "feat: add hover effect on an event card (#2487)"

This reverts commit f0a4b4b77d.

* feat: add hover effect on an event card

* fix: #2469 duplicated cover

* chore: update changelog.md (#2510)

* chore: Update README.md

Add a screenshot of the calendar view

* fix: some regressions

---------

Co-authored-by: Nathan.fooo <86001920+appflowy@users.noreply.github.com>
Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
Co-authored-by: Annie <anqi.annie.wang@gmail.com>
Co-authored-by: Yijing Huang <hyj891204@gmail.com>
2023-05-15 11:18:08 +08:00
Nathan.fooo 17a0a79379 fix: tests (#2516) 2023-05-15 10:56:01 +08:00
Kilu.He 37345578c1 fix: rectangular selection (#2480) 2023-05-12 08:24:24 +08:00
Nathan.fooo a2b592a59b fix: number sort (#2508) 2023-05-11 18:35:51 +08:00
Nathan.fooo 2a35787dd1 Feat/rename views (#2495)
* refactor: rename belongings to child views

* test: fix test
2023-05-10 19:43:32 +08:00
Kilu.He bc723f8d0f chore: update node version to 18.16.0 and update pnpm version to 8.5.0 (#2492) 2023-05-10 17:21:41 +08:00
Kilu.He dad0419da0 feat: support code block (#2464) 2023-05-10 15:53:30 +08:00
Nathan.fooo 0b343f7ee1 ci: tauri ci with path (#2490) 2023-05-10 14:45:39 +08:00
Nathan.foooandqinluhe a9c06632ad ci: tauri build (#2485)
* ci: tauri build

* ci: tauri build

* chore: update appflowy-collab version

* ci: fix build

* ci: tauri with pnpm

* ci: fix build

* ci: comment out includetime

* chore: add the --quiet option (to only output errors and not warnings) to the configuration file

* ci: enable linux platform

---------

Co-authored-by: qinluhe <qinluhe.twodog@gmail.com>
2023-05-10 13:27:50 +08:00
Richard Shiue 376f2d887d feat: rewrite date logic (#2390)
* chore: remove unused fields

* chore: rewrite date logic

* chore: apply suggestions from Alex

* chore: add space in date format

* chore: re-add error handling in apply-changeset
2023-05-09 22:37:20 +08:00
Kilu.He ba8cbe170c Support divider block and callout block (#2457)
* feat: divider block

* feat: callout block
2023-05-08 10:31:35 +08:00
nathan 96c058db9b chore: fix compile 2023-05-08 10:30:24 +08:00
Kilu.He 12151d1f3b feat: support toggle list (#2456) 2023-05-05 10:13:39 +08:00
Kilu.He e2ced6524f Feat/number list block (#2453)
* feat: support bulleted list block

* feat: support number list block
2023-05-04 17:20:23 +08:00
nathan ad99998d33 chore: Merge branch 'main' into develop 2023-05-04 13:34:55 +08:00
Kilu.He cf97c8ba9c Support block config (#2419)
* fix: refactor block config
2023-05-04 11:24:35 +08:00
Nathan.fooo 1f187a3917 fix: number format (#2445) 2023-05-03 16:47:02 +08:00
Kilu.He 76b94e363e Support quote block (#2415)
* feat: support quote block

* fix: database ts error
2023-05-03 14:54:07 +08:00
Kilu.He 7db36e3f1e feat: checkbox block (#2413) 2023-05-03 11:18:25 +08:00
Nathan.fooo 93d787a9ae Fix: flutter test (#2421)
* fix: tauri compile

* ci: update

* fix: flutter test
2023-05-02 17:10:35 +08:00
Kilu.He f5b23e5fc1 feat: Support heading block (#2376)
* feat: support transform heading block according to markdown

* fix: folder scroll
2023-05-01 15:40:56 +08:00
Askarbek Zadaulyandqinluhe 55cb7acc7f feat: tauri kanban fixes (#2273)
* chore: group cards count

* chore: delete board card

* chore: date time format read and update

* fix: move field

* fix: dnd fields

* chore: number format popup

* chore: refactor date options

* chore: replace button in DateFormatPopup with PopupItem

---------

Co-authored-by: qinluhe <qinluhe.twodog@gmail.com>
2023-04-30 17:01:25 +08:00
Nathan.fooo 2838cd5e0c Feat/tauri build (#2378)
* fix: tauri compile

* ci: update
2023-04-28 20:47:40 +08:00
qinluhe 070ac051b1 fix: support up/down/left/right keyboard event to move cursor (#2365) 2023-04-28 17:08:58 +08:00
Nathan.fooo 32bd0ffca2 feat: migrate flowy-database (#2373)
* feat: add flowy-database2

* chore: config type option data

* chore: impl type option

* feat: config group

* fix: group compile

* feat: add sort

* chore: setting

* chore: insert with specific type

* chore: custom group

* chore: rename any map

* chore: use group setting

* chore: update

* chore: open database event

* chore: update database editor

* chore: update

* chore: update view editor

* chore: update

* chore: update view editor

* chore: sort feat

* chore: update handler

* chore: update

* chore: config handler event

* feat: impl handlers

* feat: impl handlers

* chore: layout setting

* feat: impl handlers

* chore: remove flowy-folder ref

* chore: integrate flowy-database2

* feat: get cell

* chore: create database with data

* chore: create view

* chore: fix dart compile

* fix: some bugs

* chore: update

* chore: merge develop

* chore: fix warning

* chore: integrate rocksdb

* fix: rocksdb compile errros

* fix: update cell

* chore: update the bundle identifier

* fix: create row

* fix: switch to field

* fix: duplicate grid

* test: migrate tests

* test: migrate tests

* test: update test

* test: migrate tests

* chore: add patch
2023-04-28 14:08:53 +08:00
qinluhe 243f062d4f feat: support to break wrap the text block when triggering shift+enter (#2360)
* fix: make TextBlock's keydown event code easier to maintain

* fix: support  to break wrap the text block
2023-04-27 15:39:16 +08:00
qinluhe a0efd206a9 fix: modify some eslint rule (#2359) 2023-04-27 10:53:22 +08:00
qinluhe 9717dfa3c4 fix: refactor match change code (#2352) 2023-04-26 13:14:38 +08:00
qinluhe eb78f9d36a fix: make it unidirectional data flow by listening to document updates (#2347) 2023-04-25 19:10:08 +08:00
qinluhe 1ad2f6cef5 fix: set cursor after operation (#2343) 2023-04-25 15:52:57 +08:00
973cd9194d feat: Support ui update when receive doc changes (#2270)
* fix: add  method

* fix: update text block and doc title

* fix: support ui update when receive doc changes

* fix: modify the subscribe change

* chore: add test for document manager

* chore: add test for document manager

* chore: add insert and update test for document manager

* fix: load document data

* fix: add update page block test

* fix: try fix again

* fix: node can not rerender when the node data change

* fix: it should cover all content when the text delta updated

* fix: add insert and delete operation in left menu

* fix: put the UI Actions in async thunks

* fix: remove log

* fix: split text block

* fix: review code

---------

Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
Co-authored-by: nathan <nathan@appflowy.io>
2023-04-24 14:25:00 +08:00
Nathan.fooo 0068c7e731 fix: compile errors (#2310) 2023-04-21 17:02:26 +08:00
Lucas.Xu c009347735 Merge remote-tracking branch 'origin/main' into develop
# Conflicts:
#	frontend/appflowy_flutter/lib/plugins/database_view/application/database_view_service.dart
#	frontend/appflowy_flutter/lib/plugins/document/presentation/plugins/base/link_to_page_widget.dart
#	frontend/appflowy_flutter/lib/plugins/trash/application/trash_bloc.dart
#	frontend/appflowy_flutter/lib/plugins/trash/application/trash_service.dart
#	frontend/appflowy_flutter/lib/workspace/application/app/app_bloc.dart
#	frontend/appflowy_flutter/lib/workspace/application/app/app_service.dart
#	frontend/appflowy_flutter/lib/workspace/application/menu/menu_bloc.dart
#	frontend/appflowy_flutter/lib/workspace/application/workspace/workspace_service.dart
#	frontend/appflowy_flutter/lib/workspace/presentation/home/menu/app/header/header.dart
#	frontend/appflowy_flutter/test/bloc_test/grid_test/filter/filter_util.dart
#	frontend/appflowy_flutter/test/bloc_test/grid_test/grid_bloc_test.dart
#	frontend/appflowy_flutter/test/bloc_test/grid_test/util.dart
#	frontend/appflowy_flutter/test/bloc_test/home_test/view_bloc_test.dart
#	frontend/rust-lib/flowy-database/src/services/database/database_editor.rs
#	frontend/rust-lib/flowy-database/src/services/persistence/migration/database_view_migration.rs
2023-04-18 19:06:21 +08:00
qinluhe 07947db98b feat: split create document and open document (#2261)
* fix: add  method

* fix: update text block and doc title
2023-04-17 10:12:04 +08:00
Lucas.Xu 3b1152615a chore: add tracing to document2 (#2263) 2023-04-14 20:14:47 +08:00
qinluhe 0e5a03a282 Merge pull request #2258 from qinluhe/feat/refactor-tauri-document
Feat/refactor tauri document
2023-04-14 10:14:29 +08:00
qinluhe 4582413e89 fix: modify blocks pb 2023-04-14 09:23:22 +08:00
qinluhe 9ed5bfa51e fix: delete useless files 2023-04-13 19:41:31 +08:00
Lucas.Xu ec89e9517b feat: init flowy document 2 (#2248)
* feat: init flowy document 2

* feat: convert inner document to document PB

* feat: integrate colla document into Flutter

* feat: integrate colla document into tauri

* fix: cargo clippy
2023-04-13 18:53:51 +08:00
qinluhe c7eb490db4 Merge pull request #2230 from Ascarbek/feat/tauri-grid
Feat: tauri grid
2023-04-13 10:55:07 +08:00
ascarbek 125eaf49a9 refactor: color item 2023-04-11 22:10:28 +06:00
ascarbek 73c4a33191 fix: separate icons page 2023-04-11 16:37:21 +06:00
Mikias Tilahun Abebe 68bfa0b9cd fix: remove try catch for global error boundary 2023-04-11 11:03:18 +03:00
qinluhe d42084f242 Merge branch 'develop' of github.com:AppFlowy-IO/AppFlowy into refactor-tauri-document 2023-04-11 10:45:11 +08:00
qinluhe 886766c887 refactor: document controller 2023-04-11 10:35:47 +08:00
Mikias Tilahun Abebe 37a6b54e82 feat/implement error boundary 2023-04-10 18:24:08 +03:00
Nathan.fooo 341dce67d4 test: add tauri format test (#2229) 2023-04-10 22:50:00 +08:00
ascarbek 43cafdd524 fix: change to url error 2023-04-09 21:15:29 +06:00
ascarbek 2d85afe168 chore: HOC popup window 2023-04-09 20:13:53 +06:00
ascarbek 44585079b6 chore: import reorganize and edit option on grid 2023-04-09 18:38:18 +06:00
Mike Abebe a33fc3dd60 feat/implement field options edit and change field option type functionality 2023-04-09 14:34:32 +03:00
ascarbek e3b7864a91 chore: edit option name and color 2023-04-07 22:03:40 +06:00
ascarbek 6bbf6873d6 chore: edit cell options wip 2023-04-07 21:02:04 +06:00
Mike Abebe bc9b1a5c33 fix: change grid type import 2023-04-07 14:51:16 +03:00
ascarbek 8b68b1390c Merge branch 'feat/tauri-kanban-fixes' into feat/tauri-grid 2023-04-07 17:39:18 +06:00
ascarbek 915494761a chore: close on esc 2023-04-07 17:25:04 +06:00
ascarbek e467481b75 chore: group popup 2023-04-07 16:52:34 +06:00
ascarbek c3a7f94cb3 chore: board toolbar 2023-04-07 16:22:11 +06:00
ascarbek 033a231b67 chore: board title and show icons on design page 2023-04-06 15:38:50 +06:00
ascarbek d2b0f7e6b0 chore: imports optimise 2023-04-06 14:46:49 +06:00
ascarbek 0c211188f0 Merge branch 'upstream-develop' into feat/tauri-kanban-fixes 2023-04-05 21:35:20 +06:00
Mike Abebe 4f08654fc3 feat/add new field functionality done 2023-04-05 17:25:07 +03:00
Mike Abebe db1184ff0d feat/add row functionality done 2023-04-05 17:13:52 +03:00
Mike Abebe 764ec73e94 feat/integrate number to grid 2023-04-05 16:56:59 +03:00
Mike Abebe 4d5a3ee13d feat/integrate url to grid 2023-04-05 16:07:15 +03:00
ascarbek 034d4d9bf4 chore: return database rows on open 2023-04-04 17:23:15 +06:00
ascarbek ed977868cf Merge branch 'feat/tauri-move-fields' into feat/tauri-grid
# Conflicts:
#	frontend/appflowy_tauri/src/appflowy_app/components/_shared/EditRow/DatePickerPopup.tsx
#	frontend/appflowy_tauri/src/appflowy_app/components/_shared/EditRow/EditCellWrapper.tsx
#	frontend/appflowy_tauri/src/appflowy_app/components/_shared/EditRow/EditCheckboxCell.tsx
#	frontend/appflowy_tauri/src/appflowy_app/components/_shared/EditRow/EditRow.tsx
#	frontend/appflowy_tauri/src/appflowy_app/components/board/BoardCell.tsx
#	frontend/appflowy_tauri/src/appflowy_app/stores/effects/database/database_bd_svc.ts
#	frontend/appflowy_tauri/src/appflowy_app/stores/effects/database/database_controller.ts
2023-04-04 17:16:05 +06:00
Mike Abebe 8ccc2414c8 feat/integrate checkbox to grid 2023-04-04 13:03:58 +03:00
Mike Abebe 6977e5e65c feat/integrate single select options to grid 2023-04-04 12:50:33 +03:00
Mike Abebe e38398e235 feat/integrate single select options to grid 2023-04-04 12:46:39 +03:00
nathan b8ade5af12 chore: Merge branch 'main' into develop 2023-04-04 14:40:13 +08:00
Mike Abebe da45531801 feat/show edit popup on expand icon click 2023-04-04 09:23:21 +03:00
Nathan.fooo ddd3fbb178 fix: tauri folder display (#2176)
* fix: tauri folder display

* refactor: rename layout type
2023-04-04 14:08:50 +08:00
Nathan.fooo e1c8135f5d refactor: folder with yrs
* feat: try using folder2

* feat: update

* feat: implement handlers

* fix: compile errors

* chore: add unsafe send + sync

* feat: remove unsafe impl

* fix: replace folder with foler2

* chore: dart compile errors

* test: fix test

* test: fix test

* test: bypass existing tests

* feat: open latest view

* chore: fix dart warnings

* chore: config notification

* fix: folder notification  bugs

* fix: doesn't open the new view after creating

* chore: rename struct

* refactor: user id

* test: fix test

* chore: remove unused user_id

* fix: fix read workspace views

* chore: rename appflowy data folder

* chore: update ref

* fix: tauri build
2023-04-04 08:41:16 +08:00
ascarbek 2f2736df20 chore: save and get checkbox cell 2023-04-03 21:33:33 +06:00
ascarbek 2c13cccb4f chore: save and get date cell 2023-04-03 21:07:59 +06:00
ascarbek 7970e7fae3 fix: gridpage error 2023-03-31 20:03:44 +06:00
ascarbek 75f7b9765d chore: edit grid row 2023-03-31 19:51:30 +06:00
ascarbek ac2a0c5b91 Merge branch 'feat/tauri-kanban' into feat/tauri-grid
# Conflicts:
#	frontend/appflowy_tauri/src/appflowy_app/components/_shared/EditRow/EditCellText.tsx
#	frontend/appflowy_tauri/src/appflowy_app/components/_shared/EditRow/EditCellWrapper.tsx
#	frontend/appflowy_tauri/src/appflowy_app/components/_shared/EditRow/EditFieldPopup.tsx
#	frontend/appflowy_tauri/src/appflowy_app/components/_shared/EditRow/EditRow.tsx
#	frontend/appflowy_tauri/src/appflowy_app/components/_shared/database-hooks/useCell.ts
#	frontend/appflowy_tauri/src/appflowy_app/components/_shared/database-hooks/useRow.ts
#	frontend/appflowy_tauri/src/appflowy_app/components/board/BoardTextCell.tsx
2023-03-31 19:30:53 +06:00
ascarbek c7acf9a594 chore: move fields dnd 2023-03-30 18:44:16 +06:00
ascarbek d1d667c497 chore: options in board 2023-03-30 16:32:37 +06:00
ascarbek b21ed2488b chore: small code cleanups 2023-03-30 16:02:12 +06:00
ascarbek 03eaf0b4cb chore: date picker 2023-03-30 03:29:23 +06:00
ascarbek b9e49f109d fix: save url cell 2023-03-29 13:30:42 +06:00
ascarbek b03b2705f0 Merge branch 'upstream-main' into feat/tauri-kanban 2023-03-29 13:18:07 +06:00
ascarbek 521fe13cfb fix: close popup on lang select 2023-03-27 19:28:26 +06:00
ascarbek 09445411a3 chore: language button 2023-03-27 19:09:51 +06:00
ascarbek f86254c8ef chore: edit url cell 2023-03-27 18:42:23 +06:00
qinluhe 35c21c0d84 refactor: document component 2023-03-27 14:40:07 +08:00
ascarbek c50c23bc3a fix: select options for new row 2023-03-27 02:58:12 +06:00
ascarbek a8a35dcbec chore: cell options write to backend 2023-03-27 02:39:15 +06:00
ascarbek f390658ee0 fix: cell options positions 2023-03-27 01:12:03 +06:00
ascarbek 994e204097 fix: padding fixes for cell wrapper 2023-03-27 01:09:38 +06:00
ascarbek 5825195b8e chore: cell options layout 2023-03-27 00:59:49 +06:00
qinluhe df66521f13 refactor: document data and update 2023-03-25 17:38:58 +08:00
Mike Abebe 8323614583 feat: write grid cell data to backend for only text fieldtype 2023-03-25 11:54:04 +03:00
ascarbek 5762419aae chore: fade in change 2023-03-24 20:56:48 +06:00
ascarbek bd8d816862 chore: update editing cell 2023-03-24 20:53:45 +06:00
ascarbek 5ddb5100ad chore: change field type 2023-03-24 20:20:56 +06:00
ascarbek 27a8eea6e2 chore: fade in, out 2023-03-24 20:02:52 +06:00
ascarbek 6e24af9c68 tempfix: rows misfire temp fix 2023-03-24 18:24:28 +06:00
ascarbek da19987f4b wip: edit cell type 2023-03-24 17:56:53 +06:00
ascarbek 6f4b11f468 chore: don't show group by field 2023-03-24 13:28:30 +03:00
ascarbek 98e9ba19d6 chore: edit row components reorganize 2023-03-24 13:28:30 +03:00
ascarbek 4545410703 chore: column rename 2023-03-24 13:28:30 +03:00
ascarbek c453d734ab chore: add column and edit text cell 2023-03-24 13:28:30 +03:00
ascarbek 0719f54dec chore: initial edit board modal 2023-03-24 13:28:30 +03:00
qinluhe 7781b912f0 feat: add left tool when hover on block 2023-03-24 16:51:07 +08:00
qinluhe c6c97f7c83 feat: the feature of delete block 2023-03-24 16:51:07 +08:00
qinluhe a38c213744 fix: Optimize the re-render node when the selection changes 2023-03-24 16:50:59 +08:00
Mike Abebe 073adf6268 feat/integrate table with backend 2023-03-23 13:29:30 +03:00
ascarbek d05cc4005b chore: don't show group by field 2023-03-23 00:54:28 +06:00
ascarbek da1ee430b0 chore: edit row components reorganize 2023-03-23 00:07:17 +06:00
ascarbek 13e9b29eef chore: column rename 2023-03-23 00:04:51 +06:00
ascarbek c0c302bdfd chore: add column and edit text cell 2023-03-22 19:54:42 +06:00
Mike Abebe 5da5d92b8a fix/move grid view options to dropdown 2023-03-22 08:51:27 +03:00
ascarbek 47429e2fd2 Merge branch 'feat/tauri-kanban' into feat/tauri-edit-kanban-row 2023-03-21 11:24:26 +06:00
ascarbek 07b183aef2 Merge remote-tracking branch 'origin/feat/tauri-kanban' into feat/tauri-kanban 2023-03-21 11:22:53 +06:00
ascarbek dc97912dba fix: kanban board rendering 2023-03-21 11:22:42 +06:00
ascarbek 2825e19465 chore: initial edit board modal 2023-03-21 10:50:59 +06:00
nathan baa67e2aed chore: fix import references 2023-03-21 08:18:11 +08:00
ascarbek d60c39d483 chore: dnd reordering 2023-03-17 15:13:51 +06:00
ascarbek 745ee264c8 Merge branch 'upstream-main' into feat/tauri-kanban
# Conflicts:
#	frontend/appflowy_tauri/src/appflowy_app/stores/effects/database/database_bd_svc.ts
2023-03-17 13:22:05 +06:00
ascarbek 4b1f45a4be fix: groups observer dispose 2023-03-17 13:13:04 +06:00
ascarbek fa427fe650 chore: move row into other block 2023-03-16 18:59:05 +06:00
ascarbek ab5b40fa51 chore: move rows in group 2023-03-16 18:55:06 +06:00
ascarbek 60676fdc41 fix: dispose cell controller 2023-03-15 21:42:44 +06:00
ascarbek 96be3c6ebe fix: dispose group controller 2023-03-15 20:19:09 +06:00
appflowy 1d6f74180f chore: update refs 2023-03-15 16:14:36 +08:00
ascarbek 6e028c4f64 Merge branch 'upstream-main' into feat/tauri-kanban
# Conflicts:
#	frontend/appflowy_tauri/src/appflowy_app/components/_shared/database-hooks/useCell.ts
#	frontend/appflowy_tauri/src/appflowy_app/components/_shared/database-hooks/useDatabase.ts
#	frontend/appflowy_tauri/src/appflowy_app/components/board/Board.tsx
#	frontend/appflowy_tauri/src/appflowy_app/components/board/BoardBlock.tsx
2023-03-15 11:34:21 +06:00
ascarbek d92c0bffd6 bug: kanban new row 2023-03-15 11:18:14 +06:00
ascarbek a66d457f10 chore: import beautiful dnd 2023-03-13 17:41:51 +06:00
appflowy 88e0f6a32c fix: appflowy session name 2023-03-13 16:09:11 +08:00
appflowy 34cb2b2a09 fix: create kanban board row 2023-03-13 15:57:45 +08:00
appflowy 5fb86c4002 Merge branch 'main' into feat/appflowy_tauri_3 2023-03-13 15:19:12 +08:00
appflowy 25707edbdd chore: set log level & remove empty line 2023-03-13 15:16:41 +08:00
appflowy 85f36ad877 chore: Merge branch 'main' into feat/appflowy_tauri_3 2023-03-13 15:14:11 +08:00
ascarbek c80e77ab16 chore: get board groups and rows 2023-03-12 22:29:03 +06:00
ascarbek a9c8bad599 Merge branch 'upstream-main' into feat/appflowy_tauri_3
# Conflicts:
#	frontend/appflowy_tauri/package.json
#	frontend/appflowy_tauri/src/appflowy_app/components/layout/HeaderPanel/Breadcrumbs.tsx
#	frontend/appflowy_tauri/src/appflowy_app/components/layout/MainPanel.tsx
#	frontend/appflowy_tauri/src/appflowy_app/components/layout/NavigationPanel/NavigationPanel.hooks.ts
#	frontend/appflowy_tauri/src/appflowy_app/components/layout/NavigationPanel/NavigationPanel.tsx
#	frontend/appflowy_tauri/src/appflowy_app/components/layout/NavigationPanel/PageItem.hooks.ts
#	frontend/appflowy_tauri/src/appflowy_app/components/layout/NavigationPanel/PageItem.tsx
#	frontend/appflowy_tauri/src/appflowy_app/components/layout/Screen.tsx
2023-03-12 17:19:06 +06:00
ascarbek 268b6ce926 chore: back and forward buttons nav scroll fix 2023-03-11 20:57:25 +06:00
ascarbek da8c39d0b6 fix: breadcrumbs 2023-03-10 19:50:10 +06:00
ascarbek 7e3273c708 chore: smooth scroll and scroll to new folder 2023-03-10 18:58:14 +06:00
ascarbek 67e396aadf chore: scroll down to new page 2023-03-10 18:33:54 +06:00
ascarbek 6304c7d95b chore: remove floating menu functions 2023-03-10 16:59:11 +06:00
ascarbek ad0a6d01d2 chore: remove offset top 2023-03-09 23:04:31 +06:00
ascarbek f556e50be4 fix: page rename position 2023-03-09 22:54:38 +06:00
ascarbek 593446bffe fix: nav item popup overflow 2023-03-09 22:22:55 +06:00
ascarbek 91e5219627 chore: move constants 2023-03-09 16:12:27 +06:00
ascarbek 2d8182c503 chore: save offset top of nav items 2023-03-09 15:16:41 +06:00
ascarbek 8e63f97f77 Merge remote-tracking branch 'origin/feat/appflowy_tauri_3' into feat/appflowy_tauri_3 2023-03-09 12:38:51 +06:00
ascarbek 3f3d30856d chore: add tauri clean 2023-03-08 09:19:00 +08:00
ascarbek 0a3231cd9a chore: add tauri clean 2023-03-07 13:28:49 +06:00
ascarbek aab62f4048 Merge branch 'upstream-main' into feat/appflowy_tauri_3
# Conflicts:
#	frontend/appflowy_tauri/src/appflowy_app/components/TestApiButton/TestGrid.tsx
#	frontend/appflowy_tauri/src/appflowy_app/stores/effects/database/database_controller.ts
2023-03-07 13:25:56 +06:00
ascarbek 79c1568295 chore: refactor row hook 2023-03-06 20:01:41 +06:00
ascarbek c8569d3c62 chore: move cell hook into custom cell component 2023-03-06 17:47:37 +06:00
ascarbek 3635b6b63e chore: create cell component for each field type 2023-03-06 17:39:11 +06:00
ascarbek 7ca4da0966 fix: change IDatabaseField fix eslint errors 2023-03-06 16:13:43 +06:00
ascarbek 557a524648 fix: remove warnings 2023-03-06 11:35:23 +06:00
ascarbek 88eeb6bd36 fix: post merge fix 2023-03-06 00:01:59 +06:00
ascarbek d1c29ec3e7 fix: post merge fixes 2023-03-05 23:43:59 +06:00
ascarbek fb8a81eca5 Merge remote-tracking branch 'origin/feat/appflowy_tauri_3' into feat/appflowy_tauri_3
# Conflicts:
#	frontend/appflowy_tauri/src/appflowy_app/components/layout/NavigationPanel/NavigationPanel.tsx
2023-03-05 23:38:19 +06:00
ascarbek e297769ac2 fix: highlight active page 2023-03-05 23:34:46 +06:00
ascarbek 543846c241 fix: nav panel and main panel animation on hide menu 2023-03-05 23:22:43 +06:00
ascarbek 84f41cec76 fix: min width for nav panel 2023-03-05 22:28:33 +06:00
ascarbek 3afca2b482 fix: new folder trash overflow 2023-03-05 22:19:46 +06:00
nathan b417fb5fdf ci: compile error 2023-03-04 19:27:18 +08:00
Nathan.fooo 0b2dc415af Merge branch 'feat/appflowy_tauri_3' into feat/appflowy_tauri_3 2023-03-04 19:18:17 +08:00
ascarbek d0558e4da1 fix: ci warning 2023-03-03 19:18:15 +06:00
ascarbek 7839ad26c4 fix: initially authenticated and serializable fix 2023-03-03 18:37:50 +06:00
ascarbek 075bf8f2fc Merge branch 'upstream-feat/appflowy_tauri_3' into feat/appflowy_tauri_3
# Conflicts:
#	frontend/appflowy_tauri/src/appflowy_app/components/TestApiButton/TestGrid.tsx
2023-03-03 17:17:11 +06:00
ascarbek 11649ef16d chore: (unstable) using controllers 2023-03-03 17:14:58 +06:00
nathan 24340f3091 chore: fix tauri build 2023-03-03 19:06:57 +08:00
nathan a2bdb08a84 chore: setup auto login 2023-03-03 17:58:45 +08:00
nathan 47ccfbf4ed chore: add profiling feature 2023-03-03 12:05:52 +08:00
nathan 24bf1c1893 chore: config tokio runtime subscriber 2023-03-03 10:05:19 +08:00
nathan 9b0fccbdda chore: update tokio version 2023-03-03 10:04:53 +08:00
nathan dcf8fd538d chore: format code 2023-03-02 20:28:46 +08:00
nathan c35db5c2a2 fix: high cpu usage 2023-03-02 19:47:37 +08:00
ascarbek 08bb4e4116 Merge remote-tracking branch 'origin/feat/appflowy_tauri_3' into feat/appflowy_tauri_3 2023-03-01 18:41:32 +06:00
nathan 2e4df44c29 chore: add get single select type option data 2023-03-01 20:16:25 +08:00
nathan f58c91fb3f fix: filter notification with id 2023-03-01 19:05:56 +08:00
nathan fd135fb664 chore: set tracing log to debug level 2023-03-01 18:45:52 +08:00
nathan c74308999d chore: delete/create row 2023-03-01 18:23:39 +08:00
ascarbek e5a1bd2c52 chore: change log class arguments 2023-03-01 16:04:51 +06:00
nathan a3f4dfacba chore: add delete field test 2023-03-01 14:17:17 +08:00
nathan 3619fadf57 chore: add edit / create field test 2023-03-01 14:04:59 +08:00
1575 changed files with 64169 additions and 62486 deletions

No files matched your search

+21 -4
View File
@@ -4,22 +4,26 @@ on:
push:
branches:
- "main"
- "develop"
- "release/*"
paths:
- ".github/workflows/flutter_ci.yaml"
- "frontend/**"
- "!frontend/appflowy_tauri/**"
pull_request:
branches:
- "main"
- "develop"
- "release/*"
paths:
- ".github/workflows/flutter_ci.yaml"
- "frontend/**"
- "!frontend/appflowy_tauri/**"
env:
FLUTTER_VERSION: "3.7.5"
RUST_TOOLCHAIN: "1.65"
FLUTTER_VERSION: "3.10.1"
RUST_TOOLCHAIN: "1.70"
jobs:
build:
@@ -62,12 +66,17 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
prefix-key: ${{ matrix.job.os }}
prefix-key: ${{ matrix.os }}
workspaces: |
frontend/rust-lib
- uses: davidB/rust-cargo-make@v1
with:
version: '0.36.6'
- name: Install prerequisites
working-directory: frontend
run: |
cargo install --force cargo-make
cargo install --force duckscript_cli
if [ "$RUNNER_OS" == "Linux" ]; then
sudo wget -qO /etc/apt/trusted.gpg.d/dart_linux_signing_key.asc https://dl-ssl.google.com/linux/linux_signing_key.pub
@@ -90,6 +99,7 @@ jobs:
elif [ "$RUNNER_OS" == "macOS" ]; then
flutter config --enable-macos-desktop
elif [ "$RUNNER_OS" == "Windows" ]; then
git config --system core.longpaths true
flutter config --enable-windows-desktop
fi
shell: bash
@@ -108,3 +118,10 @@ jobs:
working-directory: frontend
run: |
cargo make dart_unit_test
- uses: codecov/codecov-action@v3
with:
name: appflowy
flags: appflowy_flutter_unit_test
fail_ci_if_error: true
verbose: true
+13 -10
View File
@@ -6,14 +6,18 @@ on:
- "main"
- "release/*"
paths:
- "frontend/appflowy_flutter/**"
- ".github/workflows/flutter_ci.yaml"
- "frontend/**"
- "!frontend/appflowy_tauri/**"
pull_request:
branches:
- "main"
- "release/*"
paths:
- "frontend/appflowy_flutter/**"
- ".github/workflows/flutter_ci.yaml"
- "frontend/**"
- "!frontend/appflowy_tauri/**"
env:
CARGO_TERM_COLOR: always
@@ -35,7 +39,7 @@ jobs:
- uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version: "3.7.5"
flutter-version: "3.10.1"
cache: true
- name: Cache Cargo
@@ -116,10 +120,9 @@ jobs:
fi
shell: bash
# - uses: codecov/codecov-action@v3
# with:
# name: appflowy
# flags: appflowy
# env_vars: ${{ matrix.os }}
# fail_ci_if_error: true
# verbose: true
- uses: codecov/codecov-action@v3
with:
name: appflowy
flags: appflowy_flutter_integrateion_test
fail_ci_if_error: true
verbose: true
+3 -7
View File
@@ -6,8 +6,8 @@ on:
- "*"
env:
FLUTTER_VERSION: "3.7.5"
RUST_TOOLCHAIN: "1.65"
FLUTTER_VERSION: "3.10.1"
RUST_TOOLCHAIN: "1.70"
jobs:
create-release:
@@ -136,11 +136,7 @@ jobs:
fail-fast: false
matrix:
job:
- {
target: x86_64-apple-darwin,
os: macos-10.15,
extra-build-args: "",
}
- { target: x86_64-apple-darwin, os: macos-11, extra-build-args: "" }
steps:
- name: Checkout source code
uses: actions/checkout@v3
+12 -8
View File
@@ -4,6 +4,7 @@ on:
push:
branches:
- "main"
- "develop"
- "release/*"
paths:
- "frontend/rust-lib/**"
@@ -12,6 +13,7 @@ on:
pull_request:
branches:
- "main"
- "develop"
- "release/*"
paths:
- "frontend/rust-lib/**"
@@ -19,8 +21,8 @@ on:
env:
CARGO_TERM_COLOR: always
RUST_TOOLCHAIN: "1.65"
FLUTTER_VERSION: "3.7.5"
RUST_TOOLCHAIN: "1.70"
FLUTTER_VERSION: "3.10.1"
jobs:
test-on-ubuntu:
@@ -54,13 +56,19 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
prefix-key: ${{ matrix.job.os }}
prefix-key: 'ubuntu-latest'
workspaces: |
frontend/rust-lib
- name: Build FlowySDK
working-directory: frontend
run: |
cargo make --profile development-linux-x86_64 appflowy-core-dev
- name: Run rust-lib tests
working-directory: frontend/rust-lib
run: RUST_LOG=info RUST_BACKTRACE=1 cargo test --no-default-features --features="rev-sqlite"
- name: rustfmt rust-lib
run: cargo fmt --all -- --check
working-directory: frontend/rust-lib/
@@ -69,16 +77,12 @@ jobs:
run: cargo clippy --features="rev-sqlite"
working-directory: frontend/rust-lib
- name: Run rust-lib tests
working-directory: frontend/rust-lib
run: RUST_LOG=info cargo test --no-default-features --features="sync,rev-sqlite"
- name: rustfmt shared-lib
run: cargo fmt --all -- --check
working-directory: shared-lib
- name: clippy shared-lib
run: cargo clippy -- -D warnings
run: cargo clippy -- -D warnings
working-directory: shared-lib
- name: Run shared-lib tests
+2 -2
View File
@@ -11,8 +11,8 @@ on:
env:
CARGO_TERM_COLOR: always
FLUTTER_VERSION: "3.7.5"
RUST_TOOLCHAIN: "1.65"
FLUTTER_VERSION: "3.10.1"
RUST_TOOLCHAIN: "1.70"
jobs:
tests:
+16 -15
View File
@@ -6,16 +6,17 @@ on:
- "frontend/appflowy_tauri/**"
env:
NODE_VERSION: "16"
RUST_TOOLCHAIN: "1.65"
NODE_VERSION: "18.16.0"
PNPM_VERSION: "8.5.0"
RUST_TOOLCHAIN: "1.70"
jobs:
tauri-build:
strategy:
fail-fast: false
matrix:
# platform: [macos-latest, ubuntu-20.04, windows-latest]
platform: [macos-latest]
# platform: [macos-latest, ubuntu-latest, windows-latest]
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
@@ -35,7 +36,10 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
prefix-key: ${{ matrix.platform }}
prefix-key: 'ubuntu-latest-tauri'
workspaces: |
frontend/rust-lib
frontend/appflowy_tauri/src-tauri
- name: install dependencies (windows only)
if: matrix.platform == 'windows-latest'
@@ -45,15 +49,17 @@ jobs:
cargo install --force duckscript_cli
vcpkg integrate install
cargo make appflowy-tauri-deps-tools
npm install -g pnpm@${{ env.PNPM_VERSION }}
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-20.04'
if: matrix.platform == 'ubuntu-latest'
working-directory: frontend
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
cargo install --force cargo-make
cargo make appflowy-tauri-deps-tools
npm install -g pnpm@${{ env.PNPM_VERSION }}
- name: install dependencies (macOS only)
if: matrix.platform == 'macos-latest'
@@ -61,21 +67,16 @@ jobs:
run: |
cargo install --force cargo-make
cargo make appflowy-tauri-deps-tools
npm install -g pnpm@${{ env.PNPM_VERSION }}
# - name: lint
# working-directory: frontend/appflowy_tauri
# run: |
# yarn --frozen-lockfile
# yarn test:prettier
# yarn test:code
- name: build
working-directory: frontend/appflowy_tauri
run: |
mkdir dist
npm install
cargo make --cwd .. tauri_build
yarn && yarn build
pnpm install
cargo make --cwd .. tauri_build
pnpm test:errors
- uses: tauri-apps/tauri-action@v0
env:
+2
View File
@@ -35,3 +35,5 @@ pubspec.lock
.githooks/gitlint
.githooks/gitlint.exe
.fvm/
**/AppFlowy-Collab/
+80
View File
@@ -1,5 +1,85 @@
# Release Notes
## Version 0.2.2 - 06/15/2023
### New Features
- Added support for embedding a document in the database's row detail page
- Added support for inserting an emoji in the database's row detail page
### Other Updates
- Added language selector on the welcome page
- Added support for importing multiple markdown files all at once
## Version 0.2.1 - 06/11/2023
### New Features
- Added support for creating or referencing a calendar in the document
- Added `+` icon in grid's add field
### Other Updates
- Added vertical padding for progress bar
- Hide url cell accessory when the content is empty
### Bug fixes:
- Fixed unable to export markdown
- Fixed adding vertical padding for progress bar
- Fixed database view didn't update after the database layout changed.
## Version 0.2.0 - 06/08/2023
### New Features
- Improved checklists to support each cell having its own list
- Drag and drop calendar events
- Switch layouts (calendar, grid, kanban) of a database
- New database properties: 'Updated At' and 'Created At'
- Enabled hiding properties on the row detail page
- Added support for reordering and saving row order in different database views.
- Enabled each database view to have its own settings, including filter and sort options
- Added support to convert `“` (double quote) into a block quote
- Added support to convert `***` (three stars) into a divider
- Added support for an 'Add' button to insert a paragraph in a document and display the slash menu
- Added support for an 'Option' button to delete, duplicate, and customize block actions
### Other Updates
- Added support for importing v0.1.x documents and databases
- Added support for database import and export to CSV
- Optimized scroll behavior in documents.
- Redesigned the launch page
### Bug fixes
- Fixed bugs related to numbers
- Fixed issues with referenced databases in documents
- Fixed menu overflow issues in documents
### Data migration
The data format of this version is not compatible with previous versions. Therefore, to migrate your data to the new version, you need to use the export and import functions. Please follow the guide to learn how to export and import your data.
#### Export files in v0.1.6
https://github.com/AppFlowy-IO/AppFlowy/assets/11863087/0c89bf2b-cd97-4a7b-b627-59df8d2967d9
#### Import files in v0.2.0
https://github.com/AppFlowy-IO/AppFlowy/assets/11863087/7b392f35-4972-497a-8a7f-f38efced32e2
## Version 0.1.5 - 11/05/2023
### Bug Fixes
- Fix: calendar dates don't match with weekdays.
- Fix: sort numbers in Grid.
## Version 0.1.4 - 04/05/2023
### New features
- Use AppFlowy’s calendar views to plan and manage tasks and deadlines.
- Writing can be improved with the help of OpenAI.
## Version 0.1.3 - 24/04/2023
### New features
- Launch the official Dark Mode.
- Customize the font color and highlight color by setting a hex color value and an opacity level.
### Bug Fixes
- Fix: the slash menu can be triggered by all other keyboards than English.
- Fix: convert the single asterisk to italic text and the double asterisks to bold text.
## Version 0.1.2 - 03/28/2023
### Bug Fixes
+5 -3
View File
@@ -23,9 +23,11 @@ You are in charge of your data and customizations.
<a href="https://twitter.com/appflowy"><b>Twitter</b></a>
</p>
<p align="center"><img src="https://user-images.githubusercontent.com/12026239/200787830-96be260b-d0a0-4152-864e-6730b19095cd.png" alt="The Open Source Alternative To Notion." width="1000px" /></p>
<p align="center"><img src="https://user-images.githubusercontent.com/12026239/174753177-98e4c899-2356-4137-bb42-374bba2b127b.png" alt="The Open Source Alternative To Notion." width="1000px" /></p>
<p align="center"><img src="https://user-images.githubusercontent.com/12026239/190650183-a940f1e0-a2c5-4797-ab3a-56758f6f696c.png" alt="The Open Source Alternative To Notion." width="1000px" /></p>
<p align="center"><img src="https://user-images.githubusercontent.com/12026239/236664610-fc209a97-815e-4716-af07-d94a859d1907.png" alt="AppFlowy Docs & Notes & Wikis" width="1000px" /></p>
<p align="center"><img src="https://user-images.githubusercontent.com/12026239/236664628-5def2450-914a-4b2d-b907-92b7476b9863.png" alt="AppFlowy Databases for Tasks and Projects" width="1000px" /></p>
<p align="center"><img src="https://user-images.githubusercontent.com/12026239/236664642-22e26c1b-5eae-4635-9aa6-b12ecf1c3c46.png" alt="AppFlowy Kanban Board for To-Dos" width="1000px" /></p>
<p align="center"><img src="https://github.com/AppFlowy-IO/AppFlowy/assets/12026239/6be93d2b-a5c5-48a9-b7cf-c599d5f5140c" alt="AppFlowy Calendars for Plan and Manage Content" width="1000px" /></p>
<p align="center"><img src="https://user-images.githubusercontent.com/12026239/236664657-dc5291f3-67b0-4a43-a818-640e92735deb.png" alt="AppFlowy OpenAI GPT Writers" width="1000px" /></p>
## User Installation
+2 -2
View File
@@ -13,7 +13,7 @@
"preLaunchTask": "AF: Build Appflowy Core",
"env": {
"RUST_LOG": "trace",
// "RUST_LOG": "debug"
"RUST_BACKTRACE": 1
},
"cwd": "${workspaceRoot}/appflowy_flutter"
},
@@ -24,7 +24,7 @@
"program": "./lib/main.dart",
"type": "dart",
"env": {
"RUST_LOG": "debug"
"RUST_LOG": "debug",
},
"cwd": "${workspaceRoot}/appflowy_flutter"
},
+2 -2
View File
@@ -118,7 +118,7 @@
{
"label": "AF: Generate Freezed Files",
"type": "shell",
"command": "flutter pub run build_runner build --delete-conflicting-outputs",
"command": "dart run build_runner build -d",
"options": {
"cwd": "${workspaceFolder}/appflowy_flutter"
}
@@ -180,7 +180,7 @@
{
"label": "AF: Tauri UI Build",
"type": "shell",
"command": "npm run build",
"command": "pnpm run build",
"options": {
"cwd": "${workspaceFolder}/appflowy_tauri"
}
+5 -1
View File
@@ -23,7 +23,7 @@ CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
CARGO_MAKE_CRATE_FS_NAME = "dart_ffi"
CARGO_MAKE_CRATE_NAME = "dart-ffi"
LIB_NAME = "dart_ffi"
CURRENT_APP_VERSION = "0.1.3"
CURRENT_APP_VERSION = "0.2.2"
FLUTTER_DESKTOP_FEATURES = "dart,rev-sqlite"
PRODUCT_NAME = "AppFlowy"
# CRATE_TYPE: https://doc.rust-lang.org/reference/linkage.html
@@ -59,6 +59,7 @@ BUILD_FLAG = "debug"
FLUTTER_OUTPUT_DIR = "Debug"
PRODUCT_EXT = "app"
BUILD_ARCHS = "arm64"
CRATE_TYPE = "staticlib"
[env.development-mac-x86_64]
RUST_LOG = "info"
@@ -68,6 +69,7 @@ BUILD_FLAG = "debug"
FLUTTER_OUTPUT_DIR = "Debug"
PRODUCT_EXT = "app"
BUILD_ARCHS = "x86_64"
CRATE_TYPE = "staticlib"
[env.production-mac-arm64]
BUILD_FLAG = "release"
@@ -77,6 +79,7 @@ FLUTTER_OUTPUT_DIR = "Release"
PRODUCT_EXT = "app"
APP_ENVIRONMENT = "production"
BUILD_ARCHS = "arm64"
CRATE_TYPE = "staticlib"
[env.production-mac-x86_64]
BUILD_FLAG = "release"
@@ -86,6 +89,7 @@ FLUTTER_OUTPUT_DIR = "Release"
PRODUCT_EXT = "app"
APP_ENVIRONMENT = "production"
BUILD_ARCHS = "x86_64"
CRATE_TYPE = "staticlib"
[env.development-windows-x86]
TARGET_OS = "windows"
+4
View File
@@ -68,3 +68,7 @@ windows/flutter/dart_ffi/
**/**/Brewfile.lock.json
**/.sandbox
**/.vscode/
*.env
coverage/
+2 -2
View File
@@ -1,7 +1,7 @@
.PHONY: freeze_build, free_watch
freeze_build:
flutter pub run build_runner build --delete-conflicting-outputs
dart run build_runner build -d
watch:
flutter pub run build_runner watch
dart run build_runner watch
+1 -1
View File
@@ -1,6 +1,6 @@
<h1 align="center" style="margin:0"> AppFlowy_Flutter</h1>
<div align="center">
<img src="https://img.shields.io/badge/Flutter-v3.7.5-blue"/>
<img src="https://img.shields.io/badge/Flutter-v3.10.1-blue"/>
<img src="https://img.shields.io/badge/Rust-v1.65-orange"/>
</div>
@@ -30,6 +30,10 @@ linter:
rules:
- require_trailing_commas
- prefer_final_fields
- prefer_final_in_for_each
- prefer_final_locals
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
@@ -0,0 +1,10 @@
<svg width="24" height="25" viewBox="0 0 24 25" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_10_2941)">
<path d="M17.9706 5.70199L17.9706 5.702L17.9712 5.70405L20.4218 13.6624C20.4393 13.7435 20.4508 13.8258 20.4561 13.9086V19.3106C20.4561 19.7769 20.078 20.1549 19.6117 20.1548H3.40062C2.93431 20.1549 2.55625 19.7769 2.55625 19.3106V13.9086C2.56155 13.8257 2.57301 13.7433 2.59054 13.6622L4.97263 5.70366C5.26597 4.72587 6.16595 4.05625 7.1868 4.05625L15.8285 4.05625C16.8329 4.05625 17.7119 4.7315 17.9706 5.70199ZM4.55716 12.99L4.53544 13.0624H4.61104H8.80431C9.02825 13.0624 9.24302 13.1514 9.40137 13.3097C9.55971 13.4681 9.64867 13.6828 9.64867 13.9068V14.8074V14.8636H9.70492H13.3074H13.3636V14.8074V13.9068C13.3636 13.6828 13.4526 13.4681 13.6109 13.3097C13.7693 13.1514 13.9841 13.0624 14.208 13.0624H18.4013H18.4769L18.4551 12.99L16.5342 6.5868C16.3843 6.08715 15.9244 5.74498 15.4028 5.74498H7.60955C7.0879 5.74498 6.62802 6.08715 6.47812 6.5868L4.55716 12.99ZM15.1086 14.7511H15.0524V14.8074V15.708C15.0524 15.8189 15.0305 15.9287 14.9881 16.0311C14.9457 16.1336 14.8835 16.2267 14.8051 16.3051C14.7267 16.3835 14.6336 16.4457 14.5311 16.4881C14.4287 16.5305 14.3189 16.5524 14.208 16.5524H8.80431C8.69343 16.5524 8.58363 16.5305 8.48118 16.4881C8.37874 16.4457 8.28566 16.3835 8.20725 16.3051C8.12885 16.2267 8.06665 16.1336 8.02422 16.0311C7.98178 15.9287 7.95994 15.8189 7.95994 15.708V14.8074V14.7511H7.90369H4.52623C4.3709 14.7511 4.24498 14.8771 4.24498 15.0324V18.1849C4.24498 18.3402 4.3709 18.4661 4.52623 18.4661H18.4861C18.6414 18.4661 18.7673 18.3402 18.7673 18.1849V15.0324C18.7673 14.8771 18.6414 14.7511 18.4861 14.7511H15.1086ZM8.80435 10.2481C8.58041 10.2481 8.36564 10.1591 8.20729 10.0007C8.04895 9.8424 7.95999 9.62763 7.95999 9.40369C7.95999 9.17975 8.04895 8.96498 8.20729 8.80663C8.36564 8.64829 8.58041 8.55933 8.80435 8.55933H14.208C14.432 8.55933 14.6468 8.64829 14.8051 8.80663C14.9635 8.96498 15.0524 9.17975 15.0524 9.40369C15.0524 9.62763 14.9635 9.8424 14.8051 10.0007C14.6468 10.1591 14.432 10.2481 14.208 10.2481H8.80435Z" fill="#333333" stroke="white" stroke-width="0.1125"/>
</g>
<defs>
<clipPath id="clip0_10_2941">
<rect width="18" height="16.2111" fill="white" transform="translate(2.5 4)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

@@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path opacity="0.7" d="M14.1579 9L14.6673 8.57546C14.5413 8.42426 14.3547 8.33684 14.1579 8.33684V9ZM16 11.2105L15.4905 11.6351C15.6165 11.7863 15.8032 11.8737 16 11.8737V11.2105ZM9.66316 12.6843C9.66316 12.318 9.36625 12.0211 9 12.0211C8.63375 12.0211 8.33684 12.318 8.33684 12.6843H9.66316ZM8.33684 17.1053C8.33684 17.4716 8.63375 17.7685 9 17.7685C9.36625 17.7685 9.66316 17.4716 9.66316 17.1053H8.33684ZM23.6632 12.6843C23.6632 12.318 23.3663 12.0211 23 12.0211C22.6337 12.0211 22.3368 12.318 22.3368 12.6843H23.6632ZM22.3368 17.1053C22.3368 17.4716 22.6337 17.7685 23 17.7685C23.3663 17.7685 23.6632 17.4716 23.6632 17.1053H22.3368ZM9.66316 9.73684C9.66316 9.69614 9.69614 9.66316 9.73684 9.66316V8.33684C8.96364 8.33684 8.33684 8.96364 8.33684 9.73684H9.66316ZM9.73684 9.66316H14.1579V8.33684H9.73684V9.66316ZM13.6484 9.42454L15.4905 11.6351L16.5094 10.786L14.6673 8.57546L13.6484 9.42454ZM16 11.8737H22.2631V10.5474H16V11.8737ZM22.2631 11.8737C22.3038 11.8737 22.3368 11.9067 22.3368 11.9474H23.6631C23.6631 11.1742 23.0363 10.5474 22.2631 10.5474V11.8737ZM22.3368 11.9474V21.5263H23.6631V11.9474H22.3368ZM22.3368 21.5263C22.3368 21.567 22.3038 21.6 22.2631 21.6V22.9263C23.0363 22.9263 23.6631 22.2995 23.6631 21.5263H22.3368ZM22.2631 21.6H9.73684V22.9263H22.2631V21.6ZM9.73684 21.6C9.69614 21.6 9.66316 21.567 9.66316 21.5263H8.33684C8.33684 22.2995 8.96365 22.9263 9.73684 22.9263V21.6ZM9.66316 21.5263V9.73684H8.33684V21.5263H9.66316ZM22.9999 14.2317H9V15.558H22.9999V14.2317ZM8.33684 12.6843V17.1053H9.66316V12.6843H8.33684ZM22.3368 12.6843V17.1053H23.6632V12.6843H22.3368Z" fill="#333333"/>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

@@ -0,0 +1,4 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M21.7874 10.1975C22.48 10.8859 23.0235 11.6885 23.4041 12.5811C23.7967 13.5077 24 14.4863 24 15.499C24 16.5117 23.7987 17.4943 23.4061 18.4189C23.0256 19.3115 22.482 20.1141 21.7894 20.8025C21.0968 21.491 20.2895 22.0314 19.3915 22.4096C18.4614 22.8019 17.4729 23 16.4541 23C15.4354 23 14.4469 22.7999 13.5167 22.4096C12.6188 22.0314 11.8114 21.491 11.1189 20.8025C10.8833 20.5684 10.8833 20.1881 11.1189 19.954C11.3544 19.7198 11.7369 19.7198 11.9725 19.954C13.1684 21.1448 14.7589 21.7992 16.4521 21.7992C18.1453 21.7992 19.7338 21.1428 20.9317 19.954C22.1296 18.7652 22.792 17.1801 22.792 15.499C22.792 13.8179 22.1316 12.2368 20.9357 11.046C19.7398 9.85524 18.1493 9.2008 16.4561 9.2008C15.6971 9.2008 14.9562 9.33089 14.2516 9.59106C13.5711 9.84323 12.9429 10.2055 12.3852 10.6718C11.6041 11.3242 10.996 12.1508 10.6075 13.0734L11.2618 12.7231C11.5557 12.565 11.9222 12.6751 12.0792 12.9673C12.2383 13.2595 12.1275 13.6237 11.8336 13.7799L9.92094 14.8005C9.92094 14.8025 9.91892 14.8025 9.91892 14.8025C9.82832 14.8506 9.72967 14.8746 9.63303 14.8746C9.44378 14.8746 9.26258 14.7885 9.14581 14.6304C9.14455 14.6267 9.14249 14.6237 9.14064 14.621C9.13954 14.6194 9.13851 14.6179 9.13776 14.6164C9.13575 14.6124 9.13323 14.6089 9.13071 14.6054C9.1282 14.6019 9.12568 14.5984 9.12367 14.5944C9.11561 14.5824 9.10756 14.5704 9.10152 14.5584L8.07272 12.6551C7.91367 12.3629 8.0244 11.9987 8.31834 11.8426C8.61228 11.6845 8.97871 11.7945 9.13575 12.0867L9.45989 12.6871C9.91892 11.5584 10.6558 10.5457 11.6061 9.75317C12.2705 9.1988 13.0174 8.76451 13.8288 8.46631C14.6663 8.1561 15.5501 8 16.4521 8C17.4708 8 18.4594 8.20013 19.3895 8.59039C20.2875 8.96865 21.0948 9.50901 21.7874 10.1975ZM15.52 12.1206C15.52 11.7884 15.7898 11.5202 16.124 11.5202C16.4582 11.5202 16.728 11.7884 16.728 12.1206V15.2747H19.8244C20.1587 15.2747 20.4284 15.5429 20.4284 15.8751C20.4284 16.2073 20.1587 16.4755 19.8244 16.4755H16.1481C15.8441 16.4755 15.5925 16.2514 15.5502 15.9612C15.5301 15.9031 15.52 15.8411 15.52 15.7751V12.1206Z" fill="#333333" fill-opacity="0.7"/>
<path d="M23.4041 12.5811L23.4435 12.5643L23.4435 12.5642L23.4041 12.5811ZM21.7874 10.1975L21.7572 10.2279L21.7874 10.1975ZM23.4061 18.4189L23.4455 18.4358L23.4455 18.4357L23.4061 18.4189ZM19.3915 22.4096L19.3749 22.3701L19.3749 22.3701L19.3915 22.4096ZM13.5167 22.4096L13.5001 22.4491L13.5001 22.4491L13.5167 22.4096ZM11.1189 20.8025L11.1491 20.7721L11.1189 20.8025ZM11.1189 19.954L11.1491 19.9844L11.1189 19.954ZM11.9725 19.954L12.0027 19.9236L12.0027 19.9236L11.9725 19.954ZM20.9317 19.954L20.9619 19.9844L20.9317 19.954ZM20.9357 11.046L20.9055 11.0764L20.9357 11.046ZM14.2516 9.59106L14.2367 9.55086L14.2367 9.55087L14.2516 9.59106ZM12.3852 10.6718L12.4127 10.7047L12.4127 10.7047L12.3852 10.6718ZM10.6075 13.0734L10.568 13.0567L10.521 13.1683L10.6277 13.1112L10.6075 13.0734ZM11.2618 12.7231L11.282 12.7609L11.2821 12.7609L11.2618 12.7231ZM12.0792 12.9673L12.0415 12.9876L12.0416 12.9878L12.0792 12.9673ZM11.8336 13.7799L11.8135 13.742L11.8134 13.742L11.8336 13.7799ZM9.92094 14.8005L9.90076 14.7627L9.87808 14.7748V14.8005H9.92094ZM9.91892 14.8025L9.9189 14.7597L9.90825 14.7597L9.89885 14.7647L9.91892 14.8025ZM9.14581 14.6304L9.10311 14.6447L9.11134 14.6559L9.14581 14.6304ZM9.14064 14.621L9.10537 14.6453L9.10537 14.6453L9.14064 14.621ZM9.13776 14.6164L9.17605 14.5972L9.17604 14.5972L9.13776 14.6164ZM9.13071 14.6054L9.09591 14.6304L9.09591 14.6304L9.13071 14.6054ZM9.12367 14.5944L9.16225 14.575L9.15926 14.5705L9.12367 14.5944ZM9.10152 14.5584L9.13982 14.5391L9.13922 14.538L9.10152 14.5584ZM8.07272 12.6551L8.11042 12.6347L8.11036 12.6346L8.07272 12.6551ZM8.31834 11.8426L8.33844 11.8804L8.33864 11.8803L8.31834 11.8426ZM9.13575 12.0867L9.09799 12.107L9.09803 12.1071L9.13575 12.0867ZM9.45989 12.6871L9.42218 12.7075L9.46535 12.7875L9.49959 12.7033L9.45989 12.6871ZM11.6061 9.75317L11.6335 9.78608L11.6335 9.78608L11.6061 9.75317ZM13.8288 8.46631L13.8436 8.50654L13.8437 8.5065L13.8288 8.46631ZM19.3895 8.59039L19.4062 8.5509L19.4061 8.55087L19.3895 8.59039ZM16.728 15.2747H16.6851V15.3176H16.728V15.2747ZM15.5502 15.9612L15.5934 15.9549L15.5907 15.9471L15.5502 15.9612ZM23.4435 12.5642C23.0608 11.6666 22.5141 10.8594 21.8176 10.1671L21.7572 10.2279C22.4458 10.9124 22.9863 11.7104 23.3646 12.5979L23.4435 12.5642ZM24.0429 15.499C24.0429 14.4805 23.8383 13.4961 23.4435 12.5643L23.3646 12.5978C23.755 13.5192 23.9571 14.4922 23.9571 15.499H24.0429ZM23.4455 18.4357C23.8404 17.5058 24.0429 16.5174 24.0429 15.499H23.9571C23.9571 16.5059 23.757 17.4829 23.3666 18.4022L23.4455 18.4357ZM21.8196 20.8329C22.5161 20.1406 23.0628 19.3334 23.4455 18.4358L23.3667 18.4021C22.9883 19.2896 22.4478 20.0876 21.7592 20.7721L21.8196 20.8329ZM19.4082 22.4491C20.3112 22.0687 21.1231 21.5253 21.8196 20.8329L21.7592 20.7721C21.0705 21.4567 20.2678 21.994 19.3749 22.3701L19.4082 22.4491ZM16.4541 23.0429C17.4785 23.0429 18.4727 22.8436 19.4082 22.4491L19.3749 22.3701C18.4501 22.7601 17.4672 22.9571 16.4541 22.9571V23.0429ZM13.5001 22.4491C14.4355 22.8416 15.4297 23.0429 16.4541 23.0429V22.9571C15.4411 22.9571 14.4582 22.7581 13.5333 22.3701L13.5001 22.4491ZM11.0886 20.8329C11.7851 21.5253 12.5971 22.0687 13.5001 22.4491L13.5333 22.3701C12.6405 21.994 11.8377 21.4567 11.1491 20.7721L11.0886 20.8329ZM11.0886 19.9236C10.8362 20.1745 10.8362 20.582 11.0886 20.8329L11.1491 20.7721C10.9304 20.5547 10.9304 20.2018 11.1491 19.9844L11.0886 19.9236ZM12.0027 19.9236C11.7504 19.6728 11.3409 19.6728 11.0886 19.9236L11.1491 19.9844C11.3679 19.7668 11.7234 19.7668 11.9423 19.9844L12.0027 19.9236ZM16.4521 21.7563C14.7702 21.7563 13.1906 21.1064 12.0027 19.9236L11.9423 19.9843C13.1462 21.1832 14.7476 21.8421 16.4521 21.8421V21.7563ZM20.9015 19.9235C19.7116 21.1044 18.134 21.7563 16.4521 21.7563V21.8421C18.1566 21.8421 19.756 21.1811 20.9619 19.9844L20.9015 19.9235ZM22.7492 15.499C22.7492 17.1686 22.0914 18.7428 20.9015 19.9235L20.9619 19.9844C22.1679 18.7876 22.8349 17.1916 22.8349 15.499H22.7492ZM20.9055 11.0764C22.0934 12.2592 22.7492 13.8294 22.7492 15.499H22.8349C22.8349 13.8064 22.1699 12.2144 20.966 11.0157L20.9055 11.0764ZM16.4561 9.24366C18.1381 9.24366 19.7177 9.89365 20.9055 11.0764L20.966 11.0157C19.762 9.81683 18.1606 9.15794 16.4561 9.15794V9.24366ZM14.2664 9.63127C14.9662 9.37289 15.7021 9.24366 16.4561 9.24366V9.15794C15.6922 9.15794 14.9462 9.28889 14.2367 9.55086L14.2664 9.63127ZM12.4127 10.7047C12.9666 10.2415 13.5905 9.88174 14.2665 9.63125L14.2367 9.55087C13.5517 9.80472 12.9192 10.1694 12.3577 10.6389L12.4127 10.7047ZM10.647 13.09C11.0329 12.1737 11.6368 11.3527 12.4127 10.7047L12.3578 10.6389C11.5713 11.2957 10.9592 12.1278 10.568 13.0567L10.647 13.09ZM11.2416 12.6854L10.5872 13.0356L10.6277 13.1112L11.282 12.7609L11.2416 12.6854ZM12.117 12.947C11.9487 12.6339 11.5562 12.5161 11.2415 12.6854L11.2821 12.7609C11.5553 12.614 11.8957 12.7164 12.0415 12.9876L12.117 12.947ZM11.8537 13.8177C12.1685 13.6505 12.2874 13.2601 12.1168 12.9468L12.0416 12.9878C12.1891 13.2589 12.0865 13.597 11.8135 13.742L11.8537 13.8177ZM9.94111 14.8383L11.8538 13.8177L11.8134 13.74Line truncated
</svg>

After

Width:  |  Height:  |  Size: 11 KiB

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Calendar / Calendar_Days">
<path id="Vector" d="M8 4H7.2002C6.08009 4 5.51962 4 5.0918 4.21799C4.71547 4.40973 4.40973 4.71547 4.21799 5.0918C4 5.51962 4 6.08009 4 7.2002V8M8 4H16M8 4V2M16 4H16.8002C17.9203 4 18.4796 4 18.9074 4.21799C19.2837 4.40973 19.5905 4.71547 19.7822 5.0918C20 5.5192 20 6.07899 20 7.19691V8M16 4V2M4 8V16.8002C4 17.9203 4 18.4801 4.21799 18.9079C4.40973 19.2842 4.71547 19.5905 5.0918 19.7822C5.5192 20 6.07899 20 7.19691 20H16.8031C17.921 20 18.48 20 18.9074 19.7822C19.2837 19.5905 19.5905 19.2842 19.7822 18.9079C20 18.4805 20 17.9215 20 16.8036V8M4 8H20M16 16H16.002L16.002 16.002L16 16.002V16ZM12 16H12.002L12.002 16.002L12 16.002V16ZM8 16H8.002L8.00195 16.002L8 16.002V16ZM16.002 12V12.002L16 12.002V12H16.002ZM12 12H12.002L12.002 12.002L12 12.002V12ZM8 12H8.002L8.00195 12.002L8 12.002V12Z" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

@@ -0,0 +1,29 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="512.000000pt" height="512.000000pt" viewBox="0 0 512.000000 512.000000"
preserveAspectRatio="xMidYMid meet">
<g transform="translate(0.000000,512.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
<path d="M2990 5100 c-19 -10 -382 -366 -806 -792 l-771 -773 -42 -85 c-125
-256 -84 -501 120 -714 47 -50 91 -101 98 -113 14 -27 14 -116 0 -168 -57
-207 -310 -495 -535 -606 -73 -37 -92 -42 -190 -50 -60 -4 -145 -18 -189 -29
-312 -80 -560 -328 -646 -645 -32 -116 -32 -336 -1 -450 88 -318 330 -560 647
-646 115 -32 335 -32 450 0 263 71 474 247 591 494 45 95 71 203 83 337 7 90
15 122 40 176 149 318 583 627 777 554 15 -6 68 -50 119 -98 214 -205 459
-246 715 -121 85 42 85 42 849 803 420 418 776 781 792 805 34 53 37 97 10
149 -24 46 -1934 1954 -1978 1976 -42 21 -90 20 -133 -4z m920 -1195 l845
-845 -318 -317 -317 -318 -847 847 -848 848 315 315 c173 173 317 315 320 315
3 0 385 -380 850 -845z m-282 -1972 c-320 -320 -330 -327 -458 -328 -100 0
-145 23 -264 135 -52 49 -114 99 -137 111 -242 123 -589 11 -902 -291 -135
-130 -224 -245 -287 -375 -54 -110 -80 -200 -80 -285 -2 -277 -206 -528 -475
-585 -203 -43 -395 15 -545 164 -190 188 -233 466 -108 704 42 81 164 203 245
245 77 41 198 72 277 72 326 1 780 374 949 780 74 178 76 355 5 494 -11 21
-59 80 -108 132 -110 117 -135 164 -135 259 0 131 3 136 324 458 l286 287 847
-847 848 -848 -282 -282z"/>
<path d="M828 1029 c-43 -22 -78 -81 -78 -129 0 -76 74 -150 150 -150 17 0 49
9 70 20 45 23 80 80 80 130 0 50 -35 107 -80 130 -49 25 -94 25 -142 -1z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

@@ -1,6 +1,6 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M3 4.3999H4.11111H13" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M5.77775 4.4V3.2C5.77775 2.88174 5.89481 2.57652 6.10319 2.35147C6.31156 2.12643 6.59418 2 6.88886 2H9.11108C9.40577 2 9.68838 2.12643 9.89676 2.35147C10.1051 2.57652 10.2222 2.88174 10.2222 3.2V4.4M11.8889 4.4V12.8C11.8889 13.1183 11.7718 13.4235 11.5634 13.6485C11.3551 13.8736 11.0724 14 10.7778 14H5.2222C4.92751 14 4.64489 13.8736 4.43652 13.6485C4.22815 13.4235 4.11108 13.1183 4.11108 12.8V4.4H11.8889Z" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M6.88892 7.3999V10.9999" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M9.11108 7.3999V10.9999" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M3 4.40039H4.11111H13" stroke="#BBC3CD" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M5.77799 4.4V3.2C5.77799 2.88174 5.89506 2.57652 6.10343 2.35147C6.31181 2.12643 6.59442 2 6.88911 2H9.11133C9.40601 2 9.68863 2.12643 9.897 2.35147C10.1054 2.57652 10.2224 2.88174 10.2224 3.2V4.4M11.8891 4.4V12.8C11.8891 13.1183 11.772 13.4235 11.5637 13.6485C11.3553 13.8736 11.0727 14 10.778 14H5.22244C4.92775 14 4.64514 13.8736 4.43676 13.6485C4.22839 13.4235 4.11133 13.1183 4.11133 12.8V4.4H11.8891Z" stroke="#BBC3CD" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M6.88867 7.40039V11.0004" stroke="#BBC3CD" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M9.11133 7.40039V11.0004" stroke="#BBC3CD" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

Before

Width:  |  Height:  |  Size: 886 B

After

Width:  |  Height:  |  Size: 886 B

@@ -0,0 +1,4 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M11.974 6.33301H7.35865C6.7922 6.33301 6.33301 6.7922 6.33301 7.35865V11.974C6.33301 12.5405 6.7922 12.9997 7.35865 12.9997H11.974C12.5405 12.9997 12.9997 12.5405 12.9997 11.974V7.35865C12.9997 6.7922 12.5405 6.33301 11.974 6.33301Z" stroke="#BBC3CD" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M4.53846 9.66667H4.02564C3.75362 9.66667 3.49275 9.55861 3.3004 9.36626C3.10806 9.17392 3 8.91304 3 8.64103V4.02564C3 3.75362 3.10806 3.49275 3.3004 3.3004C3.49275 3.10806 3.75362 3 4.02564 3H8.64103C8.91304 3 9.17392 3.10806 9.36626 3.3004C9.55861 3.49275 9.66667 3.75362 9.66667 4.02564V4.53846" stroke="#BBC3CD" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 785 B

@@ -0,0 +1,4 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7 8.91521C7.21574 9.22582 7.49099 9.48283 7.80707 9.66881C8.12315 9.85479 8.47268 9.96538 8.83194 9.99309C9.1912 10.0208 9.5518 9.96497 9.88926 9.8294C10.2267 9.69383 10.5332 9.48169 10.7878 9.20736L12.2949 7.58431C12.7525 7.07413 13.0056 6.39083 12.9999 5.68156C12.9942 4.9723 12.73 4.29384 12.2643 3.7923C11.7986 3.29075 11.1686 3.00627 10.51 3.0001C9.85142 2.99394 9.21693 3.26659 8.7432 3.75935L7.87913 4.68448" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M9 7.08479C8.78426 6.77418 8.50901 6.51717 8.19293 6.33119C7.87685 6.14521 7.52732 6.03462 7.16806 6.00691C6.8088 5.9792 6.4482 6.03503 6.11074 6.1706C5.77327 6.30617 5.46683 6.51831 5.21218 6.79264L3.7051 8.41569C3.24755 8.92587 2.99437 9.60918 3.00009 10.3184C3.00582 11.0277 3.26998 11.7062 3.73569 12.2077C4.2014 12.7092 4.8314 12.9937 5.48999 12.9999C6.14858 13.0061 6.78307 12.7334 7.2568 12.2407L8.11584 11.3155" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

@@ -0,0 +1,8 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="9" y="3" width="2" height="2" rx="0.5" fill="#333333"/>
<rect x="5" y="3" width="2" height="2" rx="0.5" fill="#333333"/>
<rect x="9" y="7" width="2" height="2" rx="0.5" fill="#333333"/>
<rect x="5" y="7" width="2" height="2" rx="0.5" fill="#333333"/>
<rect x="9" y="11" width="2" height="2" rx="0.5" fill="#333333"/>
<rect x="5" y="11" width="2" height="2" rx="0.5" fill="#333333"/>
</svg>

After

Width:  |  Height:  |  Size: 495 B

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg fill="#000000" width="800px" height="800px" viewBox="-0.02 0 122.88 122.88" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="enable-background:new 0 0 122.84 122.88" xml:space="preserve">
<g>
<path d="M81.54,4.71c0-2.62,2.58-4.71,5.77-4.71c3.2,0,5.77,2.13,5.77,4.71V25.4c0,2.62-2.58,4.71-5.77,4.71 c-3.2,0-5.77-2.13-5.77-4.71V4.71L81.54,4.71z M20.4,89.87l7.55-0.47c0.16,1.22,0.5,2.16,1,2.79c0.82,1.04,1.99,1.56,3.51,1.56 c1.13,0,2.01-0.26,2.62-0.8C35.69,92.41,36,91.8,36,91.1c0-0.66-0.29-1.26-0.87-1.79c-0.58-0.53-1.93-1.02-4.06-1.49 c-3.49-0.78-5.96-1.82-7.45-3.12c-1.5-1.29-2.25-2.95-2.25-4.96c0-1.32,0.38-2.56,1.15-3.74c0.77-1.18,1.92-2.1,3.46-2.77 c1.54-0.67,3.65-1.01,6.32-1.01c3.29,0,5.79,0.61,7.52,1.84c1.72,1.22,2.75,3.17,3.08,5.84l-7.47,0.44 c-0.2-1.17-0.62-2.02-1.25-2.55c-0.64-0.53-1.52-0.8-2.64-0.8c-0.92,0-1.62,0.2-2.09,0.59c-0.47,0.39-0.7,0.87-0.7,1.43 c0,0.41,0.19,0.77,0.57,1.1c0.37,0.34,1.25,0.65,2.65,0.95c3.47,0.75,5.96,1.51,7.46,2.28c1.5,0.77,2.6,1.71,3.28,2.85 c0.68,1.13,1.02,2.4,1.02,3.81c0,1.65-0.46,3.17-1.37,4.56c-0.92,1.39-2.19,2.45-3.83,3.17c-1.64,0.72-3.7,1.08-6.19,1.08 c-4.37,0-7.4-0.84-9.09-2.53C21.58,94.6,20.62,92.46,20.4,89.87L20.4,89.87z M64.53,72.65h7.94v15.33c0,1.52-0.24,2.95-0.71,4.3 c-0.47,1.35-1.22,2.53-2.23,3.55c-1.01,1.01-2.07,1.72-3.18,2.13c-1.54,0.57-3.4,0.86-5.56,0.86c-1.25,0-2.62-0.09-4.1-0.26 c-1.48-0.17-2.72-0.52-3.71-1.04c-0.99-0.52-1.9-1.26-2.72-2.22c-0.83-0.96-1.39-1.95-1.69-2.96c-0.49-1.64-0.74-3.08-0.74-4.35 V72.65h7.94v15.69c0,1.4,0.39,2.5,1.16,3.28c0.78,0.79,1.86,1.19,3.23,1.19c1.36,0,2.43-0.39,3.21-1.17 c0.77-0.77,1.16-1.87,1.16-3.3V72.65L64.53,72.65z M77.85,72.65h7.42l9.65,14.21V72.65h7.51v25.73h-7.51l-9.59-14.13v14.13h-7.47 V72.65L77.85,72.65z M29.53,4.71c0-2.62,2.58-4.71,5.77-4.71c3.2,0,5.77,2.13,5.77,4.71V25.4c0,2.62-2.58,4.71-5.77,4.71 c-3.2,0-5.77-2.13-5.77-4.71V4.71L29.53,4.71z M7.56,44.09h107.62V22.66c0-0.8-0.31-1.55-0.84-2.04c-0.53-0.53-1.24-0.84-2.04-0.84 h-9.31c-1.78,0-3.2-2.63-3.2-4.41c0-1.78,1.42-3.2,3.2-3.2h10.53c2.58,0,4.88,1.07,6.57,2.75c1.69,1.69,2.75,4.04,2.75,6.57v92.06 c0,2.58-1.07,4.88-2.75,6.57c-1.69,1.69-4.04,2.75-6.57,2.75H9.33c-2.58,0-4.88-1.07-6.57-2.75C1.07,118.44,0,116.08,0,113.55 V21.49c0-2.58,1.07-4.88,2.75-6.57c1.69-1.69,4.04-2.75,6.57-2.75h11.28c1.78,0,3.2,1.42,3.2,3.2s-1.42,4.41-3.2,4.41H10.54 c-0.8,0-1.55,0.31-2.09,0.84c-0.53,0.53-0.84,1.24-0.84,2.09v21.43L7.56,44.09L7.56,44.09z M115.19,52.9H7.56v59.4 c0,0.8,0.31,1.55,0.84,2.09c0.53,0.53,1.24,0.84,2.09,0.84h101.76c0.8,0,1.55-0.31,2.09-0.84c0.53-0.53,0.84-1.24,0.84-2.09V52.9 L115.19,52.9z M50.36,19.73c-1.78,0-3.2-2.63-3.2-4.41c0-1.78,1.42-3.2,3.2-3.2h21.49c1.78,0,3.2,1.42,3.2,3.2 c0,1.78-1.42,4.41-3.2,4.41H50.36L50.36,19.73z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M3 6C3 3.79086 4.79086 2 7 2H17C19.2091 2 21 3.79086 21 6C21 8.20914 19.2091 10 17 10H7C4.79086 10 3 8.20914 3 6Z" stroke="#000000" stroke-width="2"/>
<path d="M3 16C3 14.8954 3.89543 14 5 14H8C9.10457 14 10 14.8954 10 16V19C10 20.1046 9.10457 21 8 21H5C3.89543 21 3 20.1046 3 19V16Z" stroke="#000000" stroke-width="2"/>
<path d="M14 17.5C14 15.567 15.567 14 17.5 14C19.433 14 21 15.567 21 17.5C21 19.433 19.433 21 17.5 21C15.567 21 14 19.433 14 17.5Z" stroke="#000000" stroke-width="2"/>
</svg>

After

Width:  |  Height:  |  Size: 725 B

@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="127px" height="96px" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd" xmlns:xlink="http://www.w3.org/1999/xlink">
<g><path style="opacity:0.982" fill="#5864f2" d="M 40.5,-0.5 C 42.5,-0.5 44.5,-0.5 46.5,-0.5C 46.7534,3.03777 48.5868,5.03777 52,5.5C 59.3333,4.16667 66.6667,4.16667 74,5.5C 77.4132,5.03777 79.2466,3.03777 79.5,-0.5C 81.8333,-0.5 84.1667,-0.5 86.5,-0.5C 93.6784,1.84095 100.845,4.50762 108,7.5C 117.556,21.9281 123.723,37.5947 126.5,54.5C 126.5,63.1667 126.5,71.8333 126.5,80.5C 117.234,86.2996 107.567,91.2996 97.5,95.5C 95.8333,95.5 94.1667,95.5 92.5,95.5C 90.2583,92.0205 88.2583,88.3538 86.5,84.5C 89.9621,82.9349 93.2954,81.1016 96.5,79C 95.8333,78.8333 95.1667,78.6667 94.5,78.5C 80.6757,84.0674 66.3424,85.9007 51.5,84C 44.0284,82.4993 36.6951,80.8327 29.5,79C 32.7046,81.1016 36.0379,82.9349 39.5,84.5C 37.7417,88.3538 35.7417,92.0205 33.5,95.5C 31.8333,95.5 30.1667,95.5 28.5,95.5C 18.4329,91.2996 8.76625,86.2996 -0.5,80.5C -0.5,71.8333 -0.5,63.1667 -0.5,54.5C 2.27734,37.5947 8.44401,21.9281 18,7.5C 25.419,4.30685 32.919,1.64019 40.5,-0.5 Z M 38.5,40.5 C 51.8373,41.4956 55.6706,48.1623 50,60.5C 42.3899,66.5776 36.3899,65.2442 32,56.5C 30.062,49.3891 32.2287,44.0558 38.5,40.5 Z M 80.5,40.5 C 93.8373,41.4956 97.6706,48.1623 92,60.5C 84.3899,66.5776 78.3899,65.2442 74,56.5C 72.062,49.3891 74.2287,44.0558 80.5,40.5 Z"/></g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

@@ -0,0 +1 @@
<svg width="98" height="96" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z" fill="#fff"/></svg>

After

Width:  |  Height:  |  Size: 960 B

@@ -0,0 +1 @@
<svg xmlns:xlink="http://www.w3.org/1999/xlink" data-e2e="" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg" width="1" height="1" ><path fill-rule="evenodd" clip-rule="evenodd" d="M43 24.4313C43 23.084 42.8767 21.7885 42.6475 20.5449H24.3877V27.8945H34.8219C34.3724 30.2695 33.0065 32.2818 30.9532 33.6291V38.3964H37.2189C40.885 35.0886 43 30.2177 43 24.4313Z" fill="#4285F4"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M24.3872 43.001C29.6219 43.001 34.0107 41.2996 37.2184 38.3978L30.9527 33.6305C29.2165 34.7705 26.9958 35.4441 24.3872 35.4441C19.3375 35.4441 15.0633 32.1018 13.5388 27.6108H7.06152V32.5337C10.2517 38.7433 16.8082 43.001 24.3872 43.001Z" fill="#34A853"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M13.5395 27.6094C13.1516 26.4695 12.9313 25.2517 12.9313 23.9994C12.9313 22.7472 13.1516 21.5295 13.5395 20.3894V15.4668H7.06217C5.74911 18.0318 5 20.9336 5 23.9994C5 27.0654 5.74911 29.9673 7.06217 32.5323L13.5395 27.6094Z" fill="#FBBC04"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M24.3872 12.5568C27.2336 12.5568 29.7894 13.5155 31.7987 15.3982L37.3595 9.94866C34.0018 6.88281 29.6131 5 24.3872 5C16.8082 5 10.2517 9.25777 7.06152 15.4674L13.5388 20.39C15.0633 15.8991 19.3375 12.5568 24.3872 12.5568Z" fill="#EA4335"></path></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

@@ -0,0 +1,5 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9.99999 15.8333C13.2217 15.8333 15.8333 13.2216 15.8333 9.99996C15.8333 6.7783 13.2217 4.16663 9.99999 4.16663C6.77833 4.16663 4.16666 6.7783 4.16666 9.99996C4.16666 13.2216 6.77833 15.8333 9.99999 15.8333Z" stroke="#333333" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M4.16666 10H15.8333" stroke="#333333" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M10.0002 4.16663C11.4593 5.764 12.2884 7.83698 12.3335 9.99996C12.2884 12.1629 11.4593 14.2359 10.0002 15.8333C8.54109 14.2359 7.7119 12.1629 7.66684 9.99996C7.7119 7.83698 8.54109 5.764 10.0002 4.16663V4.16663Z" stroke="#333333" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 831 B

@@ -0,0 +1,254 @@
{
"document": {
"type": "editor",
"children": [
{ "type": "cover" },
{
"type": "text",
"attributes": { "subtype": "heading", "heading": "h1" },
"delta": [{ "insert": "Welcome to AppFlowy!" }]
},
{
"type": "text",
"attributes": { "subtype": "heading", "heading": "h2" },
"delta": [{ "insert": "Here are the basics" }]
},
{
"type": "text",
"attributes": { "subtype": "checkbox", "checkbox": null },
"delta": [{ "insert": "Click anywhere and just start typing." }]
},
{
"type": "text",
"attributes": { "subtype": "checkbox", "checkbox": false },
"delta": [
{
"insert": "Highlight ",
"attributes": { "backgroundColor": "0x4dffeb3b" }
},
{ "insert": "any text, and use the editing menu to " },
{ "insert": "style", "attributes": { "italic": true } },
{ "insert": " " },
{ "insert": "your", "attributes": { "bold": true } },
{ "insert": " " },
{ "insert": "writing", "attributes": { "underline": true } },
{ "insert": " " },
{ "insert": "however", "attributes": { "code": true } },
{ "insert": " you " },
{ "insert": "like.", "attributes": { "strikethrough": true } }
]
},
{
"type": "text",
"attributes": { "subtype": "checkbox", "checkbox": null },
"delta": [
{ "insert": "As soon as you type " },
{
"insert": "/",
"attributes": { "code": true, "color": "0xff00b5ff" }
},
{ "insert": " a menu will pop up. Select " },
{
"insert": "different types",
"attributes": { "backgroundColor": "0x4d9c27b0" }
},
{ "insert": " of content blocks you can add." }
]
},
{
"type": "text",
"attributes": { "subtype": "checkbox", "checkbox": null },
"delta": [
{ "insert": "Type " },
{ "insert": "/", "attributes": { "code": true } },
{ "insert": " followed by " },
{ "insert": "/bullet", "attributes": { "code": true } },
{ "insert": " or " },
{ "insert": "/num", "attributes": { "code": true } },
{ "insert": " to create a list.", "attributes": { "code": false } }
]
},
{
"type": "text",
"attributes": { "subtype": "checkbox", "checkbox": true },
"delta": [
{ "insert": "Click " },
{ "insert": "+ New Page ", "attributes": { "code": true } },
{
"insert": "button at the bottom of your sidebar to add a new page."
}
]
},
{
"type": "text",
"attributes": { "subtype": "checkbox", "checkbox": null },
"delta": [
{ "insert": "Click " },
{ "insert": "+", "attributes": { "code": true } },
{ "insert": " next to any page title in the sidebar to " },
{ "insert": "quickly", "attributes": { "color": "0xff8427e0" } },
{ "insert": " add a new subpage, " },
{ "insert": "Document", "attributes": { "code": true } },
{ "insert": ", ", "attributes": { "code": false } },
{ "insert": "Grid", "attributes": { "code": true } },
{ "insert": ", or ", "attributes": { "code": false } },
{ "insert": "Kanban Board", "attributes": { "code": true } },
{ "insert": ".", "attributes": { "code": false } }
]
},
{ "type": "text", "delta": [] },
{ "type": "divider" },
{ "type": "text", "attributes": { "checkbox": null }, "delta": [] },
{
"type": "text",
"attributes": {
"subtype": "heading",
"checkbox": null,
"heading": "h2"
},
"delta": [{ "insert": "Keyboard shortcuts, markdown, and code block" }]
},
{
"type": "text",
"attributes": {
"subtype": "number-list",
"number": 1,
"heading": null
},
"delta": [
{ "insert": "Keyboard shortcuts " },
{
"insert": "guide",
"attributes": {
"href": "https://appflowy.gitbook.io/docs/essential-documentation/shortcuts"
}
},
{ "retain": 1, "attributes": { "strikethrough": true } }
]
},
{
"type": "text",
"attributes": {
"subtype": "number-list",
"number": 2,
"heading": null
},
"delta": [
{ "insert": "Markdown " },
{
"insert": "reference",
"attributes": {
"href": "https://appflowy.gitbook.io/docs/essential-documentation/markdown"
}
},
{ "retain": 1, "attributes": { "strikethrough": true } }
]
},
{
"type": "text",
"attributes": { "number": 3, "subtype": "number-list" },
"delta": [
{ "insert": "Type " },
{ "insert": "/code", "attributes": { "code": true } },
{
"insert": " to insert a code block",
"attributes": { "code": false }
}
]
},
{
"type": "text",
"attributes": {
"subtype": "code_block",
"number": 3,
"heading": null,
"number-list": null,
"theme": "vs",
"language": "rust"
},
"delta": [
{
"insert": "// This is the main function.\nfn main() {\n // Print text to the console.\n println!(\"Hello World!\");\n}"
},
{ "retain": 1, "attributes": { "strikethrough": true } }
]
},
{ "type": "text", "attributes": { "checkbox": null }, "delta": [] },
{
"type": "text",
"attributes": {
"subtype": "heading",
"checkbox": null,
"heading": "h2"
},
"delta": [{ "insert": "Have a question❓" }]
},
{
"type": "text",
"attributes": { "subtype": "quote" },
"delta": [
{ "insert": "Click " },
{ "insert": "?", "attributes": { "code": true } },
{ "insert": " at the bottom right for help and support." }
]
},
{ "type": "text", "delta": [] },
{
"type": "callout",
"children": [
{ "type": "text", "delta": [] },
{
"type": "text",
"attributes": { "subtype": "heading", "heading": "h2" },
"delta": [{ "insert": "Like AppFlowy? Follow us:" }]
},
{
"type": "text",
"attributes": { "subtype": "bulleted-list" },
"delta": [
{
"insert": "GitHub",
"attributes": {
"href": "https://github.com/AppFlowy-IO/AppFlowy"
}
}
]
},
{
"type": "text",
"attributes": { "subtype": "bulleted-list" },
"delta": [
{
"insert": "Twitter",
"attributes": { "href": "https://twitter.com/appflowy" }
},
{ "insert": ": @appflowy" }
]
},
{
"type": "text",
"attributes": { "subtype": "bulleted-list" },
"delta": [
{
"insert": "Newsletter",
"attributes": { "href": "https://blog-appflowy.ghost.io/" }
}
]
}
],
"attributes": { "emoji": "😀" }
},
{ "type": "text", "delta": [] },
{
"type": "text",
"attributes": { "subtype": null, "heading": null },
"delta": []
},
{
"type": "text",
"attributes": { "subtype": null, "heading": null },
"delta": []
}
]
}
}
@@ -0,0 +1,254 @@
{
"document": {
"type": "editor",
"children": [
{ "type": "cover" },
{
"type": "text",
"attributes": { "subtype": "heading", "heading": "h1" },
"delta": [{ "insert": "Welcome to AppFlowy!" }]
},
{
"type": "text",
"attributes": { "subtype": "heading", "heading": "h2" },
"delta": [{ "insert": "Here are the basics" }]
},
{
"type": "text",
"attributes": { "subtype": "checkbox", "checkbox": null },
"delta": [{ "insert": "Click anywhere and just start typing." }]
},
{
"type": "text",
"attributes": { "subtype": "checkbox", "checkbox": false },
"delta": [
{
"insert": "Highlight ",
"attributes": { "backgroundColor": "0x4dffeb3b" }
},
{ "insert": "any text, and use the editing menu to " },
{ "insert": "style", "attributes": { "italic": true } },
{ "insert": " " },
{ "insert": "your", "attributes": { "bold": true } },
{ "insert": " " },
{ "insert": "writing", "attributes": { "underline": true } },
{ "insert": " " },
{ "insert": "however", "attributes": { "code": true } },
{ "insert": " you " },
{ "insert": "like.", "attributes": { "strikethrough": true } }
]
},
{
"type": "text",
"attributes": { "subtype": "checkbox", "checkbox": null },
"delta": [
{ "insert": "As soon as you type " },
{
"insert": "/",
"attributes": { "code": true, "color": "0xff00b5ff" }
},
{ "insert": " a menu will pop up. Select " },
{
"insert": "different types",
"attributes": { "backgroundColor": "0x4d9c27b0" }
},
{ "insert": " of content blocks you can add." }
]
},
{
"type": "text",
"attributes": { "subtype": "checkbox", "checkbox": null },
"delta": [
{ "insert": "Type " },
{ "insert": "/", "attributes": { "code": true } },
{ "insert": " followed by " },
{ "insert": "/bullet", "attributes": { "code": true } },
{ "insert": " or " },
{ "insert": "/num", "attributes": { "code": true } },
{ "insert": " to create a list.", "attributes": { "code": false } }
]
},
{
"type": "text",
"attributes": { "subtype": "checkbox", "checkbox": true },
"delta": [
{ "insert": "Click " },
{ "insert": "+ New Page ", "attributes": { "code": true } },
{
"insert": "button at the bottom of your sidebar to add a new page."
}
]
},
{
"type": "text",
"attributes": { "subtype": "checkbox", "checkbox": null },
"delta": [
{ "insert": "Click " },
{ "insert": "+", "attributes": { "code": true } },
{ "insert": " next to any page title in the sidebar to " },
{ "insert": "quickly", "attributes": { "color": "0xff8427e0" } },
{ "insert": " add a new subpage, " },
{ "insert": "Document", "attributes": { "code": true } },
{ "insert": ", ", "attributes": { "code": false } },
{ "insert": "Grid", "attributes": { "code": true } },
{ "insert": ", or ", "attributes": { "code": false } },
{ "insert": "Kanban Board", "attributes": { "code": true } },
{ "insert": ".", "attributes": { "code": false } }
]
},
{ "type": "text", "delta": [] },
{ "type": "divider" },
{ "type": "text", "attributes": { "checkbox": null }, "delta": [] },
{
"type": "text",
"attributes": {
"subtype": "heading",
"checkbox": null,
"heading": "h2"
},
"delta": [{ "insert": "Keyboard shortcuts, markdown, and code block" }]
},
{
"type": "text",
"attributes": {
"subtype": "number-list",
"number": 1,
"heading": null
},
"delta": [
{ "insert": "Keyboard shortcuts " },
{
"insert": "guide",
"attributes": {
"href": "https://appflowy.gitbook.io/docs/essential-documentation/shortcuts"
}
},
{ "retain": 1, "attributes": { "strikethrough": true } }
]
},
{
"type": "text",
"attributes": {
"subtype": "number-list",
"number": 2,
"heading": null
},
"delta": [
{ "insert": "Markdown " },
{
"insert": "reference",
"attributes": {
"href": "https://appflowy.gitbook.io/docs/essential-documentation/markdown"
}
},
{ "retain": 1, "attributes": { "strikethrough": true } }
]
},
{
"type": "text",
"attributes": { "number": 3, "subtype": "number-list" },
"delta": [
{ "insert": "Type " },
{ "insert": "/code", "attributes": { "code": true } },
{
"insert": " to insert a code block",
"attributes": { "code": false }
}
]
},
{
"type": "text",
"attributes": {
"subtype": "code_block",
"number": 3,
"heading": null,
"number-list": null,
"theme": "vs",
"language": "rust"
},
"delta": [
{
"insert": "// This is the main function.\nfn main() {\n // Print text to the console.\n println!(\"Hello World!\");\n}"
},
{ "retain": 1, "attributes": { "strikethrough": true } }
]
},
{ "type": "text", "attributes": { "checkbox": null }, "delta": [] },
{
"type": "text",
"attributes": {
"subtype": "heading",
"checkbox": null,
"heading": "h2"
},
"delta": [{ "insert": "Have a question❓" }]
},
{
"type": "text",
"attributes": { "subtype": "quote" },
"delta": [
{ "insert": "Click " },
{ "insert": "?", "attributes": { "code": true } },
{ "insert": " at the bottom right for help and support." }
]
},
{ "type": "text", "delta": [] },
{
"type": "callout",
"children": [
{ "type": "text", "delta": [] },
{
"type": "text",
"attributes": { "subtype": "heading", "heading": "h2" },
"delta": [{ "insert": "Like AppFlowy? Follow us:" }]
},
{
"type": "text",
"attributes": { "subtype": "bulleted-list" },
"delta": [
{
"insert": "GitHub",
"attributes": {
"href": "https://github.com/AppFlowy-IO/AppFlowy"
}
}
]
},
{
"type": "text",
"attributes": { "subtype": "bulleted-list" },
"delta": [
{
"insert": "Twitter",
"attributes": { "href": "https://twitter.com/appflowy" }
},
{ "insert": ": @appflowy" }
]
},
{
"type": "text",
"attributes": { "subtype": "bulleted-list" },
"delta": [
{
"insert": "Newsletter",
"attributes": { "href": "https://blog-appflowy.ghost.io/" }
}
]
}
],
"attributes": { "emoji": "😀" }
},
{ "type": "text", "delta": [] },
{
"type": "text",
"attributes": { "subtype": null, "heading": null },
"delta": []
},
{
"type": "text",
"attributes": { "subtype": null, "heading": null },
"delta": []
}
]
}
}
@@ -0,0 +1,22 @@
# Welcome to AppFlowy!
## Here are the basics
- [ ] Click anywhere and just start typing.
- [ ] Highlight any text, and use the editing menu to _style_ **your** <u>writing</u> `however` you ~~like.~~
- [ ] As soon as you type /a menu will pop up. Select different types of content blocks you can add.
- [ ] Type `/` followed by `/bullet` or `/num` to create a list.
- [x] Click `+ New Page `button at the bottom of your sidebar to add a new page.
- [ ] Click `+` next to any page title in the sidebar to quickly add a new subpage, `Document`, `Grid`, or `Kanban Board`.
---
## Keyboard shortcuts, markdown, and code block
1. Keyboard shortcuts [guide](https://appflowy.gitbook.io/docs/essential-documentation/shortcuts)
1. Markdown [reference](https://appflowy.gitbook.io/docs/essential-documentation/markdown)
1. Type `/code` to insert a code block
## Have a question❓
> Click `?` at the bottom right for help and support.
@@ -0,0 +1 @@
# test
@@ -6,6 +6,8 @@
"subscribeNewsletterText": "Subscribe to Newsletter",
"letsGoButtonText": "Quick Start",
"title": "Title",
"youCanAlso": "You can also",
"and": "and",
"signUp": {
"buttonText": "Sign Up",
"title": "Sign Up to @:appName",
@@ -21,6 +23,7 @@
"signIn": {
"loginTitle": "Login to @:appName",
"loginButtonText": "Login",
"loginAsGuestButtonText": "Get Started",
"buttonText": "Sign In",
"forgotPassword": "Forgot Password?",
"emailHint": "Email",
@@ -45,7 +48,14 @@
"medium": "medium",
"large": "large",
"fontSize": "Font Size",
"import": "Import"
"import": "Import",
"moreOptions": "More options"
},
"importPanel": {
"textAndMarkdown": "Text & Markdown",
"documentFromV010": "Document from v0.1.0",
"databaseFromV010": "Database from v0.1.0",
"csv": "CSV"
},
"disclosureAction": {
"rename": "Rename",
@@ -108,6 +118,7 @@
"openAsPage": "Open as a Page",
"addNewRow": "Add a new row",
"openMenu": "Click to open menu",
"dragRow": "Long press to reorder the row",
"viewDataBase": "View database",
"referencePage": "This {name} is referenced"
},
@@ -182,15 +193,20 @@
"theme": "Theme"
},
"files": {
"defaultLocation": "Where your data is stored now",
"copy": "Copy",
"defaultLocation": "Read files and data storage location",
"exportData": "Export your data",
"doubleTapToCopy": "Double tap to copy the path",
"restoreLocation": "Restore to AppFlowy default path",
"customizeLocation": "Open another folder",
"restartApp": "Please restart app for the changes to take effect.",
"exportDatabase": "Export database",
"selectFiles": "Select the files that need to be export",
"selectAll": "Select all",
"deselectAll": "Deselect all",
"createNewFolder": "Create a new folder",
"createNewFolderDesc": "Tell us where you want to store your data",
"defineWhereYourDataIsStored": "Define where your data is stored",
"open": "Open",
"openFolder": "Open an existing folder",
"openFolderDesc": "Read and write it to your existing AppFlowy folder",
@@ -199,9 +215,17 @@
"locationDesc": "Pick a name for your AppFlowy data folder",
"browser": "Browse",
"create": "Create",
"set": "Set",
"folderPath": "Path to store your folder",
"locationCannotBeEmpty": "Path cannot be empty",
"pathCopiedSnackbar": "File storage path copied to clipboard!"
"pathCopiedSnackbar": "File storage path copied to clipboard!",
"changeLocationTooltips": "Change the data directory",
"change": "Change",
"openLocationTooltips": "Open another data directory",
"recoverLocationTooltips": "Reset to AppFlowy's default data directory",
"exportFileSuccess": "Export file successfully!",
"exportFileFail": "Export file failed!",
"export": "Export"
},
"user": {
"name": "Name",
@@ -221,7 +245,8 @@
"deleteFilter": "Delete filter",
"filterBy": "Filter by...",
"typeAValue": "Type a value...",
"layout": "Layout"
"layout": "Layout",
"databaseLayout": "Layout"
},
"textFilter": {
"contains": "Contains",
@@ -272,6 +297,8 @@
"textFieldName": "Text",
"checkboxFieldName": "Checkbox",
"dateFieldName": "Date",
"updatedAtFieldName": "Last modified time",
"createdAtFieldName": "Created time",
"numberFieldName": "Numbers",
"singleSelectFieldName": "Select",
"multiSelectFieldName": "Multiselect",
@@ -347,23 +374,30 @@
"grid": {
"selectAGridToLinkTo": "Select a Grid to link to",
"createANewGrid": "Create a new Grid"
},
"calendar": {
"selectACalendarToLinkTo": "Select a Calendar to link to",
"createANewCalendar": "Create a new Calendar"
}
},
"plugins": {
"referencedBoard": "Referenced Board",
"referencedGrid": "Referenced Grid",
"referencedCalendar": "Referenced Calendar",
"autoGeneratorMenuItemName": "OpenAI Writer",
"autoGeneratorTitleName": "OpenAI: Ask AI to write anything...",
"autoGeneratorLearnMore": "Learn more",
"autoGeneratorGenerate": "Generate",
"autoGeneratorHintText": "Ask OpenAI ...",
"autoGeneratorCantGetOpenAIKey": "Can't get OpenAI key",
"autoGeneratorRewrite": "Rewrite",
"smartEdit": "AI Assistants",
"openAI": "OpenAI",
"smartEditFixSpelling": "Fix spelling",
"warning": "⚠️ AI responses can be inaccurate or misleading.",
"smartEditSummarize": "Summarize",
"smartEditImproveWriting": "Improve Writing",
"smartEditImproveWriting": "Improve writing",
"smartEditMakeLonger": "Make longer",
"smartEditCouldNotFetchResult": "Could not fetch result from OpenAI",
"smartEditCouldNotFetchKey": "Could not fetch OpenAI key",
"smartEditDisabled": "Connect OpenAI in Settings",
@@ -395,6 +429,21 @@
"mathEquation": {
"addMathEquation": "Add Math Equation",
"editMathEquation": "Edit Math Equation"
},
"optionAction": {
"click": "Click",
"toOpenMenu": " to open menu",
"delete": "Delete",
"duplicate": "Duplicate",
"turnInto": "Turn into",
"moveUp": "Move up",
"moveDown": "Move down",
"color": "Color",
"align": "Align",
"left": "Left",
"center": "Center",
"right": "Right",
"defaultColor": "Default"
}
}
},
@@ -418,7 +467,12 @@
"showWeekNumbers": "Show week numbers",
"showWeekends": "Show weekends",
"firstDayOfWeek": "Start week on",
"layoutDateField": "Layout calendar by"
}
"layoutDateField": "Layout calendar by",
"noDateTitle": "No Date",
"noDateHint": "Unscheduled events will show up here",
"clickToAdd": "Click to add to the calendar",
"name": "Calendar layout"
},
"referencedCalendarPrefix": "View of"
}
}
@@ -35,9 +35,7 @@ void main() {
setUpAll(() async => await service.setUpAll());
setUp(() async => await service.setUp());
testWidgets(
'integration test unzips the proper workspace and loads it correctly.',
(tester) async {
testWidgets('open the board with data structure in v0.2.0', (tester) async {
await tester.initializeAppFlowy();
expect(find.byType(AppFlowyBoard), findsOneWidget);
});
@@ -1,54 +1,36 @@
import 'package:flowy_infra_ui/widget/rounded_button.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'util/util.dart';
/// Integration tests for an empty board. The [TestWorkspaceService] will load
/// a workspace from an empty board `assets/test/workspaces/board.zip` for all
/// tests.
///
/// To create another integration test with a preconfigured workspace.
/// Use the following steps.
/// 1. Create a new workspace from the AppFlowy launch screen.
/// 2. Modify the workspace until it is suitable as the starting point for
/// the integration test you need to land.
/// 3. Use a zip utility program to zip the workspace folder that you created.
/// 4. Add the zip file under `assets/test/workspaces/`
/// 5. Add a new enumeration to [TestWorkspace] in `integration_test/utils/data.dart`.
/// For example, if you added a workspace called `empty_calendar.zip`,
/// then [TestWorkspace] should have the following value:
/// ```dart
/// enum TestWorkspace {
/// board('board'),
/// empty_calendar('empty_calendar');
///
/// /* code */
/// }
/// ```
/// 6. Double check that the .zip file that you added is included as an asset in
/// the pubspec.yaml file under appflowy_flutter.
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
const service = TestWorkspaceService(TestWorkspace.coverImage);
group('cover image', () {
setUpAll(() async => await service.setUpAll());
setUp(() async => await service.setUp());
const location = 'cover_image';
setUp(() async {
await TestFolder.cleanTestLocation(location);
await TestFolder.setTestLocation(location);
});
tearDown(() async {
await TestFolder.cleanTestLocation(location);
});
tearDownAll(() async {
await TestFolder.cleanTestLocation(null);
});
testWidgets(
'hovering on cover image will display change and delete cover image buttons',
(tester) async {
await tester.initializeAppFlowy();
expect(find.byType(Image), findsOneWidget);
final TestPointer pointer = TestPointer(1, PointerDeviceKind.mouse);
final imageFinder = find.byType(Image);
Offset offset = tester.getCenter(imageFinder);
await tester.tapGoButton();
await tester.editor.hoverOnCoverPluginAddButton();
pointer.hover(offset);
expect(find.byType(RoundedTextButton), findsOneWidget);
tester.expectToSeePluginAddCoverAndIconButton();
});
});
}
@@ -0,0 +1,185 @@
import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pbenum.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'util/database_test_op.dart';
import 'util/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
group('grid cell', () {
const location = 'appflowy';
setUp(() async {
await TestFolder.cleanTestLocation(location);
await TestFolder.setTestLocation(location);
});
tearDown(() async {
await TestFolder.cleanTestLocation(location);
});
tearDownAll(() async {
await TestFolder.cleanTestLocation(null);
});
testWidgets('edit text cell', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAddButton();
await tester.tapCreateGridButton();
await tester.editCell(
rowIndex: 0,
fieldType: FieldType.RichText,
input: 'hello world',
);
await tester.assertCellContent(
rowIndex: 0,
fieldType: FieldType.RichText,
content: 'hello world',
);
await tester.pumpAndSettle();
});
testWidgets('edit number cell', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAddButton();
await tester.tapCreateGridButton();
const fieldType = FieldType.Number;
// Create a number field
await tester.createField(fieldType, fieldType.name);
await tester.editCell(
rowIndex: 0,
fieldType: fieldType,
input: '-1',
);
// edit the next cell to force the previous cell at row 0 to lose focus
await tester.editCell(
rowIndex: 1,
fieldType: fieldType,
input: '0.2',
);
// -1 -> -1
await tester.assertCellContent(
rowIndex: 0,
fieldType: fieldType,
content: '-1',
);
// edit the next cell to force the previous cell at row 1 to lose focus
await tester.editCell(
rowIndex: 2,
fieldType: fieldType,
input: '.1',
);
// 0.2 -> 0.2
await tester.assertCellContent(
rowIndex: 1,
fieldType: fieldType,
content: '0.2',
);
// edit the next cell to force the previous cell at row 2 to lose focus
await tester.editCell(
rowIndex: 0,
fieldType: fieldType,
input: '',
);
// .1 -> 0.1
await tester.assertCellContent(
rowIndex: 2,
fieldType: fieldType,
content: '0.1',
);
await tester.pumpAndSettle();
});
testWidgets('edit checkbox cell', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAddButton();
await tester.tapCreateGridButton();
await tester.assertCheckboxCell(rowIndex: 0, isSelected: false);
await tester.tapCheckboxCellInGrid(rowIndex: 0);
await tester.assertCheckboxCell(rowIndex: 0, isSelected: true);
await tester.tapCheckboxCellInGrid(rowIndex: 1);
await tester.tapCheckboxCellInGrid(rowIndex: 2);
await tester.assertCheckboxCell(rowIndex: 1, isSelected: true);
await tester.assertCheckboxCell(rowIndex: 2, isSelected: true);
await tester.pumpAndSettle();
});
testWidgets('edit create time cell', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAddButton();
await tester.tapCreateGridButton();
const fieldType = FieldType.CreatedTime;
// Create a create time field
// The create time field is not editable
await tester.createField(fieldType, fieldType.name);
await tester.tapCellInGrid(rowIndex: 0, fieldType: fieldType);
await tester.findDateEditor(findsNothing);
await tester.pumpAndSettle();
});
testWidgets('edit last time cell', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAddButton();
await tester.tapCreateGridButton();
const fieldType = FieldType.LastEditedTime;
// Create a last time field
// The last time field is not editable
await tester.createField(fieldType, fieldType.name);
await tester.tapCellInGrid(rowIndex: 0, fieldType: fieldType);
await tester.findDateEditor(findsNothing);
await tester.pumpAndSettle();
});
testWidgets('edit time cell', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAddButton();
await tester.tapCreateGridButton();
const fieldType = FieldType.DateTime;
await tester.createField(fieldType, fieldType.name);
// Tap the cell to invoke the field editor
await tester.tapCellInGrid(rowIndex: 0, fieldType: fieldType);
await tester.findDateEditor(findsOneWidget);
// Select the date
await tester.selectDay(content: 3);
await tester.pumpAndSettle();
});
});
}
@@ -0,0 +1,202 @@
import 'package:appflowy/plugins/database_view/grid/presentation/grid_page.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pbenum.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'util/database_test_op.dart';
import 'util/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
group('grid page', () {
const location = 'appflowy';
setUp(() async {
await TestFolder.cleanTestLocation(location);
await TestFolder.setTestLocation(location);
});
tearDown(() async {
await TestFolder.cleanTestLocation(location);
});
tearDownAll(() async {
await TestFolder.cleanTestLocation(null);
});
testWidgets('rename existing field', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAddButton();
await tester.tapCreateGridButton();
// Invoke the field editor
await tester.tapGridFieldWithName('Name');
await tester.tapEditPropertyButton();
await tester.renameField('hello world');
await tester.dismissFieldEditor();
await tester.tapGridFieldWithName('hello world');
await tester.pumpAndSettle();
});
testWidgets('update field type of existing field', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAddButton();
await tester.tapCreateGridButton();
// Invoke the field editor
await tester.tapGridFieldWithName('Type');
await tester.tapEditPropertyButton();
await tester.tapTypeOptionButton();
await tester.selectFieldType(FieldType.Checkbox);
await tester.dismissFieldEditor();
await tester.assertFieldTypeWithFieldName(
'Type',
FieldType.Checkbox,
);
await tester.pumpAndSettle();
});
testWidgets('create a field and rename it', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
// create a new grid
await tester.tapAddButton();
await tester.tapCreateGridButton();
// create a field
await tester.createField(FieldType.Checklist, 'checklist');
// check the field is created successfully
await tester.findFieldWithName('checklist');
await tester.pumpAndSettle();
});
testWidgets('delete field', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAddButton();
await tester.tapCreateGridButton();
// create a field
await tester.createField(FieldType.Checkbox, 'New field 1');
// Delete the field
await tester.tapGridFieldWithName('New field 1');
await tester.tapDeletePropertyButton();
// confirm delete
await tester.tapDialogOkButton();
await tester.noFieldWithName('New field 1');
await tester.pumpAndSettle();
});
testWidgets('duplicate field', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAddButton();
await tester.tapCreateGridButton();
// create a field
await tester.scrollToRight(find.byType(GridPage));
await tester.tapNewPropertyButton();
await tester.renameField('New field 1');
await tester.dismissFieldEditor();
await tester.createField(FieldType.RichText, 'New field 1');
// Delete the field
await tester.tapGridFieldWithName('New field 1');
await tester.tapDuplicatePropertyButton();
await tester.findFieldWithName('New field 1 (copy)');
await tester.pumpAndSettle();
});
testWidgets('hide field', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAddButton();
await tester.tapCreateGridButton();
// create a field
await tester.scrollToRight(find.byType(GridPage));
await tester.tapNewPropertyButton();
await tester.renameField('New field 1');
await tester.dismissFieldEditor();
// Delete the field
await tester.tapGridFieldWithName('New field 1');
await tester.tapHidePropertyButton();
await tester.noFieldWithName('New field 1');
await tester.pumpAndSettle();
});
testWidgets('create checklist field ', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAddButton();
await tester.tapCreateGridButton();
await tester.scrollToRight(find.byType(GridPage));
await tester.tapNewPropertyButton();
// Open the type option menu
await tester.tapTypeOptionButton();
await tester.selectFieldType(FieldType.Checklist);
// After update the field type, the cells should be updated
await tester.findCellByFieldType(FieldType.Checklist);
await tester.pumpAndSettle();
});
testWidgets('create list of fields', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAddButton();
await tester.tapCreateGridButton();
for (final fieldType in [
FieldType.Checklist,
FieldType.DateTime,
FieldType.Number,
FieldType.URL,
FieldType.MultiSelect,
FieldType.LastEditedTime,
FieldType.CreatedTime,
FieldType.Checkbox,
]) {
await tester.scrollToRight(find.byType(GridPage));
await tester.tapNewPropertyButton();
await tester.renameField(fieldType.name);
// Open the type option menu
await tester.tapTypeOptionButton();
await tester.selectFieldType(fieldType);
await tester.dismissFieldEditor();
// After update the field type, the cells should be updated
await tester.findCellByFieldType(fieldType);
await tester.pumpAndSettle();
}
});
});
}
@@ -0,0 +1,241 @@
import 'package:appflowy/plugins/database_view/widgets/row/row_banner.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pbenum.dart';
import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:flowy_infra_ui/style_widget/text.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'util/database_test_op.dart';
import 'util/ime.dart';
import 'util/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
group('grid', () {
const location = 'appflowy';
setUp(() async {
await TestFolder.cleanTestLocation(location);
await TestFolder.setTestLocation(location);
});
tearDown(() async {
await TestFolder.cleanTestLocation(location);
});
tearDownAll(() async {
await TestFolder.cleanTestLocation(null);
});
testWidgets('open first row of the grid', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
// Create a new grid
await tester.tapAddButton();
await tester.tapCreateGridButton();
// Hover first row and then open the row page
await tester.openFirstRowDetailPage();
});
testWidgets('insert emoji in the row detail page', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
// Create a new grid
await tester.tapAddButton();
await tester.tapCreateGridButton();
// Hover first row and then open the row page
await tester.openFirstRowDetailPage();
await tester.hoverRowBanner();
await tester.openEmojiPicker();
await tester.switchToEmojiList();
await tester.tapEmoji('😀');
// After select the emoji, the EmojiButton will show up
await tester.tapButton(find.byType(EmojiButton));
});
testWidgets('update emoji in the row detail page', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
// Create a new grid
await tester.tapAddButton();
await tester.tapCreateGridButton();
// Hover first row and then open the row page
await tester.openFirstRowDetailPage();
await tester.hoverRowBanner();
await tester.openEmojiPicker();
await tester.switchToEmojiList();
await tester.tapEmoji('😀');
// Update existing selected emoji
await tester.tapButton(find.byType(EmojiButton));
await tester.switchToEmojiList();
await tester.tapEmoji('😅');
// The emoji already displayed in the row banner
final emojiText = find.byWidgetPredicate(
(widget) => widget is FlowyText && widget.title == '😅',
);
// The number of emoji should be two. One in the row displayed in the grid
// one in the row detail page.
expect(emojiText, findsNWidgets(2));
});
testWidgets('remove emoji in the row detail page', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
// Create a new grid
await tester.tapAddButton();
await tester.tapCreateGridButton();
// Hover first row and then open the row page
await tester.openFirstRowDetailPage();
await tester.hoverRowBanner();
await tester.openEmojiPicker();
await tester.switchToEmojiList();
await tester.tapEmoji('😀');
// Remove the emoji
await tester.tapButton(find.byType(RemoveEmojiButton));
final emojiText = find.byWidgetPredicate(
(widget) => widget is FlowyText && widget.title == '😀',
);
expect(emojiText, findsNothing);
});
testWidgets('create list of fields in row detail page', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
// Create a new grid
await tester.tapAddButton();
await tester.tapCreateGridButton();
// Hover first row and then open the row page
await tester.openFirstRowDetailPage();
for (final fieldType in [
FieldType.Checklist,
FieldType.DateTime,
FieldType.Number,
FieldType.URL,
FieldType.MultiSelect,
FieldType.LastEditedTime,
FieldType.CreatedTime,
FieldType.Checkbox,
]) {
await tester.tapRowDetailPageCreatePropertyButton();
await tester.renameField(fieldType.name);
// Open the type option menu
await tester.tapTypeOptionButton();
await tester.selectFieldType(fieldType);
await tester.dismissFieldEditor();
// After update the field type, the cells should be updated
await tester.findCellByFieldType(fieldType);
await tester.scrollRowDetailByOffset(const Offset(0, -50));
}
});
testWidgets('check document is exist in row detail page', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
// Create a new grid
await tester.tapAddButton();
await tester.tapCreateGridButton();
// Hover first row and then open the row page
await tester.openFirstRowDetailPage();
// Each row detail page should have a document
await tester.assertDocumentExistInRowDetailPage();
});
testWidgets('update the content of the document and re-open it',
(tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
// Create a new grid
await tester.tapAddButton();
await tester.tapCreateGridButton();
// Hover first row and then open the row page
await tester.openFirstRowDetailPage();
// Wait for the document to be loaded
await tester.wait(500);
// Focus on the editor
final textBlock = find.byType(TextBlockComponentWidget);
await tester.tapAt(tester.getCenter(textBlock));
// Input some text
const inputText = 'Hello world';
await tester.ime.insertText(inputText);
expect(
find.textContaining(inputText, findRichText: true),
findsOneWidget,
);
// Tap outside to dismiss the field
await tester.tapAt(Offset.zero);
await tester.pumpAndSettle();
// Re-open the document
await tester.openFirstRowDetailPage();
expect(
find.textContaining(inputText, findRichText: true),
findsOneWidget,
);
});
testWidgets('delete row in row detail page', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
// Create a new grid
await tester.tapAddButton();
await tester.tapCreateGridButton();
// Hover first row and then open the row page
await tester.openFirstRowDetailPage();
await tester.tapRowDetailPageDeleteRowButton();
await tester.tapEscButton();
await tester.assertNumberOfRowsInGridPage(2);
});
testWidgets('duplicate row in row detail page', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
// Create a new grid
await tester.tapAddButton();
await tester.tapCreateGridButton();
// Hover first row and then open the row page
await tester.openFirstRowDetailPage();
await tester.tapRowDetailPageDuplicateRowButton();
await tester.tapEscButton();
await tester.assertNumberOfRowsInGridPage(4);
});
});
}
@@ -0,0 +1,85 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'util/database_test_op.dart';
import 'util/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
group('grid', () {
const location = 'appflowy';
setUp(() async {
await TestFolder.cleanTestLocation(location);
await TestFolder.setTestLocation(location);
});
tearDown(() async {
await TestFolder.cleanTestLocation(location);
});
tearDownAll(() async {
await TestFolder.cleanTestLocation(null);
});
testWidgets('create row of the grid', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAddButton();
await tester.tapCreateGridButton();
await tester.tapCreateRowButtonInGrid();
// The initial number of rows is 3
await tester.assertNumberOfRowsInGridPage(4);
await tester.pumpAndSettle();
});
testWidgets('create row from row menu of the grid', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAddButton();
await tester.tapCreateGridButton();
await tester.hoverOnFirstRowOfGrid();
await tester.tapCreateRowButtonInRowMenuOfGrid();
// The initial number of rows is 3
await tester.assertNumberOfRowsInGridPage(4);
await tester.assertRowCountInGridPage(4);
await tester.pumpAndSettle();
});
testWidgets('delete row of the grid', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAddButton();
await tester.tapCreateGridButton();
await tester.hoverOnFirstRowOfGrid();
// Open the row menu and then click the delete
await tester.tapRowMenuButtonInGrid();
await tester.tapDeleteOnRowMenu();
// The initial number of rows is 3
await tester.assertNumberOfRowsInGridPage(2);
await tester.assertRowCountInGridPage(2);
await tester.pumpAndSettle();
});
testWidgets('check number of row indicator in the initial grid',
(tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAddButton();
await tester.tapCreateGridButton();
await tester.assertRowCountInGridPage(3);
await tester.pumpAndSettle();
});
});
}
@@ -0,0 +1,66 @@
import 'package:appflowy_backend/protobuf/flowy-database2/setting_entities.pbenum.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'util/database_test_op.dart';
import 'util/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
group('grid', () {
const location = 'appflowy';
setUp(() async {
await TestFolder.cleanTestLocation(location);
await TestFolder.setTestLocation(location);
});
tearDown(() async {
await TestFolder.cleanTestLocation(location);
});
tearDownAll(() async {
await TestFolder.cleanTestLocation(null);
});
testWidgets('update layout', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAddButton();
await tester.tapCreateGridButton();
// open setting
await tester.tapDatabaseSettingButton();
// select the layout
await tester.tapDatabaseLayoutButton();
// select layout by board
await tester.selectDatabaseLayoutType(DatabaseLayoutPB.Board);
await tester.assertCurrentDatabaseLayoutType(DatabaseLayoutPB.Board);
await tester.pumpAndSettle();
});
testWidgets('update layout multiple times', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAddButton();
await tester.tapCreateGridButton();
// open setting
await tester.tapDatabaseSettingButton();
await tester.tapDatabaseLayoutButton();
await tester.selectDatabaseLayoutType(DatabaseLayoutPB.Board);
await tester.assertCurrentDatabaseLayoutType(DatabaseLayoutPB.Board);
await tester.tapDatabaseSettingButton();
await tester.tapDatabaseLayoutButton();
await tester.selectDatabaseLayoutType(DatabaseLayoutPB.Calendar);
await tester.assertCurrentDatabaseLayoutType(DatabaseLayoutPB.Calendar);
await tester.pumpAndSettle();
});
});
}
@@ -0,0 +1,90 @@
import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'util/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
group('document', () {
const location = 'appflowy';
setUp(() async {
await TestFolder.cleanTestLocation(location);
await TestFolder.setTestLocation(location);
});
tearDown(() async {
await TestFolder.cleanTestLocation(location);
});
tearDownAll(() async {
await TestFolder.cleanTestLocation(null);
});
testWidgets('create a new document when launching app in first time',
(tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
// create a new document
await tester.tapAddButton();
await tester.tapCreateDocumentButton();
await tester.pumpAndSettle();
// expect to see a new document
tester.expectToSeePageName(
LocaleKeys.menuAppHeader_defaultNewPageName.tr(),
);
// and with one paragraph block
expect(find.byType(TextBlockComponentWidget), findsOneWidget);
});
testWidgets('delete the readme page and restore it', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
// delete the readme page
await tester.hoverOnPageName(readme);
await tester.tapDeletePageButton();
// the banner should show up and the readme page should be gone
tester.expectToSeeDocumentBanner();
tester.expectNotToSeePageName(readme);
// restore the readme page
await tester.tapRestoreButton();
// the banner should be gone and the readme page should be back
tester.expectNotToSeeDocumentBanner();
tester.expectToSeePageName(readme);
});
testWidgets('delete the readme page and delete it permanently',
(tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
// delete the readme page
await tester.hoverOnPageName(readme);
await tester.tapDeletePageButton();
// the banner should show up and the readme page should be gone
tester.expectToSeeDocumentBanner();
tester.expectNotToSeePageName(readme);
// delete the page permanently
await tester.tapDeletePermanentlyButton();
// the banner should be gone and the readme page should be gone
tester.expectNotToSeeDocumentBanner();
tester.expectNotToSeePageName(readme);
});
});
}
@@ -0,0 +1,110 @@
import 'package:appflowy/plugins/database_view/board/presentation/board_page.dart';
import 'package:appflowy/plugins/database_view/grid/presentation/grid_page.dart';
import 'package:appflowy/plugins/document/presentation/editor_plugins/base/link_to_page_widget.dart';
import 'package:appflowy_backend/protobuf/flowy-folder2/protobuf.dart';
import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:flowy_infra/uuid.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'util/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
group('database view in document', () {
const location = 'database_view';
setUp(() async {
await TestFolder.cleanTestLocation(location);
await TestFolder.setTestLocation(location);
});
tearDown(() async {
await TestFolder.cleanTestLocation(null);
});
testWidgets('insert a referenced grid', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await insertReferenceDatabase(tester, ViewLayoutPB.Grid);
// validate the referenced grid is inserted
expect(
find.descendant(
of: find.byType(AppFlowyEditor),
matching: find.byType(GridPage),
),
findsOneWidget,
);
});
testWidgets('insert a referenced board', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await insertReferenceDatabase(tester, ViewLayoutPB.Board);
// validate the referenced board is inserted
expect(
find.descendant(
of: find.byType(AppFlowyEditor),
matching: find.byType(BoardPage),
),
findsOneWidget,
);
});
// testWidgets('insert a referenced calendar', (tester) async {
// await tester.initializeAppFlowy();
// await tester.tapGoButton();
// await insertReferenceDatabase(tester, ViewLayoutPB.Calendar);
// // validate the referenced grid is inserted
// expect(
// find.descendant(
// of: find.byType(AppFlowyEditor),
// matching: find.byType(CalendarPage),
// ),
// findsOneWidget,
// );
// });
});
}
/// Insert a referenced database of [layout] into the document
Future<void> insertReferenceDatabase(
WidgetTester tester,
ViewLayoutPB layout,
) async {
// create a new grid
final id = uuid();
final name = '${layout.name}_$id';
await tester.createNewPageWithName(
layout,
name,
);
// create a new document
await tester.createNewPageWithName(
ViewLayoutPB.Document,
'insert_a_reference_${layout.name}',
);
// tap the first line of the document
await tester.editor.tapLineOfEditorAt(0);
// insert a referenced grid
await tester.editor.showSlashMenu();
await tester.editor.tapSlashMenuItemWithName(
layout.referencedMenuName,
);
final linkToPageMenu = find.byType(LinkToPageMenu);
expect(linkToPageMenu, findsOneWidget);
final referencedDatabase = find.descendant(
of: linkToPageMenu,
matching: find.findTextInFlowyText(name),
);
expect(referencedDatabase, findsOneWidget);
await tester.tapButton(referencedDatabase);
}
@@ -1,4 +1,4 @@
import 'package:appflowy/plugins/document/presentation/plugins/base/built_in_page_widget.dart';
import 'package:appflowy/plugins/document/presentation/editor_plugins/base/built_in_page_widget.dart';
import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
@@ -0,0 +1,60 @@
import 'dart:io';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'util/mock/mock_file_picker.dart';
import 'util/util.dart';
import 'package:path/path.dart' as p;
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
group('import files', () {
const location = 'import_files';
setUp(() async {
await TestFolder.cleanTestLocation(location);
await TestFolder.setTestLocation(location);
});
tearDown(() async {
await TestFolder.cleanTestLocation(location);
});
tearDownAll(() async {
await TestFolder.cleanTestLocation(null);
});
testWidgets('import multiple markdown files', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
// expect to see a readme page
tester.expectToSeePageName(readme);
await tester.tapAddButton();
await tester.tapImportButton();
final testFileNames = ['test1.md', 'test2.md'];
final fileLocation = await tester.currentFileLocation();
for (final fileName in testFileNames) {
final str = await rootBundle.loadString(
p.join(
'assets/test/workspaces/markdowns',
fileName,
),
);
File(p.join(fileLocation, fileName)).writeAsStringSync(str);
}
// mock get files
await mockPickFilePaths(testFileNames, name: location);
await tester.tapTextAndMarkdownButton();
tester.expectToSeePageName('test1');
tester.expectToSeePageName('test2');
});
});
}
@@ -0,0 +1,45 @@
import 'package:appflowy/workspace/presentation/settings/widgets/settings_language_view.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'util/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
group('document', () {
const location = 'appflowy';
setUpAll(() async {
await TestFolder.setTestLocation(location);
});
tearDownAll(() async {
await TestFolder.cleanTestLocation(null);
});
testWidgets(
'change the language successfully when launching the app for the first time',
(tester) async {
await tester.initializeAppFlowy();
await tester.tapLanguageSelectorOnWelcomePage();
expect(find.byType(LanguageItemsListView), findsOneWidget);
await tester.tapLanguageItem(languageCode: 'zh', countryCode: 'CN');
tester.expectToSeeText('开始');
await tester.tapLanguageItem(languageCode: 'en', scrollDelta: -100);
tester.expectToSeeText('Quick Start');
await tester.tapLanguageItem(languageCode: 'it', countryCode: 'IT');
tester.expectToSeeText('Andiamo');
});
/// Make sure this test is executed after the test above.
testWidgets('check the language after relaunching the app', (tester) async {
await tester.initializeAppFlowy();
tester.expectToSeeText('Andiamo');
});
});
}
@@ -1,4 +1,4 @@
import 'package:appflowy/plugins/document/presentation/plugins/openai/service/openai_client.dart';
import 'package:appflowy/plugins/document/presentation/editor_plugins/openai/service/openai_client.dart';
import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
@@ -1,9 +1,11 @@
import 'package:integration_test/integration_test.dart';
import 'board_test.dart' as board_test;
import 'switch_folder_test.dart' as switch_folder_test;
import 'empty_document_test.dart' as empty_document_test;
import 'open_ai_smart_menu_test.dart' as smart_menu_test;
import 'document_test.dart' as document_test;
import 'cover_image_test.dart' as cover_image_test;
import 'share_markdown_test.dart' as share_markdown_test;
import 'import_files_test.dart' as import_files_test;
import 'document_with_database_test.dart' as document_with_database_test;
/// The main task runner for all integration tests in AppFlowy.
///
@@ -15,7 +17,12 @@ import 'open_ai_smart_menu_test.dart' as smart_menu_test;
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
switch_folder_test.main();
board_test.main();
empty_document_test.main();
smart_menu_test.main();
cover_image_test.main();
document_test.main();
share_markdown_test.main();
import_files_test.main();
document_with_database_test.main();
// board_test.main();
// empty_document_test.main();
// smart_menu_test.main();
}
@@ -0,0 +1,108 @@
import 'dart:io';
import 'package:appflowy/plugins/document/presentation/share/share_button.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'util/mock/mock_file_picker.dart';
import 'util/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
group('share markdown in document page', () {
const location = 'markdown';
setUp(() async {
await TestFolder.cleanTestLocation(location);
await TestFolder.setTestLocation(location);
});
tearDown(() async {
await TestFolder.cleanTestLocation(location);
});
tearDownAll(() async {
await TestFolder.cleanTestLocation(null);
});
testWidgets('click the share button in document page', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
// expect to see a readme page
tester.expectToSeePageName(readme);
// mock the file picker
final path = await mockSaveFilePath(location, 'test.md');
// click the share button and select markdown
await tester.tapShareButton();
await tester.tapMarkdownButton();
// expect to see the success dialog
tester.expectToExportSuccess();
final file = File(path);
final isExist = file.existsSync();
expect(isExist, true);
final markdown = file.readAsStringSync();
expect(markdown, expectedMarkdown);
});
testWidgets(
'share the markdown after renaming the document name',
(tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
// expect to see a readme page
tester.expectToSeePageName(readme);
// rename the document
await tester.hoverOnPageName(readme);
await tester.renamePage('example');
final shareButton = find.byType(ShareActionList);
final shareButtonState =
tester.state(shareButton) as ShareActionListState;
final path =
await mockSaveFilePath(location, '${shareButtonState.name}.md');
// click the share button and select markdown
await tester.tapShareButton();
await tester.tapMarkdownButton();
// expect to see the success dialog
tester.expectToExportSuccess();
final file = File(path);
final isExist = file.existsSync();
expect(isExist, true);
},
);
});
}
const expectedMarkdown = r'''
# Welcome to AppFlowy!
## Here are the basics
- [ ] Click anywhere and just start typing.
- [ ] Highlight any text, and use the editing menu to _style_ **your** <u>writing</u> `however` you ~~like.~~
- [ ] As soon as you type `/` a menu will pop up. Select different types of content blocks you can add.
- [ ] Type `/` followed by `/bullet` or `/num` to create a list.
- [x] Click `+ New Page `button at the bottom of your sidebar to add a new page.
- [ ] Click `+` next to any page title in the sidebar to quickly add a new subpage, `Document`, `Grid`, or `Kanban Board`.
---
## Keyboard shortcuts, markdown, and code block
1. Keyboard shortcuts [guide](https://appflowy.gitbook.io/docs/essential-documentation/shortcuts)
1. Markdown [reference](https://appflowy.gitbook.io/docs/essential-documentation/markdown)
1. Type `/code` to insert a code block
## Have a question❓
> Click `?` at the bottom right for help and support.
''';
@@ -1,5 +1,4 @@
import 'package:appflowy/user/presentation/folder/folder_widget.dart';
import 'package:flowy_infra_ui/style_widget/text_field.dart';
import 'package:appflowy/workspace/application/settings/prelude.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
@@ -25,69 +24,22 @@ void main() {
await TestFolder.cleanTestLocation(null);
});
testWidgets(
'customize folder name and path when launching app in first time',
(tester) async {
const folderName = 'appflowy';
await TestFolder.cleanTestLocation(folderName);
await tester.initializeAppFlowy();
// Click create button
await tester.tapCreateButton();
// Set directory
final cfw = find.byType(CreateFolderWidget);
expect(cfw, findsOneWidget);
final state = tester.state(cfw) as CreateFolderWidgetState;
final dir = await TestFolder.testLocation(null);
state.directory = dir.path;
// input folder name
final ftf = find.byType(FlowyTextField);
expect(ftf, findsOneWidget);
await tester.enterText(ftf, 'appflowy');
// Click create button again
await tester.tapCreateButton();
await tester.expectToSeeWelcomePage();
await TestFolder.cleanTestLocation(folderName);
});
testWidgets('open a new folder when launching app in first time',
(tester) async {
const folderName = 'appflowy';
await TestFolder.cleanTestLocation(folderName);
await TestFolder.setTestLocation(folderName);
await tester.initializeAppFlowy();
// tap open button
await mockGetDirectoryPath(folderName);
await tester.tapOpenFolderButton();
await tester.wait(1000);
await tester.expectToSeeWelcomePage();
await TestFolder.cleanTestLocation(folderName);
});
testWidgets('switch to B from A, then switch to A again', (tester) async {
const String userA = 'userA';
const String userB = 'userB';
await TestFolder.cleanTestLocation(userA);
await TestFolder.cleanTestLocation(userB);
await TestFolder.setTestLocation(userA);
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.expectToSeeWelcomePage();
tester.expectToSeeHomePage();
// switch to user B
{
// set user name to userA
await tester.openSettings();
await tester.openSettingsPage(SettingsPage.user);
await tester.enterUserName(userA);
@@ -99,15 +51,16 @@ void main() {
await mockGetDirectoryPath(userB);
await tester.tapCustomLocationButton();
await tester.pumpAndSettle();
await tester.expectToSeeWelcomePage();
tester.expectToSeeHomePage();
// set user name to userB
await tester.openSettings();
await tester.openSettingsPage(SettingsPage.user);
await tester.enterUserName(userB);
}
// switch to the userA
{
await tester.openSettings();
await tester.openSettingsPage(SettingsPage.user);
await tester.enterUserName(userB);
await tester.openSettingsPage(SettingsPage.files);
await tester.pumpAndSettle();
@@ -116,8 +69,8 @@ void main() {
await tester.tapCustomLocationButton();
await tester.pumpAndSettle();
await tester.expectToSeeWelcomePage();
expect(find.textContaining(userA), findsOneWidget);
tester.expectToSeeHomePage();
tester.expectToSeeUserName(userA);
}
// switch to the userB again
@@ -131,8 +84,8 @@ void main() {
await tester.tapCustomLocationButton();
await tester.pumpAndSettle();
await tester.expectToSeeWelcomePage();
expect(find.textContaining(userB), findsOneWidget);
tester.expectToSeeHomePage();
tester.expectToSeeUserName(userB);
}
await TestFolder.cleanTestLocation(userA);
@@ -145,7 +98,7 @@ void main() {
await tester.tapGoButton();
// home and readme document
await tester.expectToSeeWelcomePage();
tester.expectToSeeHomePage();
// open settings and restore the location
await tester.openSettings();
@@ -1,8 +1,9 @@
import 'dart:io';
import 'package:appflowy/core/config/kv_keys.dart';
import 'package:appflowy/main.dart' as app;
import 'package:appflowy/startup/tasks/prelude.dart';
import 'package:appflowy/workspace/application/settings/settings_location_cubit.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
@@ -21,7 +22,7 @@ class TestFolder {
static Future<void> setTestLocation(String? name) async {
final location = await testLocation(name);
SharedPreferences.setMockInitialValues({
kSettingsLocationDefaultLocation: location.path,
KVKeys.pathLocation: location.path,
});
return;
}
@@ -36,7 +37,7 @@ class TestFolder {
/// Get current using location.
static Future<String> currentLocation() async {
final prefs = await SharedPreferences.getInstance();
return prefs.getString(kSettingsLocationDefaultLocation)!;
return prefs.getString(KVKeys.pathLocation)!;
}
/// Get default location under development environment.
@@ -58,17 +59,21 @@ class TestFolder {
extension AppFlowyTestBase on WidgetTester {
Future<void> initializeAppFlowy() async {
const MethodChannel('hotkey_manager')
.setMockMethodCallHandler((MethodCall methodCall) async {
if (methodCall.method == 'unregisterAll') {
// do nothing
}
});
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
.setMockMethodCallHandler(
const MethodChannel('hotkey_manager'),
(MethodCall methodCall) async {
if (methodCall.method == 'unregisterAll') {
// do nothing
}
return;
},
);
await app.main();
await wait(3000);
await pumpAndSettle(const Duration(seconds: 2));
return;
}
Future<void> tapButton(
@@ -87,7 +92,16 @@ extension AppFlowyTestBase on WidgetTester {
String tr, {
int milliseconds = 500,
}) async {
final button = find.text(tr);
Finder button = find.text(
tr,
findRichText: true,
skipOffstage: false,
);
if (button.evaluate().isEmpty) {
button = find.byWidgetPredicate(
(widget) => widget is FlowyText && widget.title == tr,
);
}
await tapButton(
button,
milliseconds: milliseconds,
@@ -112,3 +126,11 @@ extension AppFlowyTestBase on WidgetTester {
return;
}
}
extension AppFlowyFinderTestBase on CommonFinders {
Finder findTextInFlowyText(String text) {
return find.byWidgetPredicate(
(widget) => widget is FlowyText && widget.title == text,
);
}
}
@@ -0,0 +1,263 @@
import 'dart:ui';
import 'package:appflowy_backend/log.dart';
import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/plugins/document/presentation/share/share_button.dart';
import 'package:appflowy/user/presentation/skip_log_in_screen.dart';
import 'package:appflowy/workspace/presentation/home/menu/app/header/add_button.dart';
import 'package:appflowy/workspace/presentation/home/menu/app/section/item.dart';
import 'package:appflowy/workspace/presentation/settings/widgets/settings_language_view.dart';
import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra_ui/widget/buttons/primary_button.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'util.dart';
extension CommonOperations on WidgetTester {
/// Get current file location of AppFlowy.
Future<String> currentFileLocation() async {
return TestFolder.currentLocation();
}
/// Tap the GetStart button on the launch page.
Future<void> tapGoButton() async {
final goButton = find.byType(GoButton);
await tapButton(goButton);
}
/// Tap the + button on the home page.
Future<void> tapAddButton() async {
final addButton = find.byType(AddButton);
await tapButton(addButton);
}
/// Tap the create document button.
///
/// Must call [tapAddButton] first.
Future<void> tapCreateDocumentButton() async {
await tapButtonWithName(LocaleKeys.document_menuName.tr());
}
/// Tap the create grid button.
///
/// Must call [tapAddButton] first.
Future<void> tapCreateGridButton() async {
await tapButtonWithName(LocaleKeys.grid_menuName.tr());
}
/// Tap the import button.
///
/// Must call [tapAddButton] first.
Future<void> tapImportButton() async {
await tapButtonWithName(LocaleKeys.moreAction_import.tr());
}
/// Tap the import from text & markdown button.
///
/// Must call [tapImportButton] first.
Future<void> tapTextAndMarkdownButton() async {
await tapButtonWithName(LocaleKeys.importPanel_textAndMarkdown.tr());
}
/// Tap the LanguageSelectorOnWelcomePage widget on the launch page.
Future<void> tapLanguageSelectorOnWelcomePage() async {
final languageSelector = find.byType(LanguageSelectorOnWelcomePage);
await tapButton(languageSelector);
}
/// Tap languageItem on LanguageItemsListView.
///
/// [scrollDelta] is the distance to scroll the ListView.
/// Default value is 100
///
/// If it is positive -> scroll down.
///
/// If it is negative -> scroll up.
Future<void> tapLanguageItem({
required String languageCode,
String? countryCode,
double? scrollDelta,
}) async {
final languageItemsListView = find.descendant(
of: find.byType(ListView),
matching: find.byType(Scrollable),
);
final languageItem = find.byWidgetPredicate(
(widget) =>
widget is LanguageItem &&
widget.locale.languageCode == languageCode &&
widget.locale.countryCode == countryCode,
);
// scroll the ListView until zHCNLanguageItem shows on the screen.
await scrollUntilVisible(
languageItem,
scrollDelta ?? 100,
scrollable: languageItemsListView,
// maxHeight of LanguageItemsListView
maxScrolls: 400,
);
try {
await tapButton(languageItem);
} on FlutterError catch (e) {
Log.warn('tapLanguageItem error: $e');
}
}
/// Hover on the widget.
Future<void> hoverOnWidget(
Finder finder, {
Offset? offset,
Future<void> Function()? onHover,
}) async {
try {
final gesture = await createGesture(kind: PointerDeviceKind.mouse);
await gesture.addPointer(location: Offset.zero);
await pump();
await gesture.moveTo(offset ?? getCenter(finder));
await pumpAndSettle();
await onHover?.call();
await gesture.removePointer();
} catch (err) {
Log.error('hoverOnWidget error: $err');
}
}
/// Hover on the page name.
Future<void> hoverOnPageName(
String name, {
Future<void> Function()? onHover,
bool useLast = true,
}) async {
if (useLast) {
await hoverOnWidget(findPageName(name).last, onHover: onHover);
} else {
await hoverOnWidget(findPageName(name).first, onHover: onHover);
}
}
/// Tap the ... button beside the page name.
///
/// Must call [hoverOnPageName] first.
Future<void> tapPageOptionButton() async {
final optionButton = find.byType(ViewDisclosureButton);
await tapButton(optionButton);
}
/// Tap the delete page button.
Future<void> tapDeletePageButton() async {
await tapPageOptionButton();
await tapButtonWithName(ViewDisclosureAction.delete.name);
}
/// Tap the rename page button.
Future<void> tapRenamePageButton() async {
await tapPageOptionButton();
await tapButtonWithName(ViewDisclosureAction.rename.name);
}
/// Rename the page.
Future<void> renamePage(String name) async {
await tapRenamePageButton();
await enterText(find.byType(TextFormField), name);
await tapOKButton();
}
Future<void> tapOKButton() async {
final okButton = find.byWidgetPredicate(
(widget) =>
widget is PrimaryTextButton &&
widget.label == LocaleKeys.button_OK.tr(),
);
await tapButton(okButton);
}
/// Tap the restore button.
///
/// the restore button will show after the current page is deleted.
Future<void> tapRestoreButton() async {
final restoreButton = find.textContaining(
LocaleKeys.deletePagePrompt_restore.tr(),
);
await tapButton(restoreButton);
}
/// Tap the delete permanently button.
///
/// the restore button will show after the current page is deleted.
Future<void> tapDeletePermanentlyButton() async {
final restoreButton = find.textContaining(
LocaleKeys.deletePagePrompt_deletePermanent.tr(),
);
await tapButton(restoreButton);
}
/// Tap the share button above the document page.
Future<void> tapShareButton() async {
final shareButton = find.byWidgetPredicate(
(widget) => widget is DocumentShareButton,
);
await tapButton(shareButton);
}
/// Tap the export markdown button
///
/// Must call [tapShareButton] first.
Future<void> tapMarkdownButton() async {
final markdownButton = find.textContaining(
LocaleKeys.shareAction_markdown.tr(),
);
await tapButton(markdownButton);
}
Future<void> createNewPageWithName(ViewLayoutPB layout, String name) async {
// create a new page
await tapAddButton();
await tapButtonWithName(layout.menuName);
await pumpAndSettle();
// hover on it and change it's name
await hoverOnPageName(
LocaleKeys.menuAppHeader_defaultNewPageName.tr(),
onHover: () async {
await renamePage(name);
await pumpAndSettle();
},
);
await pumpAndSettle();
}
}
extension ViewLayoutPBTest on ViewLayoutPB {
String get menuName {
switch (this) {
case ViewLayoutPB.Grid:
return LocaleKeys.grid_menuName.tr();
case ViewLayoutPB.Board:
return LocaleKeys.board_menuName.tr();
case ViewLayoutPB.Document:
return LocaleKeys.document_menuName.tr();
case ViewLayoutPB.Calendar:
return LocaleKeys.calendar_menuName.tr();
default:
throw UnsupportedError('Unsupported layout: $this');
}
}
String get referencedMenuName {
switch (this) {
case ViewLayoutPB.Grid:
return LocaleKeys.document_plugins_referencedGrid.tr();
case ViewLayoutPB.Board:
return LocaleKeys.document_plugins_referencedBoard.tr();
case ViewLayoutPB.Calendar:
return LocaleKeys.document_plugins_referencedCalendar.tr();
default:
throw UnsupportedError('Unsupported layout: $this');
}
}
}
@@ -1,6 +1,6 @@
import 'dart:io';
import 'package:appflowy/workspace/application/settings/settings_location_cubit.dart';
import 'package:appflowy/core/config/kv_keys.dart';
import 'package:archive/archive_io.dart';
import 'package:flutter/services.dart';
import 'package:path/path.dart' as p;
@@ -49,10 +49,11 @@ class TestWorkspaceService {
/// Instructs the application to read workspace data from the workspace found under this [TestWorkspace]'s path.
Future<void> setUpAll() async {
final root = await workspace.root;
final path = root.path;
SharedPreferences.setMockInitialValues(
{
kSettingsLocationDefaultLocation:
await workspace.root.then((value) => value.path),
KVKeys.pathLocation: path,
},
);
}
@@ -0,0 +1,481 @@
import 'dart:ui';
import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/plugins/database_view/application/setting/setting_bloc.dart';
import 'package:appflowy/plugins/database_view/board/presentation/board_page.dart';
import 'package:appflowy/plugins/database_view/calendar/presentation/calendar_page.dart';
import 'package:appflowy/plugins/database_view/grid/presentation/widgets/header/field_cell_action_sheet.dart';
import 'package:appflowy/plugins/database_view/grid/presentation/widgets/header/field_type_option_editor.dart';
import 'package:appflowy/plugins/database_view/grid/presentation/widgets/toolbar/grid_layout.dart';
import 'package:appflowy/plugins/database_view/widgets/row/row_document.dart';
import 'package:appflowy/plugins/database_view/widgets/row/cells/date_cell/date_editor.dart';
import 'package:appflowy/plugins/database_view/widgets/setting/database_setting.dart';
import 'package:appflowy/plugins/database_view/widgets/setting/setting_button.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/setting_entities.pbenum.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra_ui/style_widget/icon_button.dart';
import 'package:flowy_infra_ui/widget/buttons/primary_button.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:appflowy/plugins/database_view/grid/presentation/grid_page.dart';
import 'package:appflowy/plugins/database_view/grid/presentation/widgets/footer/grid_footer.dart';
import 'package:appflowy/plugins/database_view/grid/presentation/widgets/header/field_cell.dart';
import 'package:appflowy/plugins/database_view/grid/presentation/widgets/header/field_editor.dart';
import 'package:appflowy/plugins/database_view/grid/presentation/widgets/header/field_type_extension.dart';
import 'package:appflowy/plugins/database_view/grid/presentation/widgets/row/row.dart';
import 'package:appflowy/plugins/database_view/widgets/row/accessory/cell_accessory.dart';
import 'package:appflowy/plugins/database_view/widgets/row/cells/cells.dart';
import 'package:appflowy/plugins/database_view/widgets/row/row_action.dart';
import 'package:appflowy/plugins/database_view/widgets/row/row_banner.dart';
import 'package:appflowy/plugins/database_view/widgets/row/row_detail.dart';
import 'package:appflowy/plugins/document/presentation/editor_plugins/emoji_picker/emoji_menu_item.dart';
import 'package:flowy_infra_ui/style_widget/text.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pbenum.dart';
import 'package:table_calendar/table_calendar.dart';
import 'base.dart';
import 'common_operations.dart';
extension AppFlowyDatabaseTest on WidgetTester {
Future<void> hoverOnFirstRowOfGrid() async {
final findRow = find.byType(GridRow);
expect(findRow, findsWidgets);
final firstRow = findRow.first;
await hoverOnWidget(firstRow);
}
Future<void> editCell({
required int rowIndex,
required FieldType fieldType,
required String input,
}) async {
final findRow = find.byType(GridRow);
final findCell = finderForFieldType(fieldType);
final cell = find.descendant(
of: findRow.at(rowIndex),
matching: findCell,
);
expect(cell, findsOneWidget);
await enterText(cell, input);
await pumpAndSettle();
}
Future<void> tapCheckboxCellInGrid({
required int rowIndex,
}) async {
final findRow = find.byType(GridRow);
final findCell = finderForFieldType(FieldType.Checkbox);
final cell = find.descendant(
of: findRow.at(rowIndex),
matching: findCell,
);
final button = find.descendant(
of: cell,
matching: find.byType(FlowyIconButton),
);
expect(cell, findsOneWidget);
await tapButton(button);
}
Future<void> assertCheckboxCell({
required int rowIndex,
required bool isSelected,
}) async {
final findRow = find.byType(GridRow);
final findCell = finderForFieldType(FieldType.Checkbox);
final cell = find.descendant(
of: findRow.at(rowIndex),
matching: findCell,
);
var finder = find.byType(CheckboxCellUncheck);
if (isSelected) {
finder = find.byType(CheckboxCellCheck);
}
expect(
find.descendant(
of: cell,
matching: finder,
),
findsOneWidget,
);
}
Future<void> tapCellInGrid({
required int rowIndex,
required FieldType fieldType,
}) async {
final findRow = find.byType(GridRow);
final findCell = finderForFieldType(fieldType);
final cell = find.descendant(
of: findRow.at(rowIndex),
matching: findCell,
);
expect(cell, findsOneWidget);
await tapButton(cell);
}
Future<void> assertCellContent({
required int rowIndex,
required FieldType fieldType,
required String content,
}) async {
final findRow = find.byType(GridRow);
final findCell = finderForFieldType(fieldType);
final cell = find.descendant(
of: findRow.at(rowIndex),
matching: findCell,
);
final findContent = find.descendant(
of: cell,
matching: find.text(content),
);
expect(findContent, findsOneWidget);
}
Future<void> selectDay({
required int content,
}) async {
final findCalendar = find.byType(TableCalendar);
final findDay = find.text(content.toString());
final finder = find.descendant(
of: findCalendar,
matching: findDay,
);
await tapButton(finder);
}
Future<void> openFirstRowDetailPage() async {
await hoverOnFirstRowOfGrid();
final expandButton = find.byType(PrimaryCellAccessory);
expect(expandButton, findsOneWidget);
await tapButton(expandButton);
}
Future<void> hoverRowBanner() async {
final banner = find.byType(RowBanner);
expect(banner, findsOneWidget);
await startGesture(
getTopLeft(banner),
kind: PointerDeviceKind.mouse,
);
await pumpAndSettle();
}
Future<void> openEmojiPicker() async {
await tapButton(find.byType(EmojiPickerButton));
await tapButton(find.byType(EmojiSelectionMenu));
}
/// Must call [openEmojiPicker] first
Future<void> switchToEmojiList() async {
final icon = find.byIcon(Icons.tag_faces);
await tapButton(icon);
}
Future<void> tapEmoji(String emoji) async {
final emojiWidget = find.text(emoji);
await tapButton(emojiWidget);
}
Future<void> scrollGridByOffset(Offset offset) async {
await drag(find.byType(GridPage), offset);
await pumpAndSettle();
}
Future<void> scrollRowDetailByOffset(Offset offset) async {
await drag(find.byType(RowDetailPage), offset);
await pumpAndSettle();
}
Future<void> scrollToRight(Finder find) async {
final size = getSize(find);
await drag(find, Offset(-size.width, 0));
await pumpAndSettle(const Duration(milliseconds: 500));
}
Future<void> tapNewPropertyButton() async {
await tapButtonWithName(LocaleKeys.grid_field_newProperty.tr());
await pumpAndSettle();
}
Future<void> tapGridFieldWithName(String name) async {
final field = find.byWidgetPredicate(
(widget) => widget is FieldCellButton && widget.field.name == name,
);
await tapButton(field);
await pumpAndSettle();
}
/// Should call [tapGridFieldWithName] first.
Future<void> tapEditPropertyButton() async {
await tapButtonWithName(LocaleKeys.grid_field_editProperty.tr());
await pumpAndSettle(const Duration(milliseconds: 200));
}
/// Should call [tapGridFieldWithName] first.
Future<void> tapDeletePropertyButton() async {
final field = find.byWidgetPredicate(
(widget) =>
widget is FieldActionCell && widget.action == FieldAction.delete,
);
await tapButton(field);
}
/// Should call [tapGridFieldWithName] first.
Future<void> tapDialogOkButton() async {
final field = find.byWidgetPredicate(
(widget) =>
widget is PrimaryTextButton &&
widget.label == LocaleKeys.button_OK.tr(),
);
await tapButton(field);
}
/// Should call [tapGridFieldWithName] first.
Future<void> tapDuplicatePropertyButton() async {
final field = find.byWidgetPredicate(
(widget) =>
widget is FieldActionCell && widget.action == FieldAction.duplicate,
);
await tapButton(field);
}
/// Should call [tapGridFieldWithName] first.
Future<void> tapHidePropertyButton() async {
final field = find.byWidgetPredicate(
(widget) =>
widget is FieldActionCell && widget.action == FieldAction.hide,
);
await tapButton(field);
}
Future<void> tapRowDetailPageCreatePropertyButton() async {
await tapButton(find.byType(CreateRowFieldButton));
}
Future<void> tapRowDetailPageDeleteRowButton() async {
await tapButton(find.byType(RowDetailPageDeleteButton));
}
Future<void> tapRowDetailPageDuplicateRowButton() async {
await tapButton(find.byType(RowDetailPageDuplicateButton));
}
Future<void> tapTypeOptionButton() async {
await tapButton(find.byType(SwitchFieldButton));
}
Future<void> tapEscButton() async {
await sendKeyEvent(LogicalKeyboardKey.escape);
}
/// Must call [tapTypeOptionButton] first.
Future<void> selectFieldType(FieldType fieldType) async {
final fieldTypeButton = find.byWidgetPredicate(
(widget) => widget is FlowyText && widget.title == fieldType.title(),
);
await tapButton(fieldTypeButton);
}
/// Each field has its own cell, so we can find the corresponding cell by
/// the field type after create a new field.
Future<void> findCellByFieldType(FieldType fieldType) async {
final finder = finderForFieldType(fieldType);
expect(finder, findsWidgets);
}
Future<void> assertNumberOfFieldsInGridPage(int num) async {
expect(find.byType(GridFieldCell), findsNWidgets(num));
}
Future<void> assertNumberOfRowsInGridPage(int num) async {
expect(find.byType(GridRow), findsNWidgets(num));
}
Future<void> assertDocumentExistInRowDetailPage() async {
expect(find.byType(RowDocument), findsOneWidget);
}
/// Check the field type of the [FieldCellButton] is the same as the name.
Future<void> assertFieldTypeWithFieldName(
String name,
FieldType fieldType,
) async {
final field = find.byWidgetPredicate(
(widget) =>
widget is FieldCellButton &&
widget.field.fieldType == fieldType &&
widget.field.name == name,
);
expect(field, findsOneWidget);
}
Future<void> findFieldWithName(String name) async {
final field = find.byWidgetPredicate(
(widget) => widget is FieldCellButton && widget.field.name == name,
);
expect(field, findsOneWidget);
}
Future<void> noFieldWithName(String name) async {
final field = find.byWidgetPredicate(
(widget) => widget is FieldCellButton && widget.field.name == name,
);
expect(field, findsNothing);
}
Future<void> renameField(String newName) async {
final textField = find.byType(FieldNameTextField);
expect(textField, findsOneWidget);
await enterText(textField, newName);
await pumpAndSettle();
}
Future<void> dismissFieldEditor() async {
await sendKeyEvent(LogicalKeyboardKey.escape);
await sendKeyEvent(LogicalKeyboardKey.escape);
await sendKeyEvent(LogicalKeyboardKey.escape);
await pumpAndSettle();
}
Future<void> findFieldEditor(dynamic matcher) async {
final finder = find.byType(FieldEditor);
expect(finder, matcher);
}
Future<void> findDateEditor(dynamic matcher) async {
final finder = find.byType(DateCellEditor);
expect(finder, matcher);
}
Future<void> tapCreateRowButtonInGrid() async {
await tapButton(find.byType(GridAddRowButton));
}
Future<void> tapCreateRowButtonInRowMenuOfGrid() async {
await tapButton(find.byType(InsertRowButton));
}
Future<void> tapRowMenuButtonInGrid() async {
await tapButton(find.byType(RowMenuButton));
}
/// Should call [tapRowMenuButtonInGrid] first.
Future<void> tapDeleteOnRowMenu() async {
await tapButtonWithName(LocaleKeys.grid_row_delete.tr());
}
Future<void> assertRowCountInGridPage(int num) async {
final text = find.byWidgetPredicate(
(widget) => widget is FlowyText && widget.title == rowCountString(num),
);
expect(text, findsOneWidget);
}
Future<void> createField(FieldType fieldType, String name) async {
await scrollToRight(find.byType(GridPage));
await tapNewPropertyButton();
await renameField(name);
await tapTypeOptionButton();
await selectFieldType(fieldType);
await dismissFieldEditor();
}
Future<void> tapDatabaseSettingButton() async {
await tapButton(find.byType(SettingButton));
}
/// Should call [tapDatabaseSettingButton] first.
Future<void> tapDatabaseLayoutButton() async {
final findSettingItem = find.byType(DatabaseSettingItem);
final findLayoutButton = find.byWidgetPredicate(
(widget) =>
widget is FlowyText &&
widget.title == DatabaseSettingAction.showLayout.title(),
);
final button = find.descendant(
of: findSettingItem,
matching: findLayoutButton,
);
await tapButton(button);
}
Future<void> selectDatabaseLayoutType(DatabaseLayoutPB layout) async {
final findLayoutCell = find.byType(DatabaseViewLayoutCell);
final findText = find.byWidgetPredicate(
(widget) => widget is FlowyText && widget.title == layout.layoutName(),
);
final button = find.descendant(
of: findLayoutCell,
matching: findText,
);
await tapButton(button);
}
Future<void> assertCurrentDatabaseLayoutType(DatabaseLayoutPB layout) async {
expect(finderForDatabaseLayoutType(layout), findsOneWidget);
}
}
Finder finderForDatabaseLayoutType(DatabaseLayoutPB layout) {
switch (layout) {
case DatabaseLayoutPB.Board:
return find.byType(BoardPage);
case DatabaseLayoutPB.Calendar:
return find.byType(CalendarPage);
case DatabaseLayoutPB.Grid:
return find.byType(GridPage);
default:
throw Exception('Unknown database layout type: $layout');
}
}
Finder finderForFieldType(FieldType fieldType) {
switch (fieldType) {
case FieldType.Checkbox:
return find.byType(GridCheckboxCell);
case FieldType.DateTime:
return find.byType(GridDateCell);
case FieldType.LastEditedTime:
case FieldType.CreatedTime:
return find.byType(GridDateCell);
case FieldType.SingleSelect:
return find.byType(GridSingleSelectCell);
case FieldType.MultiSelect:
return find.byType(GridMultiSelectCell);
case FieldType.Checklist:
return find.byType(GridChecklistCell);
case FieldType.Number:
return find.byType(GridNumberCell);
case FieldType.RichText:
return find.byType(GridTextCell);
case FieldType.URL:
return find.byType(GridURLCell);
default:
throw Exception('Unknown field type: $fieldType');
}
}
@@ -0,0 +1,45 @@
import 'package:appflowy_editor/appflowy_editor.dart' hide Log;
import 'package:flutter_test/flutter_test.dart';
import 'ime.dart';
import 'util.dart';
extension EditorWidgetTester on WidgetTester {
EditorOperations get editor => EditorOperations(this);
}
class EditorOperations {
const EditorOperations(this.tester);
final WidgetTester tester;
/// Tap the line of editor at [index]
Future<void> tapLineOfEditorAt(int index) async {
final textBlocks = find.byType(TextBlockComponentWidget);
await tester.tapAt(tester.getTopRight(textBlocks.at(index)));
}
/// Hover on cover plugin button above the document
Future<void> hoverOnCoverPluginAddButton() async {
final editor = find.byWidgetPredicate(
(widget) => widget is AppFlowyEditor,
);
await tester.hoverOnWidget(
editor,
offset: tester.getTopLeft(editor).translate(20, 20),
);
}
/// trigger the slash command (selection menu)
Future<void> showSlashMenu() async {
await tester.ime.insertCharacter('/');
}
/// Tap the slash menu item with [name]
///
/// Must call [showSlashMenu] first.
Future<void> tapSlashMenuItemWithName(String name) async {
final slashMenuItem = find.text(name, findRichText: true);
await tester.tapButton(slashMenuItem);
}
}
@@ -0,0 +1,87 @@
import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/plugins/document/presentation/banner.dart';
import 'package:appflowy/workspace/presentation/home/home_stack.dart';
import 'package:appflowy/workspace/presentation/home/menu/app/section/item.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flutter_test/flutter_test.dart';
const String readme = 'Read me';
extension Expectation on WidgetTester {
/// Expect to see the home page and with a default read me page.
void expectToSeeHomePage() {
expect(find.byType(HomeStack), findsOneWidget);
expect(find.textContaining(readme), findsOneWidget);
}
/// Expect to see the page name on the home page.
void expectToSeePageName(String name) {
final pageName = findPageName(name);
expect(pageName, findsOneWidget);
}
/// Expect not to see the page name on the home page.
void expectNotToSeePageName(String name) {
final pageName = findPageName(name);
expect(pageName, findsNothing);
}
/// Expect to see the document banner.
void expectToSeeDocumentBanner() {
expect(find.byType(DocumentBanner), findsOneWidget);
}
/// Expect not to see the document banner.
void expectNotToSeeDocumentBanner() {
expect(find.byType(DocumentBanner), findsNothing);
}
/// Expect to the markdown file export success dialog.
void expectToExportSuccess() {
final exportSuccess = find.byWidgetPredicate(
(widget) =>
widget is FlowyText &&
widget.title == LocaleKeys.settings_files_exportFileSuccess.tr(),
);
expect(exportSuccess, findsOneWidget);
}
/// Expect to see the add button and icon button inside the document.
void expectToSeePluginAddCoverAndIconButton() {
final addCover = find.textContaining(
LocaleKeys.document_plugins_cover_addCover.tr(),
);
final addIcon = find.textContaining(
LocaleKeys.document_plugins_cover_addIcon.tr(),
);
expect(addCover, findsOneWidget);
expect(addIcon, findsOneWidget);
}
/// Expect to see the user name on the home page
void expectToSeeUserName(String name) {
final userName = find.byWidgetPredicate(
(widget) => widget is FlowyText && widget.title == name,
);
expect(userName, findsOneWidget);
}
/// Expect to see a text
void expectToSeeText(String text) {
Finder textWidget = find.textContaining(text, findRichText: true);
if (textWidget.evaluate().isEmpty) {
textWidget = find.byWidgetPredicate(
(widget) => widget is FlowyText && widget.title == text,
);
}
expect(textWidget, findsOneWidget);
}
/// Find the page name on the home page.
Finder findPageName(String name) {
return find.byWidgetPredicate(
(widget) => widget is ViewSectionItem && widget.view.name == name,
);
}
}
@@ -0,0 +1,54 @@
import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
extension IME on WidgetTester {
IMESimulator get ime => IMESimulator(this);
}
class IMESimulator {
IMESimulator(this.tester) {
client = findDeltaTextInputClient();
}
final WidgetTester tester;
late final DeltaTextInputClient client;
Future<void> insertText(String text) async {
for (final c in text.characters) {
await insertCharacter(c);
}
}
Future<void> insertCharacter(String character) async {
final value = client.currentTextEditingValue;
if (value == null) {
assert(false);
return;
}
final deltas = [
TextEditingDeltaInsertion(
textInserted: character,
oldText: value.text.replaceRange(
value.selection.start,
value.selection.end,
'',
),
insertionOffset: value.selection.baseOffset,
selection: TextSelection.collapsed(
offset: value.selection.baseOffset + 1,
),
composing: TextRange.empty,
),
];
client.updateEditingValueWithDeltas(deltas);
await tester.pumpAndSettle();
}
DeltaTextInputClient findDeltaTextInputClient() {
final finder = find.byType(KeyboardServiceWidget);
final KeyboardServiceWidgetState state = tester.state(finder);
return state.textInputService as DeltaTextInputClient;
}
}
@@ -1,23 +0,0 @@
import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/workspace/presentation/home/home_stack.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter_test/flutter_test.dart';
import 'base.dart';
extension AppFlowyLaunch on WidgetTester {
Future<void> tapGoButton() async {
await tapButtonWithName(LocaleKeys.letsGoButtonText.tr());
return;
}
Future<void> tapCreateButton() async {
await tapButtonWithName(LocaleKeys.settings_files_create.tr());
return;
}
Future<void> expectToSeeWelcomePage() async {
expect(find.byType(HomeStack), findsOneWidget);
expect(find.textContaining('Read me'), findsNWidgets(2));
}
}
@@ -1,20 +1,59 @@
import 'package:appflowy/startup/startup.dart';
import 'package:appflowy/util/file_picker/file_picker_impl.dart';
import 'package:appflowy/util/file_picker/file_picker_service.dart';
import 'dart:io';
import 'package:appflowy/startup/startup.dart';
import 'package:appflowy/util/file_picker/file_picker_service.dart';
import 'package:file_picker/file_picker.dart' as fp;
import 'package:path/path.dart' as p;
import '../util.dart';
class MockFilePicker extends FilePicker {
class MockFilePicker implements FilePickerService {
MockFilePicker({
required this.mockPath,
this.mockPath = '',
this.mockPaths = const [],
});
final String mockPath;
final List<String> mockPaths;
@override
Future<String?> getDirectoryPath({String? title}) {
return Future.value(mockPath);
}
@override
Future<String?> saveFile({
String? dialogTitle,
String? fileName,
String? initialDirectory,
fp.FileType type = fp.FileType.any,
List<String>? allowedExtensions,
bool lockParentWindow = false,
}) {
return Future.value(mockPath);
}
@override
Future<FilePickerResult?> pickFiles({
String? dialogTitle,
String? initialDirectory,
fp.FileType type = fp.FileType.any,
List<String>? allowedExtensions,
Function(fp.FilePickerStatus p1)? onFileLoading,
bool allowCompression = true,
bool allowMultiple = false,
bool withData = false,
bool withReadStream = false,
bool lockParentWindow = false,
}) {
final platformFiles = mockPaths
.map((e) => fp.PlatformFile(path: e, name: '', size: 0))
.toList();
return Future.value(
FilePickerResult(
platformFiles,
),
);
}
}
Future<void> mockGetDirectoryPath(String? name) async {
@@ -27,3 +66,36 @@ Future<void> mockGetDirectoryPath(String? name) async {
);
return;
}
Future<String> mockSaveFilePath(String? name, String fileName) async {
final dir = await TestFolder.testLocation(name);
final path = p.join(dir.path, fileName);
getIt.unregister<FilePickerService>();
getIt.registerFactory<FilePickerService>(
() => MockFilePicker(
mockPath: path,
),
);
return path;
}
Future<List<String>> mockPickFilePaths(
List<String> fileNames, {
String? name,
String? customPath,
}) async {
late final Directory dir;
if (customPath != null) {
dir = Directory(customPath);
} else {
dir = await TestFolder.testLocation(name);
}
final paths = fileNames.map((e) => p.join(dir.path, e)).toList();
getIt.unregister<FilePickerService>();
getIt.registerFactory<FilePickerService>(
() => MockFilePicker(
mockPaths: paths,
),
);
return paths;
}
@@ -1,8 +1,8 @@
import 'package:appflowy/plugins/document/presentation/plugins/openai/service/openai_client.dart';
import 'package:appflowy/plugins/document/presentation/editor_plugins/openai/service/openai_client.dart';
import 'package:mocktail/mocktail.dart';
import 'dart:convert';
import 'package:appflowy/plugins/document/presentation/plugins/openai/service/text_completion.dart';
import 'package:appflowy/plugins/document/presentation/plugins/openai/service/error.dart';
import 'package:appflowy/plugins/document/presentation/editor_plugins/openai/service/text_completion.dart';
import 'package:appflowy/plugins/document/presentation/editor_plugins/openai/service/error.dart';
import 'package:http/http.dart' as http;
import 'dart:async';
@@ -1,33 +1,13 @@
import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/workspace/application/settings/prelude.dart';
import 'package:appflowy/workspace/presentation/settings/settings_dialog.dart';
import 'package:appflowy/workspace/presentation/settings/widgets/settings_menu_element.dart';
import 'package:appflowy/workspace/presentation/settings/widgets/settings_user_view.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter_test/flutter_test.dart';
import 'base.dart';
enum SettingsPage {
appearance,
language,
files,
user,
}
extension on SettingsPage {
String get name {
switch (this) {
case SettingsPage.appearance:
return LocaleKeys.settings_menu_appearance.tr();
case SettingsPage.language:
return LocaleKeys.settings_menu_language.tr();
case SettingsPage.files:
return LocaleKeys.settings_menu_files.tr();
case SettingsPage.user:
return LocaleKeys.settings_menu_user.tr();
}
}
}
extension AppFlowySettings on WidgetTester {
/// Open settings page
Future<void> openSettings() async {
@@ -41,7 +21,9 @@ extension AppFlowySettings on WidgetTester {
/// Open the page that insides the settings page
Future<void> openSettingsPage(SettingsPage page) async {
final button = find.text(page.name, findRichText: true);
final button = find.byWidgetPredicate(
(widget) => widget is SettingsMenuElement && widget.page == page,
);
expect(button, findsOneWidget);
await tapButton(button);
return;
@@ -50,7 +32,7 @@ extension AppFlowySettings on WidgetTester {
/// Restore the AppFlowy data storage location
Future<void> restoreLocation() async {
final button =
find.byTooltip(LocaleKeys.settings_files_restoreLocation.tr());
find.byTooltip(LocaleKeys.settings_files_recoverLocationTooltips.tr());
expect(button, findsOneWidget);
await tapButton(button);
return;
@@ -64,8 +46,9 @@ extension AppFlowySettings on WidgetTester {
}
Future<void> tapCustomLocationButton() async {
final button =
find.byTooltip(LocaleKeys.settings_files_customizeLocation.tr());
final button = find.byTooltip(
LocaleKeys.settings_files_changeLocationTooltips.tr(),
);
expect(button, findsOneWidget);
await tapButton(button);
return;
@@ -1,4 +1,6 @@
export 'base.dart';
export 'launch.dart';
export 'common_operations.dart';
export 'settings.dart';
export 'data.dart';
export 'expectation.dart';
export 'editor_test_operations.dart';
@@ -0,0 +1,38 @@
import 'package:appflowy_backend/dispatch/dispatch.dart';
import 'package:appflowy_backend/protobuf/flowy-config/entities.pb.dart';
class Config {
static Future<void> setSupabaseConfig({
required String url,
required String anonKey,
required String key,
required String secret,
}) async {
await ConfigEventSetSupabaseConfig(
SupabaseConfigPB.create()
..supabaseUrl = url
..key = key
..anonKey = anonKey
..jwtSecret = secret,
).send();
}
static Future<void> setSupabaseCollabPluginConfig({
required String url,
required String key,
required String jwtSecret,
required String collabTable,
}) async {
final payload = CollabPluginConfigPB.create();
final collabTableConfig = CollabTableConfigPB.create()
..tableName = collabTable;
payload.supabaseConfig = SupabaseDBConfigPB.create()
..supabaseUrl = url
..key = key
..jwtSecret = jwtSecret
..collabTableConfig = collabTableConfig;
await ConfigEventSetCollabPluginConfig(payload).send();
}
}
@@ -0,0 +1,85 @@
import 'package:appflowy_backend/dispatch/dispatch.dart';
import 'package:appflowy_backend/protobuf/flowy-config/entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:dartz/dartz.dart';
import 'package:shared_preferences/shared_preferences.dart';
abstract class KeyValueStorage {
Future<void> set(String key, String value);
Future<Either<FlowyError, String>> get(String key);
Future<void> remove(String key);
Future<void> clear();
}
class DartKeyValue implements KeyValueStorage {
SharedPreferences? _sharedPreferences;
SharedPreferences get sharedPreferences => _sharedPreferences!;
@override
Future<Either<FlowyError, String>> get(String key) async {
await _initSharedPreferencesIfNeeded();
final value = sharedPreferences.getString(key);
if (value != null) {
return Right(value);
}
return Left(FlowyError());
}
@override
Future<void> remove(String key) async {
await _initSharedPreferencesIfNeeded();
await sharedPreferences.remove(key);
}
@override
Future<void> set(String key, String value) async {
await _initSharedPreferencesIfNeeded();
await sharedPreferences.setString(key, value);
}
@override
Future<void> clear() async {
await _initSharedPreferencesIfNeeded();
await sharedPreferences.clear();
}
Future<void> _initSharedPreferencesIfNeeded() async {
_sharedPreferences ??= await SharedPreferences.getInstance();
}
}
/// Key-value store
/// The data is stored in the local storage of the device.
class RustKeyValue implements KeyValueStorage {
@override
Future<void> set(String key, String value) async {
await ConfigEventSetKeyValue(
KeyValuePB.create()
..key = key
..value = value,
).send();
}
@override
Future<Either<FlowyError, String>> get(String key) async {
final payload = KeyPB.create()..key = key;
final response = await ConfigEventGetKeyValue(payload).send();
return response.swap().map((r) => r.value);
}
@override
Future<void> remove(String key) async {
await ConfigEventRemoveKeyValue(
KeyPB.create()..key = key,
).send();
}
@override
Future<void> clear() async {
// TODO(Lucas): implement clear
}
}
@@ -0,0 +1,21 @@
class KVKeys {
const KVKeys._();
static const String prefix = 'io.appflowy.appflowy_flutter';
/// The key for the path location of the local data for the whole app.
static const String pathLocation = '$prefix.path_location';
/// The key for the last time login type.
///
/// The value is one of the following:
/// - local
/// - supabase
static const String loginType = '$prefix.login_type';
/// The key for saving the window size
///
/// The value is a json string with the following format:
/// {'height': 600.0, 'width': 800.0}
static const String windowSize = 'windowSize';
}
@@ -0,0 +1,24 @@
import 'dart:typed_data';
import 'package:appflowy/core/notification/notification_helper.dart';
import 'package:appflowy_backend/protobuf/flowy-document2/notification.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:dartz/dartz.dart';
typedef DocumentNotificationCallback = void Function(
DocumentNotification,
Either<Uint8List, FlowyError>,
);
class DocumentNotificationParser
extends NotificationParser<DocumentNotification, FlowyError> {
DocumentNotificationParser({
String? id,
required DocumentNotificationCallback callback,
}) : super(
id: id,
callback: callback,
tyParser: (ty) => DocumentNotification.valueOf(ty),
errorParser: (bytes) => FlowyError.fromBuffer(bytes),
);
}
@@ -3,7 +3,7 @@ import 'dart:typed_data';
import 'package:appflowy_backend/protobuf/flowy-notification/protobuf.dart';
import 'package:dartz/dartz.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/notification.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-folder2/notification.pb.dart';
import 'package:appflowy_backend/rust_stream.dart';
import 'notification_helper.dart';
@@ -3,7 +3,7 @@ import 'dart:typed_data';
import 'package:appflowy_backend/protobuf/flowy-notification/protobuf.dart';
import 'package:dartz/dartz.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/notification.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/notification.pb.dart';
import 'package:appflowy_backend/rust_stream.dart';
import 'notification_helper.dart';
+45
View File
@@ -0,0 +1,45 @@
// lib/env/env.dart
import 'package:envied/envied.dart';
part 'env.g.dart';
@Envied(path: '.env')
abstract class Env {
@EnviedField(
obfuscate: true,
varName: 'SUPABASE_URL',
defaultValue: '',
)
static final String supabaseUrl = _Env.supabaseUrl;
@EnviedField(
obfuscate: true,
varName: 'SUPABASE_ANON_KEY',
defaultValue: '',
)
static final String supabaseAnonKey = _Env.supabaseAnonKey;
@EnviedField(
obfuscate: true,
varName: 'SUPABASE_KEY',
defaultValue: '',
)
static final String supabaseKey = _Env.supabaseKey;
@EnviedField(
obfuscate: true,
varName: 'SUPABASE_JWT_SECRET',
defaultValue: '',
)
static final String supabaseJwtSecret = _Env.supabaseJwtSecret;
@EnviedField(
obfuscate: true,
varName: 'SUPABASE_COLLAB_TABLE',
defaultValue: '',
)
static final String supabaseCollabTable = _Env.supabaseCollabTable;
}
bool get isSupabaseEnable =>
Env.supabaseUrl.isNotEmpty &&
Env.supabaseAnonKey.isNotEmpty &&
Env.supabaseKey.isNotEmpty &&
Env.supabaseJwtSecret.isNotEmpty;
+1 -28
View File
@@ -1,37 +1,10 @@
import 'package:appflowy_backend/log.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/foundation.dart';
import 'package:appflowy/startup/entry_point.dart';
import 'package:flutter/material.dart';
import 'package:hotkey_manager/hotkey_manager.dart';
import 'startup/launch_configuration.dart';
import 'startup/startup.dart';
import 'user/presentation/splash_screen.dart';
import 'window/window.dart';
class FlowyApp implements EntryPoint {
@override
Widget create(LaunchConfiguration config) {
return SplashScreen(
autoRegister: config.autoRegistrationSupported,
);
}
}
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
// Handle platform errors not caught by Flutter.
// Reduces the likelihood of the app crashing, and logs the error.
PlatformDispatcher.instance.onError = (error, stack) {
Log.error('Uncaught platform error', error, stack);
return true;
};
await EasyLocalization.ensureInitialized();
await hotKeyManager.unregisterAll();
await AppWindow.initialize();
await FlowyRunner.run(FlowyApp());
}
@@ -28,21 +28,22 @@ class BlankPluginConfig implements PluginConfig {
class BlankPagePlugin extends Plugin {
@override
PluginDisplay get display => BlankPagePluginDisplay();
PluginWidgetBuilder get widgetBuilder => BlankPagePluginWidgetBuilder();
@override
PluginId get id => "BlankStack";
@override
PluginType get ty => PluginType.blank;
PluginType get pluginType => PluginType.blank;
}
class BlankPagePluginDisplay extends PluginDisplay with NavigationItem {
class BlankPagePluginWidgetBuilder extends PluginWidgetBuilder
with NavigationItem {
@override
Widget get leftBarItem => FlowyText.medium(LocaleKeys.blankPageTitle.tr());
@override
Widget buildWidget(PluginContext context) => const BlankPage();
Widget buildWidget({PluginContext? context}) => const BlankPage();
@override
List<NavigationItem> get navigationItems => [this];
@@ -1,6 +1,6 @@
part of 'cell_service.dart';
typedef CellByFieldId = LinkedHashMap<String, CellIdentifier>;
typedef CellContextByFieldId = LinkedHashMap<String, DatabaseCellContext>;
class DatabaseCell {
dynamic object;
@@ -13,7 +13,7 @@ class DatabaseCell {
/// We use [fieldId + rowId] to identify the cell.
class CellCacheKey {
final String fieldId;
final String rowId;
final RowId rowId;
CellCacheKey({
required this.fieldId,
required this.rowId,
@@ -28,7 +28,7 @@ class CellCache {
final String viewId;
/// fieldId: {cacheKey: GridCell}
final Map<String, Map<String, dynamic>> _cellDataByFieldId = {};
final Map<String, Map<RowId, dynamic>> _cellDataByFieldId = {};
CellCache({
required this.viewId,
});
@@ -38,7 +38,7 @@ class CellCache {
}
void remove(CellCacheKey key) {
var map = _cellDataByFieldId[key.fieldId];
final map = _cellDataByFieldId[key.fieldId];
if (map != null) {
map.remove(key.rowId);
}
@@ -1,7 +1,9 @@
import 'dart:async';
import 'package:appflowy/plugins/database_view/application/field/field_listener.dart';
import 'package:appflowy/plugins/database_view/application/row/row_meta_listener.dart';
import 'package:appflowy/plugins/database_view/application/row/row_service.dart';
import 'package:appflowy_backend/log.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pbenum.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pbenum.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:dartz/dartz.dart';
import 'package:equatable/equatable.dart';
@@ -21,52 +23,58 @@ import 'cell_service.dart';
///
// ignore: must_be_immutable
class CellController<T, D> extends Equatable {
final CellIdentifier cellId;
DatabaseCellContext _cellContext;
final CellCache _cellCache;
final CellCacheKey _cacheKey;
final FieldBackendService _fieldBackendSvc;
final SingleFieldListener _fieldListener;
final CellDataLoader<T> _cellDataLoader;
final CellDataPersistence<D> _cellDataPersistence;
CellListener? _cellListener;
RowMetaListener? _rowMetaListener;
SingleFieldListener? _fieldListener;
CellDataNotifier<T?>? _cellDataNotifier;
VoidCallback? _onCellFieldChanged;
VoidCallback? _onRowMetaChanged;
Timer? _loadDataOperation;
Timer? _saveDataOperation;
String get viewId => cellId.viewId;
String get viewId => _cellContext.viewId;
String get rowId => cellId.rowId;
RowId get rowId => _cellContext.rowId;
String get fieldId => cellId.fieldInfo.id;
String get fieldId => _cellContext.fieldInfo.id;
FieldInfo get fieldInfo => cellId.fieldInfo;
FieldInfo get fieldInfo => _cellContext.fieldInfo;
FieldType get fieldType => cellId.fieldInfo.fieldType;
FieldType get fieldType => _cellContext.fieldInfo.fieldType;
String? get emoji => _cellContext.emoji;
CellController({
required this.cellId,
required DatabaseCellContext cellContext,
required CellCache cellCache,
required CellDataLoader<T> cellDataLoader,
required CellDataPersistence<D> cellDataPersistence,
}) : _cellCache = cellCache,
}) : _cellContext = cellContext,
_cellCache = cellCache,
_cellDataLoader = cellDataLoader,
_cellDataPersistence = cellDataPersistence,
_fieldListener = SingleFieldListener(fieldId: cellId.fieldId),
_rowMetaListener = RowMetaListener(cellContext.rowId),
_fieldListener = SingleFieldListener(fieldId: cellContext.fieldId),
_fieldBackendSvc = FieldBackendService(
viewId: cellId.viewId,
fieldId: cellId.fieldInfo.id,
viewId: cellContext.viewId,
fieldId: cellContext.fieldInfo.id,
),
_cacheKey = CellCacheKey(
rowId: cellId.rowId,
fieldId: cellId.fieldInfo.id,
rowId: cellContext.rowId,
fieldId: cellContext.fieldInfo.id,
) {
_cellDataNotifier = CellDataNotifier(value: _cellCache.get(_cacheKey));
_cellListener = CellListener(
rowId: cellId.rowId,
fieldId: cellId.fieldInfo.id,
rowId: cellContext.rowId,
fieldId: cellContext.fieldInfo.id,
);
/// 1.Listen on user edit event and load the new cell data if needed.
@@ -83,20 +91,22 @@ class CellController<T, D> extends Equatable {
);
/// 2.Listen on the field event and load the cell data if needed.
_fieldListener.start(
onFieldChanged: (result) {
result.fold(
(fieldPB) {
/// reloadOnFieldChanged should be true if you need to load the data when the corresponding field is changed
/// For example:
/// ¥12 -> $12
if (_cellDataLoader.reloadOnFieldChanged) {
_loadData();
}
_onCellFieldChanged?.call();
},
(err) => Log.error(err),
);
_fieldListener?.start(
onFieldChanged: (fieldPB) {
/// reloadOnFieldChanged should be true if you need to load the data when the corresponding field is changed
/// For example:
/// ¥12 -> $12
if (_cellDataLoader.reloadOnFieldChanged) {
_loadData();
}
_onCellFieldChanged?.call();
},
);
_rowMetaListener?.start(
callback: (newRowMeta) {
_cellContext = _cellContext.copyWith(rowMeta: newRowMeta);
_onRowMetaChanged?.call();
},
);
}
@@ -104,9 +114,11 @@ class CellController<T, D> extends Equatable {
/// Listen on the cell content or field changes
VoidCallback? startListening({
required void Function(T?) onCellChanged,
VoidCallback? onRowMetaChanged,
VoidCallback? onCellFieldChanged,
}) {
_onCellFieldChanged = onCellFieldChanged;
_onRowMetaChanged = onRowMetaChanged;
/// Notify the listener, the cell data was changed.
onCellChangedFn() => onCellChanged(_cellDataNotifier?.value);
@@ -185,17 +197,27 @@ class CellController<T, D> extends Equatable {
}
Future<void> dispose() async {
await _rowMetaListener?.stop();
_rowMetaListener = null;
await _cellListener?.stop();
_cellListener = null;
await _fieldListener?.stop();
_fieldListener = null;
_loadDataOperation?.cancel();
_saveDataOperation?.cancel();
_cellDataNotifier?.dispose();
await _fieldListener.stop();
_cellDataNotifier = null;
_onRowMetaChanged = null;
}
@override
List<Object> get props =>
[_cellCache.get(_cacheKey) ?? "", cellId.rowId + cellId.fieldInfo.id];
List<Object> get props => [
_cellCache.get(_cacheKey) ?? "",
_cellContext.rowId + _cellContext.fieldInfo.id
];
}
class CellDataNotifier<T> extends ChangeNotifier {
@@ -1,7 +1,8 @@
import 'package:appflowy_backend/protobuf/flowy-database/date_type_option_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pbenum.dart';
import 'package:appflowy_backend/protobuf/flowy-database/select_type_option.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/url_type_option_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/checklist_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/date_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pbenum.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/select_option.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/url_entities.pb.dart';
import 'cell_controller.dart';
import 'cell_service.dart';
@@ -11,96 +12,116 @@ typedef CheckboxCellController = CellController<String, String>;
typedef NumberCellController = CellController<String, String>;
typedef SelectOptionCellController
= CellController<SelectOptionCellDataPB, String>;
typedef ChecklistCellController
= CellController<SelectOptionCellDataPB, String>;
typedef ChecklistCellController = CellController<ChecklistCellDataPB, String>;
typedef DateCellController = CellController<DateCellDataPB, DateCellData>;
typedef URLCellController = CellController<URLCellDataPB, String>;
class CellControllerBuilder {
final CellIdentifier _cellId;
final DatabaseCellContext _cellContext;
final CellCache _cellCache;
CellControllerBuilder({
required CellIdentifier cellId,
required DatabaseCellContext cellContext,
required CellCache cellCache,
}) : _cellCache = cellCache,
_cellId = cellId;
_cellContext = cellContext;
CellController build() {
switch (_cellId.fieldType) {
switch (_cellContext.fieldType) {
case FieldType.Checkbox:
final cellDataLoader = CellDataLoader(
cellId: _cellId,
cellContext: _cellContext,
parser: StringCellDataParser(),
);
return TextCellController(
cellId: _cellId,
cellContext: _cellContext,
cellCache: _cellCache,
cellDataLoader: cellDataLoader,
cellDataPersistence: TextCellDataPersistence(cellId: _cellId),
cellDataPersistence:
TextCellDataPersistence(cellContext: _cellContext),
);
case FieldType.DateTime:
case FieldType.LastEditedTime:
case FieldType.CreatedTime:
final cellDataLoader = CellDataLoader(
cellId: _cellId,
cellContext: _cellContext,
parser: DateCellDataParser(),
reloadOnFieldChanged: true,
);
return DateCellController(
cellId: _cellId,
cellContext: _cellContext,
cellCache: _cellCache,
cellDataLoader: cellDataLoader,
cellDataPersistence: DateCellDataPersistence(cellId: _cellId),
cellDataPersistence:
DateCellDataPersistence(cellContext: _cellContext),
);
case FieldType.Number:
final cellDataLoader = CellDataLoader(
cellId: _cellId,
cellContext: _cellContext,
parser: NumberCellDataParser(),
reloadOnFieldChanged: true,
);
return NumberCellController(
cellId: _cellId,
cellContext: _cellContext,
cellCache: _cellCache,
cellDataLoader: cellDataLoader,
cellDataPersistence: TextCellDataPersistence(cellId: _cellId),
cellDataPersistence:
TextCellDataPersistence(cellContext: _cellContext),
);
case FieldType.RichText:
final cellDataLoader = CellDataLoader(
cellId: _cellId,
cellContext: _cellContext,
parser: StringCellDataParser(),
);
return TextCellController(
cellId: _cellId,
cellContext: _cellContext,
cellCache: _cellCache,
cellDataLoader: cellDataLoader,
cellDataPersistence: TextCellDataPersistence(cellId: _cellId),
cellDataPersistence:
TextCellDataPersistence(cellContext: _cellContext),
);
case FieldType.MultiSelect:
case FieldType.SingleSelect:
case FieldType.Checklist:
final cellDataLoader = CellDataLoader(
cellId: _cellId,
cellContext: _cellContext,
parser: SelectOptionCellDataParser(),
reloadOnFieldChanged: true,
);
return SelectOptionCellController(
cellId: _cellId,
cellContext: _cellContext,
cellCache: _cellCache,
cellDataLoader: cellDataLoader,
cellDataPersistence: TextCellDataPersistence(cellId: _cellId),
cellDataPersistence:
TextCellDataPersistence(cellContext: _cellContext),
);
case FieldType.Checklist:
final cellDataLoader = CellDataLoader(
cellContext: _cellContext,
parser: ChecklistCellDataParser(),
reloadOnFieldChanged: true,
);
return ChecklistCellController(
cellContext: _cellContext,
cellCache: _cellCache,
cellDataLoader: cellDataLoader,
cellDataPersistence:
TextCellDataPersistence(cellContext: _cellContext),
);
case FieldType.URL:
final cellDataLoader = CellDataLoader(
cellId: _cellId,
cellContext: _cellContext,
parser: URLCellDataParser(),
);
return URLCellController(
cellId: _cellId,
cellContext: _cellContext,
cellCache: _cellCache,
cellDataLoader: cellDataLoader,
cellDataPersistence: TextCellDataPersistence(cellId: _cellId),
cellDataPersistence:
TextCellDataPersistence(cellContext: _cellContext),
);
}
throw UnimplementedError;
@@ -11,18 +11,18 @@ abstract class CellDataParser<T> {
class CellDataLoader<T> {
final CellBackendService service = CellBackendService();
final CellIdentifier cellId;
final DatabaseCellContext cellContext;
final CellDataParser<T> parser;
final bool reloadOnFieldChanged;
CellDataLoader({
required this.cellId,
required this.cellContext,
required this.parser,
this.reloadOnFieldChanged = false,
});
Future<T?> loadData() {
final fut = service.getCell(cellId: cellId);
final fut = service.getCell(cellContext: cellContext);
return fut.then(
(result) => result.fold(
(CellPB cell) {
@@ -84,6 +84,16 @@ class SelectOptionCellDataParser
}
}
class ChecklistCellDataParser implements CellDataParser<ChecklistCellDataPB> {
@override
ChecklistCellDataPB? parserData(List<int> data) {
if (data.isEmpty) {
return null;
}
return ChecklistCellDataPB.fromBuffer(data);
}
}
class URLCellDataParser implements CellDataParser<URLCellDataPB> {
@override
URLCellDataPB? parserData(List<int> data) {
@@ -7,16 +7,19 @@ abstract class CellDataPersistence<D> {
}
class TextCellDataPersistence implements CellDataPersistence<String> {
final CellIdentifier cellId;
final DatabaseCellContext cellContext;
final _cellBackendSvc = CellBackendService();
TextCellDataPersistence({
required this.cellId,
required this.cellContext,
});
@override
Future<Option<FlowyError>> save(String data) async {
final fut = _cellBackendSvc.updateCell(cellId: cellId, data: data);
final fut = _cellBackendSvc.updateCell(
cellContext: cellContext,
data: data,
);
return fut.then((result) {
return result.fold(
(l) => none(),
@@ -29,35 +32,30 @@ class TextCellDataPersistence implements CellDataPersistence<String> {
@freezed
class DateCellData with _$DateCellData {
const factory DateCellData({
required DateTime date,
DateTime? dateTime,
String? time,
required bool includeTime,
}) = _DateCellData;
}
class DateCellDataPersistence implements CellDataPersistence<DateCellData> {
final CellIdentifier cellId;
final DatabaseCellContext cellContext;
DateCellDataPersistence({
required this.cellId,
required this.cellContext,
});
@override
Future<Option<FlowyError>> save(DateCellData data) {
var payload = DateChangesetPB.create()..cellPath = _makeCellPath(cellId);
// This is a bit of a hack. This converts the data.date which is in
// UTC to Local but actually changes the timestamp instead of just
// changing the isUtc flag
final dateTime = DateTime(data.date.year, data.date.month, data.date.day);
final date = (dateTime.millisecondsSinceEpoch ~/ 1000).toString();
payload.date = date;
payload.isUtc = data.date.isUtc;
payload.includeTime = data.includeTime;
final payload = DateChangesetPB.create()
..cellId = _makeCellPath(cellContext);
if (data.dateTime != null) {
final date = (data.dateTime!.millisecondsSinceEpoch ~/ 1000).toString();
payload.date = date;
}
if (data.time != null) {
payload.time = data.time!;
}
payload.includeTime = data.includeTime;
return DatabaseEventUpdateDateCell(payload).send().then((result) {
return result.fold(
@@ -68,7 +66,7 @@ class DateCellDataPersistence implements CellDataPersistence<DateCellData> {
}
}
CellIdPB _makeCellPath(CellIdentifier cellId) {
CellIdPB _makeCellPath(DatabaseCellContext cellId) {
return CellIdPB.create()
..viewId = cellId.viewId
..fieldId = cellId.fieldId
@@ -1,15 +1,17 @@
import 'package:appflowy/core/grid_notification.dart';
import 'package:appflowy/core/notification/grid_notification.dart';
import 'package:dartz/dartz.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/notification.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/notification.pb.dart';
import 'package:flowy_infra/notifier.dart';
import 'dart:async';
import 'dart:typed_data';
import '../row/row_service.dart';
typedef UpdateFieldNotifiedValue = Either<Unit, FlowyError>;
class CellListener {
final String rowId;
final RowId rowId;
final String fieldId;
PublishNotifier<UpdateFieldNotifiedValue>? _updateCellNotifier =
PublishNotifier();
@@ -1,19 +1,22 @@
import 'dart:async';
import 'dart:collection';
import 'package:appflowy_backend/protobuf/flowy-database2/checklist_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/date_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/row_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/select_option.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/url_entities.pb.dart';
import 'package:dartz/dartz.dart';
import 'package:appflowy_backend/dispatch/dispatch.dart';
import 'package:appflowy_backend/log.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/cell_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/date_type_option_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/select_type_option.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/url_type_option_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/cell_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
import 'package:flutter/foundation.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'dart:convert' show utf8;
import '../field/field_controller.dart';
import '../row/row_service.dart';
part 'cell_service.freezed.dart';
part 'cell_data_loader.dart';
part 'cell_cache.dart';
@@ -23,46 +26,50 @@ class CellBackendService {
CellBackendService();
Future<Either<void, FlowyError>> updateCell({
required CellIdentifier cellId,
required DatabaseCellContext cellContext,
required String data,
}) {
final payload = CellChangesetPB.create()
..viewId = cellId.viewId
..fieldId = cellId.fieldId
..rowId = cellId.rowId
..typeCellData = data;
..viewId = cellContext.viewId
..fieldId = cellContext.fieldId
..rowId = cellContext.rowId
..cellChangeset = data;
return DatabaseEventUpdateCell(payload).send();
}
Future<Either<CellPB, FlowyError>> getCell({
required CellIdentifier cellId,
required DatabaseCellContext cellContext,
}) {
final payload = CellIdPB.create()
..viewId = cellId.viewId
..fieldId = cellId.fieldId
..rowId = cellId.rowId;
..viewId = cellContext.viewId
..fieldId = cellContext.fieldId
..rowId = cellContext.rowId;
return DatabaseEventGetCell(payload).send();
}
}
/// Id of the cell
/// We can locate the cell by using database + rowId + field.id.
@freezed
class CellIdentifier with _$CellIdentifier {
const factory CellIdentifier({
class DatabaseCellContext with _$DatabaseCellContext {
const factory DatabaseCellContext({
required String viewId,
required String rowId,
required RowMetaPB rowMeta,
required FieldInfo fieldInfo,
}) = _CellIdentifier;
}) = _DatabaseCellContext;
// ignore: unused_element
const CellIdentifier._();
const DatabaseCellContext._();
String get rowId => rowMeta.id;
String get fieldId => fieldInfo.id;
FieldType get fieldType => fieldInfo.fieldType;
ValueKey key() {
return ValueKey("$rowId$fieldId${fieldInfo.fieldType}");
return ValueKey("${rowMeta.id}$fieldId${fieldInfo.fieldType}");
}
/// Only the primary field can have an emoji.
String? get emoji => fieldInfo.isPrimary ? rowMeta.icon : null;
}
@@ -0,0 +1,75 @@
import 'package:appflowy_backend/dispatch/dispatch.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/cell_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/checklist_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/select_option.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:dartz/dartz.dart';
class ChecklistCellBackendService {
final String viewId;
final String fieldId;
final String rowId;
ChecklistCellBackendService({
required this.viewId,
required this.fieldId,
required this.rowId,
});
Future<Either<Unit, FlowyError>> create({
required String name,
}) {
final payload = ChecklistCellDataChangesetPB.create()
..viewId = viewId
..fieldId = fieldId
..rowId = rowId
..insertOptions.add(name);
return DatabaseEventUpdateChecklistCell(payload).send();
}
Future<Either<Unit, FlowyError>> delete({
required List<String> optionIds,
}) {
final payload = ChecklistCellDataChangesetPB.create()
..viewId = viewId
..fieldId = fieldId
..rowId = rowId
..deleteOptionIds.addAll(optionIds);
return DatabaseEventUpdateChecklistCell(payload).send();
}
Future<Either<Unit, FlowyError>> select({
required String optionId,
}) {
final payload = ChecklistCellDataChangesetPB.create()
..viewId = viewId
..fieldId = fieldId
..rowId = rowId
..selectedOptionIds.add(optionId);
return DatabaseEventUpdateChecklistCell(payload).send();
}
Future<Either<Unit, FlowyError>> update({
required SelectOptionPB option,
}) {
final payload = ChecklistCellDataChangesetPB.create()
..viewId = viewId
..fieldId = fieldId
..rowId = rowId
..updateOptions.add(option);
return DatabaseEventUpdateChecklistCell(payload).send();
}
Future<Either<ChecklistCellDataPB, FlowyError>> getCellData() {
final payload = CellIdPB.create()
..viewId = viewId
..fieldId = fieldId
..rowId = rowId;
return DatabaseEventGetChecklistCellData(payload).send();
}
}
@@ -1,18 +1,20 @@
import 'package:appflowy/plugins/database_view/application/cell/cell_service.dart';
import 'package:appflowy/plugins/database_view/application/field/type_option/type_option_service.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/select_option.pb.dart';
import 'package:dartz/dartz.dart';
import 'package:appflowy_backend/dispatch/dispatch.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/cell_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/select_type_option.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/cell_entities.pb.dart';
class SelectOptionBackendService {
final CellIdentifier cellId;
SelectOptionBackendService({required this.cellId});
class SelectOptionCellBackendService {
final String viewId;
final String fieldId;
final String rowId;
String get viewId => cellId.viewId;
String get fieldId => cellId.fieldInfo.id;
String get rowId => cellId.rowId;
SelectOptionCellBackendService({
required this.viewId,
required this.fieldId,
required this.rowId,
});
Future<Either<Unit, FlowyError>> create({
required String name,
@@ -24,19 +26,17 @@ class SelectOptionBackendService {
(result) {
return result.fold(
(option) {
final cellIdentifier = CellIdPB.create()
final payload = RepeatedSelectOptionPayload.create()
..viewId = viewId
..fieldId = fieldId
..rowId = rowId;
final payload = SelectOptionChangesetPB.create()
..cellIdentifier = cellIdentifier;
if (isSelected) {
payload.insertOptions.add(option);
payload.items.add(option);
} else {
payload.updateOptions.add(option);
payload.items.add(option);
}
return DatabaseEventUpdateSelectOption(payload).send();
return DatabaseEventInsertOrUpdateSelectOption(payload).send();
},
(r) => right(r),
);
@@ -47,20 +47,24 @@ class SelectOptionBackendService {
Future<Either<Unit, FlowyError>> update({
required SelectOptionPB option,
}) {
final payload = SelectOptionChangesetPB.create()
..updateOptions.add(option)
..cellIdentifier = _cellIdentifier();
return DatabaseEventUpdateSelectOption(payload).send();
final payload = RepeatedSelectOptionPayload.create()
..items.add(option)
..viewId = viewId
..fieldId = fieldId
..rowId = rowId;
return DatabaseEventInsertOrUpdateSelectOption(payload).send();
}
Future<Either<Unit, FlowyError>> delete({
required Iterable<SelectOptionPB> options,
}) {
final payload = SelectOptionChangesetPB.create()
..deleteOptions.addAll(options)
..cellIdentifier = _cellIdentifier();
final payload = RepeatedSelectOptionPayload.create()
..items.addAll(options)
..viewId = viewId
..fieldId = fieldId
..rowId = rowId;
return DatabaseEventUpdateSelectOption(payload).send();
return DatabaseEventDeleteSelectOption(payload).send();
}
Future<Either<SelectOptionCellDataPB, FlowyError>> getCellData() {
@@ -2,14 +2,14 @@ import 'package:appflowy/plugins/database_view/application/field/field_controlle
import 'package:appflowy/plugins/database_view/application/layout/calendar_setting_listener.dart';
import 'package:appflowy/plugins/database_view/application/view/view_cache.dart';
import 'package:appflowy_backend/log.dart';
import 'package:appflowy_backend/protobuf/flowy-database/calendar_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pbenum.dart';
import 'package:appflowy_backend/protobuf/flowy-database/group.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/group_changeset.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/row_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/setting_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/calendar_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pbenum.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/group.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/group_changeset.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/row_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/setting_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart';
import 'package:collection/collection.dart';
import 'dart:async';
import 'package:dartz/dartz.dart';
@@ -18,6 +18,7 @@ import 'defines.dart';
import 'layout/layout_setting_listener.dart';
import 'row/row_cache.dart';
import 'group/group_listener.dart';
import 'row/row_service.dart';
typedef OnGroupByField = void Function(List<GroupPB>);
typedef OnUpdateGroup = void Function(List<GroupPB>);
@@ -38,18 +39,18 @@ class GroupCallbacks {
});
}
class LayoutCallbacks {
final void Function(LayoutSettingPB) onLayoutChanged;
final void Function(LayoutSettingPB) onLoadLayout;
class DatabaseLayoutSettingCallbacks {
final void Function(DatabaseLayoutSettingPB) onLayoutChanged;
final void Function(DatabaseLayoutSettingPB) onLoadLayout;
LayoutCallbacks({
DatabaseLayoutSettingCallbacks({
required this.onLayoutChanged,
required this.onLoadLayout,
});
}
class CalendarLayoutCallbacks {
final void Function(LayoutSettingPB) onCalendarLayoutChanged;
final void Function(DatabaseLayoutSettingPB) onCalendarLayoutChanged;
CalendarLayoutCallbacks({required this.onCalendarLayoutChanged});
}
@@ -58,14 +59,14 @@ class DatabaseCallbacks {
OnDatabaseChanged? onDatabaseChanged;
OnFieldsChanged? onFieldsChanged;
OnFiltersChanged? onFiltersChanged;
OnRowsChanged? onRowsChanged;
OnNumOfRowsChanged? onNumOfRowsChanged;
OnRowsDeleted? onRowsDeleted;
OnRowsUpdated? onRowsUpdated;
OnRowsCreated? onRowsCreated;
DatabaseCallbacks({
this.onDatabaseChanged,
this.onRowsChanged,
this.onNumOfRowsChanged,
this.onFieldsChanged,
this.onFiltersChanged,
this.onRowsUpdated,
@@ -78,30 +79,31 @@ class DatabaseController {
final String viewId;
final DatabaseViewBackendService _databaseViewBackendSvc;
final FieldController fieldController;
DatabaseLayoutPB? databaseLayout;
DatabaseLayoutSettingPB? databaseLayoutSetting;
late DatabaseViewCache _viewCache;
final LayoutTypePB layoutType;
// Callbacks
DatabaseCallbacks? _databaseCallbacks;
GroupCallbacks? _groupCallbacks;
LayoutCallbacks? _layoutCallbacks;
DatabaseLayoutSettingCallbacks? _layoutCallbacks;
CalendarLayoutCallbacks? _calendarLayoutCallbacks;
// Getters
RowCache get rowCache => _viewCache.rowCache;
// Listener
final DatabaseGroupListener groupListener;
final DatabaseLayoutListener layoutListener;
final DatabaseCalendarLayoutListener calendarLayoutListener;
final DatabaseGroupListener _groupListener;
final DatabaseLayoutSettingListener _layoutListener;
final DatabaseCalendarLayoutListener _calendarLayoutListener;
DatabaseController({required ViewPB view, required this.layoutType})
DatabaseController({required ViewPB view})
: viewId = view.id,
_databaseViewBackendSvc = DatabaseViewBackendService(viewId: view.id),
fieldController = FieldController(viewId: view.id),
groupListener = DatabaseGroupListener(view.id),
layoutListener = DatabaseLayoutListener(view.id),
calendarLayoutListener = DatabaseCalendarLayoutListener(view.id) {
_groupListener = DatabaseGroupListener(view.id),
_layoutListener = DatabaseLayoutSettingListener(view.id),
_calendarLayoutListener = DatabaseCalendarLayoutListener(view.id) {
_viewCache = DatabaseViewCache(
viewId: viewId,
fieldController: fieldController,
@@ -110,14 +112,11 @@ class DatabaseController {
_listenOnFieldsChanged();
_listenOnGroupChanged();
_listenOnLayoutChanged();
if (layoutType == LayoutTypePB.Calendar) {
_listenOnCalendarLayoutChanged();
}
}
void setListener({
DatabaseCallbacks? onDatabaseChanged,
LayoutCallbacks? onLayoutChanged,
DatabaseLayoutSettingCallbacks? onLayoutChanged,
GroupCallbacks? onGroupChanged,
CalendarLayoutCallbacks? onCalendarLayoutChanged,
}) {
@@ -131,6 +130,12 @@ class DatabaseController {
return _databaseViewBackendSvc.openGrid().then((result) {
return result.fold(
(database) async {
databaseLayout = database.layoutType;
if (databaseLayout == DatabaseLayoutPB.Calendar) {
_listenOnCalendarLayoutChanged();
}
_databaseCallbacks?.onDatabaseChanged?.call(database);
_viewCache.rowCache.setInitialRows(database.rows);
return await fieldController
@@ -155,8 +160,8 @@ class DatabaseController {
});
}
Future<Either<RowPB, FlowyError>> createRow({
String? startRowId,
Future<Either<RowMetaPB, FlowyError>> createRow({
RowId? startRowId,
String? groupId,
void Function(RowDataBuilder builder)? withCells,
}) {
@@ -175,18 +180,28 @@ class DatabaseController {
);
}
Future<Either<Unit, FlowyError>> moveRow({
required RowPB fromRow,
Future<Either<Unit, FlowyError>> moveGroupRow({
required RowMetaPB fromRow,
required String groupId,
RowPB? toRow,
RowMetaPB? toRow,
}) {
return _databaseViewBackendSvc.moveRow(
return _databaseViewBackendSvc.moveGroupRow(
fromRowId: fromRow.id,
toGroupId: groupId,
toRowId: toRow?.id,
);
}
Future<Either<Unit, FlowyError>> moveRow({
required String fromRowId,
required String toRowId,
}) {
return _databaseViewBackendSvc.moveRow(
fromRowId: fromRowId,
toRowId: toRowId,
);
}
Future<Either<Unit, FlowyError>> moveGroup({
required String fromGroupId,
required String toGroupId,
@@ -198,7 +213,7 @@ class DatabaseController {
}
Future<void> updateCalenderLayoutSetting(
CalendarLayoutSettingsPB layoutSetting,
CalendarLayoutSettingPB layoutSetting,
) async {
await _databaseViewBackendSvc
.updateLayoutSetting(calendarLayoutSetting: layoutSetting)
@@ -210,7 +225,7 @@ class DatabaseController {
Future<void> dispose() async {
await _databaseViewBackendSvc.closeView();
await fieldController.dispose();
await groupListener.stop();
await _groupListener.stop();
await _viewCache.dispose();
_databaseCallbacks = null;
_groupCallbacks = null;
@@ -231,26 +246,31 @@ class DatabaseController {
}
Future<void> _loadLayoutSetting() async {
_databaseViewBackendSvc.getLayoutSetting(layoutType).then((result) {
result.fold(
(l) {
_layoutCallbacks?.onLoadLayout(l);
},
(r) => Log.error(r),
);
});
if (databaseLayout != null) {
_databaseViewBackendSvc.getLayoutSetting(databaseLayout!).then((result) {
result.fold(
(newDatabaseLayoutSetting) {
databaseLayoutSetting = newDatabaseLayoutSetting;
databaseLayoutSetting?.freeze();
_layoutCallbacks?.onLoadLayout(newDatabaseLayoutSetting);
},
(r) => Log.error(r),
);
});
}
}
void _listenOnRowsChanged() {
final callbacks = DatabaseViewCallbacks(
onRowsChanged: (rows, rowByRowId, reason) {
_databaseCallbacks?.onRowsChanged?.call(rows, rowByRowId, reason);
onNumOfRowsChanged: (rows, rowByRowId, reason) {
_databaseCallbacks?.onNumOfRowsChanged?.call(rows, rowByRowId, reason);
},
onRowsDeleted: (ids) {
_databaseCallbacks?.onRowsDeleted?.call(ids);
},
onRowsUpdated: (ids) {
_databaseCallbacks?.onRowsUpdated?.call(ids);
onRowsUpdated: (ids, reason) {
_databaseCallbacks?.onRowsUpdated?.call(ids, reason);
},
onRowsCreated: (ids) {
_databaseCallbacks?.onRowsCreated?.call(ids);
@@ -271,7 +291,7 @@ class DatabaseController {
}
void _listenOnGroupChanged() {
groupListener.start(
_groupListener.start(
onNumOfGroupsChanged: (result) {
result.fold(
(changeset) {
@@ -302,11 +322,14 @@ class DatabaseController {
}
void _listenOnLayoutChanged() {
layoutListener.start(
_layoutListener.start(
onLayoutChanged: (result) {
result.fold(
(l) {
_layoutCallbacks?.onLayoutChanged(l);
(newDatabaseLayoutSetting) {
databaseLayoutSetting = newDatabaseLayoutSetting;
databaseLayoutSetting?.freeze();
_layoutCallbacks?.onLayoutChanged(newDatabaseLayoutSetting);
},
(r) => Log.error(r),
);
@@ -315,7 +338,7 @@ class DatabaseController {
}
void _listenOnCalendarLayoutChanged() {
calendarLayoutListener.start(
_calendarLayoutListener.start(
onCalendarLayoutChanged: (result) {
result.fold(
(l) {
@@ -341,10 +364,15 @@ class RowDataBuilder {
_cellDataByFieldId[fieldInfo.field.id] = num.toString();
}
/// The date should use the UTC timezone. Becuase the backend uses UTC timezone to format the time string.
void insertDate(FieldInfo fieldInfo, DateTime date) {
assert(fieldInfo.fieldType == FieldType.DateTime);
final timestamp = (date.toUtc().millisecondsSinceEpoch ~/ 1000);
assert(
[
FieldType.DateTime,
FieldType.LastEditedTime,
FieldType.CreatedTime,
].contains(fieldInfo.fieldType),
);
final timestamp = date.millisecondsSinceEpoch ~/ 1000;
_cellDataByFieldId[fieldInfo.field.id] = timestamp.toString();
}
@@ -1,5 +1,5 @@
import 'package:appflowy_backend/dispatch/dispatch.dart';
import 'package:appflowy_backend/protobuf/flowy-database/database_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/database_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:dartz/dartz.dart';
@@ -1,14 +1,15 @@
import 'package:appflowy_backend/protobuf/flowy-database/calendar_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/database_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/group_changeset.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/setting_entities.pb.dart';
import 'package:appflowy/plugins/database_view/application/row/row_service.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/calendar_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/database_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/group_changeset.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/setting_entities.pb.dart';
import 'package:dartz/dartz.dart';
import 'package:appflowy_backend/dispatch/dispatch.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/group.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/row_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/group.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/row_entities.pb.dart';
class DatabaseViewBackendService {
final String viewId;
@@ -16,22 +17,26 @@ class DatabaseViewBackendService {
required this.viewId,
});
Future<Either<DatabasePB, FlowyError>> openGrid() async {
await FolderEventSetLatestView(ViewIdPB(value: viewId)).send();
/// Returns the datbaase id associated with the view.
Future<Either<String, FlowyError>> getDatabaseId() async {
final payload = DatabaseViewIdPB(value: viewId);
return DatabaseEventGetDatabaseId(payload)
.send()
.then((value) => value.leftMap((l) => l.value));
}
Future<Either<DatabasePB, FlowyError>> openGrid() async {
final payload = DatabaseViewIdPB(value: viewId);
return DatabaseEventGetDatabase(payload).send();
}
Future<Either<RowPB, FlowyError>> createRow({
String? startRowId,
Future<Either<RowMetaPB, FlowyError>> createRow({
RowId? startRowId,
String? groupId,
Map<String, String>? cellDataByFieldId,
}) {
var payload = CreateRowPayloadPB.create()..viewId = viewId;
if (startRowId != null) {
payload.startRowId = startRowId;
}
final payload = CreateRowPayloadPB.create()..viewId = viewId;
payload.startRowId = startRowId ?? "";
if (groupId != null) {
payload.groupId = groupId;
@@ -44,12 +49,12 @@ class DatabaseViewBackendService {
return DatabaseEventCreateRow(payload).send();
}
Future<Either<Unit, FlowyError>> moveRow({
required String fromRowId,
Future<Either<Unit, FlowyError>> moveGroupRow({
required RowId fromRowId,
required String toGroupId,
String? toRowId,
RowId? toRowId,
}) {
var payload = MoveGroupRowPayloadPB.create()
final payload = MoveGroupRowPayloadPB.create()
..viewId = viewId
..fromRowId = fromRowId
..toGroupId = toGroupId;
@@ -61,6 +66,18 @@ class DatabaseViewBackendService {
return DatabaseEventMoveGroupRow(payload).send();
}
Future<Either<Unit, FlowyError>> moveRow({
required String fromRowId,
required String toRowId,
}) {
final payload = MoveRowPayloadPB.create()
..viewId = viewId
..fromRowId = fromRowId
..toRowId = toRowId;
return DatabaseEventMoveRow(payload).send();
}
Future<Either<Unit, FlowyError>> moveGroup({
required String fromGroupId,
required String toGroupId,
@@ -76,7 +93,7 @@ class DatabaseViewBackendService {
Future<Either<List<FieldPB>, FlowyError>> getFields({
List<FieldIdPB>? fieldIds,
}) {
var payload = GetFieldPayloadPB.create()..viewId = viewId;
final payload = GetFieldPayloadPB.create()..viewId = viewId;
if (fieldIds != null) {
payload.fieldIds = RepeatedFieldIdPB(items: fieldIds);
@@ -86,27 +103,23 @@ class DatabaseViewBackendService {
});
}
Future<Either<LayoutSettingPB, FlowyError>> getLayoutSetting(
LayoutTypePB layoutType,
Future<Either<DatabaseLayoutSettingPB, FlowyError>> getLayoutSetting(
DatabaseLayoutPB layoutType,
) {
final payload = DatabaseLayoutIdPB.create()
final payload = DatabaseLayoutMetaPB.create()
..viewId = viewId
..layout = layoutType;
return DatabaseEventGetLayoutSetting(payload).send();
}
Future<Either<Unit, FlowyError>> updateLayoutSetting({
CalendarLayoutSettingsPB? calendarLayoutSetting,
CalendarLayoutSettingPB? calendarLayoutSetting,
}) {
final layoutSetting = LayoutSettingPB.create();
final payload = LayoutSettingChangesetPB.create()..viewId = viewId;
if (calendarLayoutSetting != null) {
layoutSetting.calendar = calendarLayoutSetting;
payload.calendar = calendarLayoutSetting;
}
final payload = UpdateLayoutSettingPB.create()
..viewId = viewId
..layoutSetting = layoutSetting;
return DatabaseEventSetLayoutSetting(payload).send();
}
@@ -1,22 +1,26 @@
import 'dart:collection';
import 'package:appflowy_backend/protobuf/flowy-database/database_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/database_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import '../grid/presentation/widgets/filter/filter_info.dart';
import 'field/field_controller.dart';
import 'row/row_cache.dart';
import 'row/row_service.dart';
typedef OnFieldsChanged = void Function(UnmodifiableListView<FieldInfo>);
typedef OnFiltersChanged = void Function(List<FilterInfo>);
typedef OnDatabaseChanged = void Function(DatabasePB);
typedef OnRowsCreated = void Function(List<String> ids);
typedef OnRowsUpdated = void Function(List<String> ids);
typedef OnRowsDeleted = void Function(List<String> ids);
typedef OnRowsChanged = void Function(
typedef OnRowsCreated = void Function(List<RowId> ids);
typedef OnRowsUpdated = void Function(
List<RowId> ids,
RowsChangedReason reason,
);
typedef OnRowsDeleted = void Function(List<RowId> ids);
typedef OnNumOfRowsChanged = void Function(
UnmodifiableListView<RowInfo> rows,
UnmodifiableMapView<String, RowInfo> rowByRowId,
UnmodifiableMapView<RowId, RowInfo> rowByRowId,
RowsChangedReason reason,
);
@@ -1,5 +1,5 @@
import 'package:appflowy_backend/log.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'field_service.dart';
@@ -10,7 +10,7 @@ class FieldActionSheetBloc
extends Bloc<FieldActionSheetEvent, FieldActionSheetState> {
final FieldBackendService fieldService;
FieldActionSheetBloc({required FieldCellContext fieldCellContext})
FieldActionSheetBloc({required FieldContext fieldCellContext})
: fieldService = FieldBackendService(
viewId: fieldCellContext.viewId,
fieldId: fieldCellContext.field.id,
@@ -1,5 +1,4 @@
import 'package:appflowy_backend/log.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'dart:async';
@@ -14,7 +13,7 @@ class FieldCellBloc extends Bloc<FieldCellEvent, FieldCellState> {
final FieldBackendService _fieldBackendSvc;
FieldCellBloc({
required FieldCellContext cellContext,
required FieldContext cellContext,
}) : _fieldListener = SingleFieldListener(fieldId: cellContext.field.id),
_fieldBackendSvc = FieldBackendService(
viewId: cellContext.viewId,
@@ -52,14 +51,11 @@ class FieldCellBloc extends Bloc<FieldCellEvent, FieldCellState> {
void _startListening() {
_fieldListener.start(
onFieldChanged: (result) {
onFieldChanged: (updatedField) {
if (isClosed) {
return;
}
result.fold(
(field) => add(FieldCellEvent.didReceiveFieldUpdate(field)),
(err) => Log.error(err),
);
add(FieldCellEvent.didReceiveFieldUpdate(updatedField));
},
);
}
@@ -83,8 +79,7 @@ class FieldCellState with _$FieldCellState {
required double width,
}) = _FieldCellState;
factory FieldCellState.initial(FieldCellContext cellContext) =>
FieldCellState(
factory FieldCellState.initial(FieldContext cellContext) => FieldCellState(
viewId: cellContext.viewId,
field: cellContext.field,
width: cellContext.field.width.toDouble(),
@@ -1,13 +1,13 @@
import 'dart:collection';
import 'package:appflowy_backend/protobuf/flowy-database/filter_changeset.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/sort_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/filter_changeset.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/sort_entities.pb.dart';
import 'package:dartz/dartz.dart';
import 'package:appflowy_backend/log.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/group.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/setting_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/util.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/group.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/setting_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/util.pb.dart';
import 'package:flutter/foundation.dart';
import '../../grid/presentation/widgets/filter/filter_info.dart';
import '../../grid/presentation/widgets/sort/sort_info.dart';
@@ -94,7 +94,7 @@ class FieldController {
_updatedFieldCallbacks = {};
// Group callbacks
final Map<String, GroupConfigurationPB> _groupConfigurationByFieldId = {};
final Map<String, GroupSettingPB> _groupConfigurationByFieldId = {};
// Filter callbacks
final Map<OnReceiveFilters, VoidCallback> _filterCallbacks = {};
@@ -401,7 +401,7 @@ class FieldController {
void _updateSetting(DatabaseViewSettingPB setting) {
_groupConfigurationByFieldId.clear();
for (final configuration in setting.groupConfigurations.items) {
for (final configuration in setting.groupSettings.items) {
_groupConfigurationByFieldId[configuration.fieldId] = configuration;
}
@@ -418,7 +418,7 @@ class FieldController {
void _updateFieldInfos() {
if (_fieldNotifier != null) {
for (var field in _fieldNotifier!.fieldInfos) {
for (final field in _fieldNotifier!.fieldInfos) {
field._isGroupField = _groupConfigurationByFieldId[field.id] != null;
field._hasFilter = _filterPBByFieldId[field.id] != null;
field._hasSort = _sortPBByFieldId[field.id] != null;
@@ -1,4 +1,4 @@
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:dartz/dartz.dart';
import 'field_service.dart';
@@ -12,12 +12,20 @@ class FieldEditorBloc extends Bloc<FieldEditorEvent, FieldEditorState> {
final TypeOptionController dataController;
FieldEditorBloc({
required String viewId,
required String fieldName,
required bool isGroupField,
required IFieldTypeOptionLoader loader,
}) : dataController = TypeOptionController(viewId: viewId, loader: loader),
super(FieldEditorState.initial(viewId, fieldName, isGroupField)) {
required FieldPB field,
required FieldTypeOptionLoader loader,
}) : dataController = TypeOptionController(
field: field,
loader: loader,
),
super(
FieldEditorState.initial(
loader.viewId,
loader.field.name,
isGroupField,
),
) {
on<FieldEditorEvent>(
(event, emit) async {
await event.when(
@@ -27,7 +35,8 @@ class FieldEditorBloc extends Bloc<FieldEditorEvent, FieldEditorState> {
add(FieldEditorEvent.didReceiveFieldChanged(field));
}
});
await dataController.loadTypeOptionData();
await dataController.reloadTypeOption();
add(FieldEditorEvent.didReceiveFieldChanged(dataController.field));
},
updateName: (name) {
if (state.name != name) {
@@ -49,7 +58,7 @@ class FieldEditorBloc extends Bloc<FieldEditorEvent, FieldEditorState> {
() => null,
(field) {
final fieldService = FieldBackendService(
viewId: viewId,
viewId: loader.viewId,
fieldId: field.id,
);
fieldService.deleteField();
@@ -1,18 +1,18 @@
import 'package:appflowy/core/grid_notification.dart';
import 'package:appflowy/core/notification/grid_notification.dart';
import 'package:appflowy_backend/log.dart';
import 'package:dartz/dartz.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/notification.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/notification.pb.dart';
import 'package:flowy_infra/notifier.dart';
import 'dart:async';
import 'dart:typed_data';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
typedef UpdateFieldNotifiedValue = Either<FieldPB, FlowyError>;
typedef UpdateFieldNotifiedValue = FieldPB;
class SingleFieldListener {
final String fieldId;
PublishNotifier<UpdateFieldNotifiedValue>? _updateFieldNotifier =
PublishNotifier();
void Function(UpdateFieldNotifiedValue)? _updateFieldNotifier;
DatabaseNotificationListener? _listener;
SingleFieldListener({required this.fieldId});
@@ -20,7 +20,7 @@ class SingleFieldListener {
void start({
required void Function(UpdateFieldNotifiedValue) onFieldChanged,
}) {
_updateFieldNotifier?.addPublishListener(onFieldChanged);
_updateFieldNotifier = onFieldChanged;
_listener = DatabaseNotificationListener(
objectId: fieldId,
handler: _handler,
@@ -34,9 +34,8 @@ class SingleFieldListener {
switch (ty) {
case DatabaseNotification.DidUpdateField:
result.fold(
(payload) =>
_updateFieldNotifier?.value = left(FieldPB.fromBuffer(payload)),
(error) => _updateFieldNotifier?.value = right(error),
(payload) => _updateFieldNotifier?.call(FieldPB.fromBuffer(payload)),
(error) => Log.error(error),
);
break;
default:
@@ -46,7 +45,6 @@ class SingleFieldListener {
Future<void> stop() async {
await _listener?.stop();
_updateFieldNotifier?.dispose();
_updateFieldNotifier = null;
}
}
@@ -1,8 +1,8 @@
import 'package:appflowy_backend/protobuf/flowy-database/database_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/database_entities.pb.dart';
import 'package:dartz/dartz.dart';
import 'package:appflowy_backend/dispatch/dispatch.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
part 'field_service.freezed.dart';
@@ -29,12 +29,11 @@ class FieldBackendService {
Future<Either<Unit, FlowyError>> updateField({
String? name,
FieldType? fieldType,
bool? frozen,
bool? visibility,
double? width,
}) {
var payload = FieldChangesetPB.create()
final payload = FieldChangesetPB.create()
..viewId = viewId
..fieldId = fieldId;
@@ -42,10 +41,6 @@ class FieldBackendService {
payload.name = name;
}
if (fieldType != null) {
payload.fieldType = fieldType;
}
if (frozen != null) {
payload.frozen = frozen;
}
@@ -66,7 +61,7 @@ class FieldBackendService {
required String fieldId,
required List<int> typeOptionData,
}) {
var payload = TypeOptionChangesetPB.create()
final payload = TypeOptionChangesetPB.create()
..viewId = viewId
..fieldId = fieldId
..typeOptionData = typeOptionData;
@@ -104,11 +99,19 @@ class FieldBackendService {
);
});
}
/// Returns the primary field of the view.
static Future<Either<FieldPB, FlowyError>> getPrimaryField({
required String viewId,
}) {
final payload = DatabaseViewIdPB.create()..value = viewId;
return DatabaseEventGetPrimaryField(payload).send();
}
}
@freezed
class FieldCellContext with _$FieldCellContext {
const factory FieldCellContext({
class FieldContext with _$FieldContext {
const factory FieldContext({
required String viewId,
required FieldPB field,
}) = _FieldCellContext;
Loaded 100 of 1575 files, more files were not shown because too many files have changed in this diff. Show more