[PR #5366] [MERGED] fix: chaning field type #5360 #6782

Closed
opened 2026-03-23 23:16:39 +00:00 by mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/5366
Author: @zoli
Created: 5/19/2024
Status: Merged
Merged: 5/20/2024
Merged by: @LucasXu0

Base: mainHead: fix/change-field-iss5360


📝 Commits (1)

📊 Changes

5 files changed (+87 additions, -20 deletions)

View changed files

frontend/appflowy_flutter/integration_test/desktop/board/board_field_test.dart (+37 -0)
📝 frontend/appflowy_flutter/integration_test/shared/database_test_op.dart (+14 -5)
📝 frontend/appflowy_flutter/lib/mobile/presentation/database/card/mobile_card_content.dart (+4 -4)
📝 frontend/appflowy_flutter/lib/plugins/database/widgets/card/card.dart (+4 -5)
📝 frontend/appflowy_flutter/lib/plugins/database/widgets/card/card_bloc.dart (+28 -6)

📄 Description

Before this changing any field from CellController<String, String> to a CellController<SomeCellDataPB, String> caused an exception. The root of the problem was that _CardContent wasn't getting rebuilt when field type got changed. In CardState it was storing a list of CellContext which contains only field id and row id so on changing field type the state wasn't changing.
I made a new type CellMeta which stores field type alongside row id and field id and now CardState stores list of CellMeta.

Fixes #5360

PR Checklist

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

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/AppFlowy-IO/AppFlowy/pull/5366 **Author:** [@zoli](https://github.com/zoli) **Created:** 5/19/2024 **Status:** ✅ Merged **Merged:** 5/20/2024 **Merged by:** [@LucasXu0](https://github.com/LucasXu0) **Base:** `main` ← **Head:** `fix/change-field-iss5360` --- ### 📝 Commits (1) - [`d9259db`](https://github.com/AppFlowy-IO/AppFlowy/commit/d9259db938cbaf934537a707ae550d1b948cc0a5) fix: chaning field type #5360 ### 📊 Changes **5 files changed** (+87 additions, -20 deletions) <details> <summary>View changed files</summary> ➕ `frontend/appflowy_flutter/integration_test/desktop/board/board_field_test.dart` (+37 -0) 📝 `frontend/appflowy_flutter/integration_test/shared/database_test_op.dart` (+14 -5) 📝 `frontend/appflowy_flutter/lib/mobile/presentation/database/card/mobile_card_content.dart` (+4 -4) 📝 `frontend/appflowy_flutter/lib/plugins/database/widgets/card/card.dart` (+4 -5) 📝 `frontend/appflowy_flutter/lib/plugins/database/widgets/card/card_bloc.dart` (+28 -6) </details> ### 📄 Description Before this changing any field from CellController<String, String> to a CellController<SomeCellDataPB, String> caused an exception. The root of the problem was that _CardContent wasn't getting rebuilt when field type got changed. In CardState it was storing a list of CellContext which contains only field id and row id so on changing field type the state wasn't changing. I made a new type CellMeta which stores field type alongside row id and field id and now CardState stores list of CellMeta. Fixes #5360 #### PR Checklist - [x] My code adheres to [AppFlowy's Conventions](https://docs.appflowy.io/docs/documentation/software-contributions/conventions) - [x] I've listed at least one issue that this PR fixes in the description above. - [x] I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes. - [x] All existing tests are passing. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
mirror 2026-03-23 23:16:39 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

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