fix: untitled override the true value in row details page (#6315)

* fix: untitled override the true value in row details page

* chore: use on complete edit callback

* chore: fix test

* chore: fix test

---------

Co-authored-by: Richard Shiue <71320345+richardshiue@users.noreply.github.com>
This commit is contained in:
Nathan.fooo 2024-09-16 13:19:36 +08:00 committed by GitHub
parent b865037728
commit f1bc9f860c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
17 changed files with 74 additions and 67 deletions

View File

@ -1281,6 +1281,7 @@ extension AppFlowyDatabaseTest on WidgetTester {
);
await enterText(textField, title);
await testTextInput.receiveAction(TextInputAction.done);
await pumpAndSettle(const Duration(milliseconds: 300));
}

View File

@ -553,7 +553,9 @@ class _TitleSkin extends IEditableTextCellSkin {
fontSize: 23,
fontWeight: FontWeight.w500,
),
onChanged: (text) => bloc.add(TextCellEvent.updateText(text)),
onEditingComplete: () {
bloc.add(TextCellEvent.updateText(textEditingController.text));
},
decoration: InputDecoration(
contentPadding: const EdgeInsets.symmetric(vertical: 9),
border: InputBorder.none,

View File

@ -90,7 +90,7 @@ class _OpenRowPageButtonState extends State<OpenRowPageButton> {
),
onPressed: () {
final name = state.content;
_openRowPage(context, name);
_openRowPage(context, name ?? "");
},
),
);

View File

@ -34,7 +34,7 @@ class TextCellBloc extends Bloc<TextCellEvent, TextCellState> {
on<TextCellEvent>(
(event, emit) {
event.when(
didReceiveCellUpdate: (String content) {
didReceiveCellUpdate: (content) {
emit(state.copyWith(content: content));
},
didUpdateField: (fieldInfo) {
@ -44,7 +44,9 @@ class TextCellBloc extends Bloc<TextCellEvent, TextCellState> {
}
},
updateText: (String text) {
if (state.content != text) {
// If the content is null, it indicates that either the cell is empty (no data)
// or the cell data is still being fetched from the backend and is not yet available.
if (state.content != null && state.content != text) {
cellController.saveCellData(text, debounce: true);
}
},
@ -60,7 +62,7 @@ class TextCellBloc extends Bloc<TextCellEvent, TextCellState> {
_onCellChangedFn = cellController.addListener(
onCellChanged: (cellContent) {
if (!isClosed) {
add(TextCellEvent.didReceiveCellUpdate(cellContent ?? ""));
add(TextCellEvent.didReceiveCellUpdate(cellContent));
}
},
onFieldChanged: _onFieldChangedListener,
@ -76,7 +78,7 @@ class TextCellBloc extends Bloc<TextCellEvent, TextCellState> {
@freezed
class TextCellEvent with _$TextCellEvent {
const factory TextCellEvent.didReceiveCellUpdate(String cellContent) =
const factory TextCellEvent.didReceiveCellUpdate(String? cellContent) =
_DidReceiveCellUpdate;
const factory TextCellEvent.didUpdateField(FieldInfo fieldInfo) =
_DidUpdateField;
@ -87,7 +89,7 @@ class TextCellEvent with _$TextCellEvent {
@freezed
class TextCellState with _$TextCellState {
const factory TextCellState({
required String content,
required String? content,
required ValueNotifier<String>? emoji,
required ValueNotifier<bool>? hasDocument,
required bool enableEdit,
@ -95,7 +97,7 @@ class TextCellState with _$TextCellState {
}) = _TextCellState;
factory TextCellState.initial(TextCellController cellController) {
final cellData = cellController.getCellData() ?? "";
final cellData = cellController.getCellData();
final wrap = cellController.fieldInfo.wrapCellContent ?? true;
ValueNotifier<String>? emoji;
ValueNotifier<bool>? hasDocument;

View File

@ -288,10 +288,8 @@ class _TitleTextCellSkin extends IEditableTextCellSkin {
textStyle: Theme.of(context).textTheme.bodyMedium?.copyWith(fontSize: 14),
focusNode: focusNode,
hintText: LocaleKeys.calendar_defaultNewCalendarTitle.tr(),
onChanged: (text) {
if (textEditingController.value.composing.isCollapsed) {
bloc.add(TextCellEvent.updateText(text));
}
onEditingComplete: () {
bloc.add(TextCellEvent.updateText(textEditingController.text));
},
);
}

View File

@ -122,9 +122,7 @@ class _TextCellState extends State<TextCardCell> {
child: BlocListener<TextCellBloc, TextCellState>(
listenWhen: (previous, current) => previous.content != current.content,
listener: (context, state) {
if (!state.enableEdit) {
_textEditingController.text = state.content;
}
_textEditingController.text = state.content ?? "";
},
child: isTitle ? _buildTitle() : _buildText(),
),
@ -164,7 +162,7 @@ class _TextCellState extends State<TextCardCell> {
Widget _buildText() {
return BlocBuilder<TextCellBloc, TextCellState>(
builder: (context, state) {
final content = state.content;
final content = state.content ?? "";
return content.isEmpty
? const SizedBox.shrink()

View File

@ -79,10 +79,13 @@ class _TextCellState extends GridEditableTextCell<EditableTextCell> {
return BlocProvider.value(
value: cellBloc,
child: BlocListener<TextCellBloc, TextCellState>(
listenWhen: (previous, current) => previous.content != current.content,
listener: (context, state) {
if (!focusNode.hasFocus) {
_textEditingController.text = state.content;
}
// It's essential to set the new content to the textEditingController.
// If you don't, the old value in textEditingController will persist and
// overwrite the correct value, leading to inconsistencies between the
// displayed text and the actual data.
_textEditingController.text = state.content ?? "";
},
child: Builder(
builder: (context) {

View File

@ -510,10 +510,8 @@ class _TitleSkin extends IEditableTextCellSkin {
isDense: true,
isCollapsed: true,
),
onChanged: (text) {
if (textEditingController.value.composing.isCollapsed) {
bloc.add(TextCellEvent.updateText(text));
}
onEditingComplete: () {
bloc.add(TextCellEvent.updateText(textEditingController.text));
},
),
);

View File

@ -145,7 +145,7 @@ class _TitleSkin extends IEditableTextCellSkin {
TextEditingController textEditingController,
) {
return BlocSelector<TextCellBloc, TextCellState, String>(
selector: (state) => state.content,
selector: (state) => state.content ?? "",
builder: (context, content) {
final name = content.isEmpty
? LocaleKeys.grid_row_titlePlaceholder.tr()

View File

@ -976,7 +976,7 @@ dependencies = [
[[package]]
name = "collab"
version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [
"anyhow",
"arc-swap",
@ -1001,7 +1001,7 @@ dependencies = [
[[package]]
name = "collab-database"
version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [
"anyhow",
"async-trait",
@ -1032,7 +1032,7 @@ dependencies = [
[[package]]
name = "collab-document"
version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [
"anyhow",
"arc-swap",
@ -1052,7 +1052,7 @@ dependencies = [
[[package]]
name = "collab-entity"
version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [
"anyhow",
"bytes",
@ -1072,7 +1072,7 @@ dependencies = [
[[package]]
name = "collab-folder"
version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [
"anyhow",
"arc-swap",
@ -1115,7 +1115,7 @@ dependencies = [
[[package]]
name = "collab-plugins"
version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [
"anyhow",
"async-stream",
@ -1195,7 +1195,7 @@ dependencies = [
[[package]]
name = "collab-user"
version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [
"anyhow",
"collab",

View File

@ -119,13 +119,13 @@ custom-protocol = ["tauri/custom-protocol"]
# To switch to the local path, run:
# scripts/tool/update_collab_source.sh
# ⚠️⚠️⚠️️
collab = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" }
collab-entity = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" }
collab-folder = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" }
collab-document = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" }
collab-database = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" }
collab-plugins = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" }
collab-user = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" }
collab = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
collab-entity = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
collab-folder = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
collab-document = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
collab-database = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
collab-plugins = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
collab-user = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
# Working directory: frontend
# To update the commit ID, run:

View File

@ -959,7 +959,7 @@ dependencies = [
[[package]]
name = "collab"
version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [
"anyhow",
"arc-swap",
@ -984,7 +984,7 @@ dependencies = [
[[package]]
name = "collab-database"
version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [
"anyhow",
"async-trait",
@ -1015,7 +1015,7 @@ dependencies = [
[[package]]
name = "collab-document"
version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [
"anyhow",
"arc-swap",
@ -1035,7 +1035,7 @@ dependencies = [
[[package]]
name = "collab-entity"
version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [
"anyhow",
"bytes",
@ -1055,7 +1055,7 @@ dependencies = [
[[package]]
name = "collab-folder"
version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [
"anyhow",
"arc-swap",
@ -1098,7 +1098,7 @@ dependencies = [
[[package]]
name = "collab-plugins"
version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [
"anyhow",
"async-stream",
@ -1178,7 +1178,7 @@ dependencies = [
[[package]]
name = "collab-user"
version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [
"anyhow",
"collab",

View File

@ -117,13 +117,13 @@ custom-protocol = ["tauri/custom-protocol"]
# To switch to the local path, run:
# scripts/tool/update_collab_source.sh
# ⚠️⚠️⚠️️
collab = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" }
collab-entity = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" }
collab-folder = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" }
collab-document = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" }
collab-database = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" }
collab-plugins = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" }
collab-user = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" }
collab = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
collab-entity = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
collab-folder = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
collab-document = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
collab-database = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
collab-plugins = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
collab-user = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
# Working directory: frontend
# To update the commit ID, run:

View File

@ -837,7 +837,7 @@ dependencies = [
[[package]]
name = "collab"
version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [
"anyhow",
"arc-swap",
@ -862,7 +862,7 @@ dependencies = [
[[package]]
name = "collab-database"
version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [
"anyhow",
"async-trait",
@ -893,7 +893,7 @@ dependencies = [
[[package]]
name = "collab-document"
version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [
"anyhow",
"arc-swap",
@ -913,7 +913,7 @@ dependencies = [
[[package]]
name = "collab-entity"
version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [
"anyhow",
"bytes",
@ -933,7 +933,7 @@ dependencies = [
[[package]]
name = "collab-folder"
version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [
"anyhow",
"arc-swap",
@ -976,7 +976,7 @@ dependencies = [
[[package]]
name = "collab-plugins"
version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [
"anyhow",
"async-stream",
@ -1056,7 +1056,7 @@ dependencies = [
[[package]]
name = "collab-user"
version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=36c193e770e8e19182fdb2311dbd1b7c2ba0ed53#36c193e770e8e19182fdb2311dbd1b7c2ba0ed53"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9a07a19181a509b6c3237d71ac9bb602322ebe0b#9a07a19181a509b6c3237d71ac9bb602322ebe0b"
dependencies = [
"anyhow",
"collab",

View File

@ -141,13 +141,13 @@ rocksdb = { git = "https://github.com/rust-rocksdb/rust-rocksdb", rev = "1710120
# To switch to the local path, run:
# scripts/tool/update_collab_source.sh
# ⚠️⚠️⚠️️
collab = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" }
collab-entity = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" }
collab-folder = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" }
collab-document = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" }
collab-database = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" }
collab-plugins = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" }
collab-user = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "36c193e770e8e19182fdb2311dbd1b7c2ba0ed53" }
collab = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
collab-entity = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
collab-folder = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
collab-document = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
collab-database = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
collab-plugins = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
collab-user = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9a07a19181a509b6c3237d71ac9bb602322ebe0b" }
# Working directory: frontend
# To update the commit ID, run:

View File

@ -27,7 +27,10 @@ flowy-search = { workspace = true }
flowy-search-pub = { workspace = true }
collab-entity = { workspace = true }
collab-plugins = { workspace = true }
collab = { workspace = true, features = ["verbose_log"] }
collab = { workspace = true }
#collab = { workspace = true, features = ["verbose_log"] }
diesel.workspace = true
uuid.workspace = true
flowy-storage = { workspace = true }

View File

@ -965,6 +965,7 @@ impl DatabaseEditor {
/// Update a cell in the database.
/// This will notify all views that the cell has been updated.
#[instrument(level = "trace", skip_all)]
pub async fn update_cell(
&self,
view_id: &str,
@ -974,6 +975,7 @@ impl DatabaseEditor {
) -> FlowyResult<()> {
// Get the old row before updating the cell. It would be better to get the old cell
let old_row = self.get_row(view_id, row_id).await;
trace!("[Database Row]: update cell: {:?}", new_cell);
self
.update_row(row_id.clone(), |row_update| {
row_update