[PR #4420] [CLOSED] feat: support editor to show workspace folder overview #6245

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

📋 Pull Request Information

Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/4420
Author: @Jayaprakash-dev
Created: 1/19/2024
Status: Closed

Base: mainHead: feat_workspace_folder_overview


📝 Commits (10+)

  • 58de1d6 feat: support workspace overview to display folder structure in a concise view
  • 4f447fe feat: adds RegisterOverviewListenerId to receive updates from all level of child views
  • 60b6d99 feat: add GetAllLevelOfViews & RegisterOverviewListernerId event and its handler in rust backend
  • 0f2a842 feat: support storing overview listener Ids & add overview child views update notification
  • 2d4bf63 refactor: overview block widget style and support DidUpdateWorkspaceOverviewChildViews notification
  • d762f02 test: integration test for overview block
  • a5c447e feat: Notify all overview listeners instead of stopping at one.
  • 4159b90 fix: overview block rebuilding issue
  • 5795105 test: adds test for workspace view update and deletion cases
  • 971412a refactor: improved code file, renamed folders, and updated class names

📊 Changes

17 files changed (+1017 additions, -52 deletions)

View changed files

frontend/appflowy_flutter/integration_test/folder/workspace_overview/overview_test.dart (+122 -0)
📝 frontend/appflowy_flutter/lib/env/cloud_env_test.dart (+1 -1)
frontend/appflowy_flutter/lib/plugins/document/application/workspace_overview/overview_adapter_service.dart (+14 -0)
frontend/appflowy_flutter/lib/plugins/document/application/workspace_overview/workspace_overview_bloc.dart (+185 -0)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_configuration.dart (+12 -0)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_page.dart (+2 -0)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/workspace_overview/overview_block_component.dart (+330 -0)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_style.dart (+11 -0)
📝 frontend/appflowy_flutter/lib/workspace/application/view/view_listener.dart (+13 -0)
📝 frontend/appflowy_flutter/lib/workspace/application/view/view_service.dart (+7 -0)
📝 frontend/resources/translations/en.json (+5 -1)
📝 frontend/rust-lib/flowy-folder/src/event_handler.rs (+25 -1)
📝 frontend/rust-lib/flowy-folder/src/event_map.rs (+12 -0)
📝 frontend/rust-lib/flowy-folder/src/manager.rs (+152 -11)
📝 frontend/rust-lib/flowy-folder/src/manager_init.rs (+7 -1)
📝 frontend/rust-lib/flowy-folder/src/manager_observer.rs (+116 -37)
📝 frontend/rust-lib/flowy-folder/src/notification.rs (+3 -0)

📄 Description

Description

I've addressed the issue #4282 by implementing the Workspace folder Overview feature, allowing users to create an outline for workspace folder/sub pages structures using the slash commands /overview or /workspace overview. This facilitates easy navigation in nested document structures.

Implemented Changes

  1. Added GetAllLevelOfViews event in the backend to retrieve all levels of child views. Previously, only the GetView event returned first-level children.

  2. Added a struct WorkspaceOverviewListenerIdManager in the Rust backend. This struct stores overview block listener IDs to notify them about updates in child views from all levels. Additionally, a new notification event DidUpdateWorkspaceOverviewChildViews has been added to inform overview listener IDs about changes. This ensures that the struct and overview ID listener are specifically designed to handle updates across all child view levels.

  3. Implemented navigation to pages from the workspace overview block.

The only issue is that we need to assign the view ID to the editor document in AppFlowy-IO/appflowy-editor repo. This enables us to retrieve the view from the backend using the stored view ID, like this:

In Overview block component widget builder

@override
  Widget build(BuildContext context) {
    final viewId = editorState.document.id!;
    return FutureBuilder<Either<ViewPB, FlowyError>>(
      future: ViewBackendService.getAllLevelOfViews(viewId),
      builder: (context, snapshot) { ...... }

In Document class of AppflowyEditor class:

class Document {
  Document({
    required this.root,
    this.id
  });

  /// The root [Node] of the [Document]
  final Node root;

  /// The view Id of the [Document]
  final String? id;
...... }

Testing

I have tested this implementation thoroughly, ensuring it functions as expected and addressing the outlined issue.

Note

Note: There might be some syntax issues in the Rust code as I am a newbie in Rust programming. I welcome suggestions and feedback to improve the code quality.

Screenshots

Screenshot 2024-01-19 at 5 19 34 AM

https://github.com/AppFlowy-IO/AppFlowy/assets/68953739/1855d71d-bd35-407f-ab36-396aa0ebdd80


🔄 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/4420 **Author:** [@Jayaprakash-dev](https://github.com/Jayaprakash-dev) **Created:** 1/19/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat_workspace_folder_overview` --- ### 📝 Commits (10+) - [`58de1d6`](https://github.com/AppFlowy-IO/AppFlowy/commit/58de1d6a05fefb36314376fa4d3203d29998973c) feat: support workspace overview to display folder structure in a concise view - [`4f447fe`](https://github.com/AppFlowy-IO/AppFlowy/commit/4f447fe1507bbee582c79bf404ade574293f603b) feat: adds `RegisterOverviewListenerId` to receive updates from all level of child views - [`60b6d99`](https://github.com/AppFlowy-IO/AppFlowy/commit/60b6d9972638584668857162f951687f8d145a1f) feat: add `GetAllLevelOfViews` & `RegisterOverviewListernerId` event and its handler in rust backend - [`0f2a842`](https://github.com/AppFlowy-IO/AppFlowy/commit/0f2a842d4abc054d27f75380bf3bc817875a0845) feat: support storing overview listener Ids & add overview child views update notification - [`2d4bf63`](https://github.com/AppFlowy-IO/AppFlowy/commit/2d4bf63e49235b88bd8c80b2ffc95c4fb93b1338) refactor: overview block widget style and support `DidUpdateWorkspaceOverviewChildViews` notification - [`d762f02`](https://github.com/AppFlowy-IO/AppFlowy/commit/d762f0279670903d80340480504e8b10727fe3fa) test: integration test for overview block - [`a5c447e`](https://github.com/AppFlowy-IO/AppFlowy/commit/a5c447eb187875835235af98e234db50f4f9e771) feat: Notify all overview listeners instead of stopping at one. - [`4159b90`](https://github.com/AppFlowy-IO/AppFlowy/commit/4159b905c32cfbfe9f5b5a6f011aee9340c58015) fix: overview block rebuilding issue - [`5795105`](https://github.com/AppFlowy-IO/AppFlowy/commit/579510520e8fb7ede6cee2ba8abff7d3c21453c5) test: adds test for workspace view update and deletion cases - [`971412a`](https://github.com/AppFlowy-IO/AppFlowy/commit/971412aefa89d807a1618d7c0009110d7ff81871) refactor: improved code file, renamed folders, and updated class names ### 📊 Changes **17 files changed** (+1017 additions, -52 deletions) <details> <summary>View changed files</summary> ➕ `frontend/appflowy_flutter/integration_test/folder/workspace_overview/overview_test.dart` (+122 -0) 📝 `frontend/appflowy_flutter/lib/env/cloud_env_test.dart` (+1 -1) ➕ `frontend/appflowy_flutter/lib/plugins/document/application/workspace_overview/overview_adapter_service.dart` (+14 -0) ➕ `frontend/appflowy_flutter/lib/plugins/document/application/workspace_overview/workspace_overview_bloc.dart` (+185 -0) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_configuration.dart` (+12 -0) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_page.dart` (+2 -0) ➕ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/workspace_overview/overview_block_component.dart` (+330 -0) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_style.dart` (+11 -0) 📝 `frontend/appflowy_flutter/lib/workspace/application/view/view_listener.dart` (+13 -0) 📝 `frontend/appflowy_flutter/lib/workspace/application/view/view_service.dart` (+7 -0) 📝 `frontend/resources/translations/en.json` (+5 -1) 📝 `frontend/rust-lib/flowy-folder/src/event_handler.rs` (+25 -1) 📝 `frontend/rust-lib/flowy-folder/src/event_map.rs` (+12 -0) 📝 `frontend/rust-lib/flowy-folder/src/manager.rs` (+152 -11) 📝 `frontend/rust-lib/flowy-folder/src/manager_init.rs` (+7 -1) 📝 `frontend/rust-lib/flowy-folder/src/manager_observer.rs` (+116 -37) 📝 `frontend/rust-lib/flowy-folder/src/notification.rs` (+3 -0) </details> ### 📄 Description ### Description I've addressed the issue #4282 by implementing the Workspace folder Overview feature, allowing users to create an outline for workspace folder/sub pages structures using the slash commands `/overview` or `/workspace overview`. This facilitates easy navigation in nested document structures. ### Implemented Changes 1. Added `GetAllLevelOfViews` event in the backend to retrieve all levels of child views. Previously, only the `GetView` event returned first-level children. 2. Added a struct `WorkspaceOverviewListenerIdManager` in the Rust backend. This struct stores overview block listener IDs to notify them about updates in child views from all levels. Additionally, a new notification event `DidUpdateWorkspaceOverviewChildViews` has been added to inform overview listener IDs about changes. This ensures that the struct and overview ID listener are specifically designed to handle updates across all child view levels. 3. Implemented navigation to pages from the workspace overview block. The only issue is that we need to assign the view ID to the editor document in [AppFlowy-IO/appflowy-editor](https://github.com/AppFlowy-IO/appflowy-editor) repo. This enables us to retrieve the view from the backend using the stored view ID, like this: In **Overview block component** widget builder ``` @override Widget build(BuildContext context) { final viewId = editorState.document.id!; return FutureBuilder<Either<ViewPB, FlowyError>>( future: ViewBackendService.getAllLevelOfViews(viewId), builder: (context, snapshot) { ...... } ``` In `Document` class of `AppflowyEditor` class: ``` class Document { Document({ required this.root, this.id }); /// The root [Node] of the [Document] final Node root; /// The view Id of the [Document] final String? id; ...... } ``` ### Testing I have tested this implementation thoroughly, ensuring it functions as expected and addressing the outlined issue. ### Note Note: There might be some syntax issues in the Rust code as I am a newbie in Rust programming. I welcome suggestions and feedback to improve the code quality. ### Screenshots <img width="1237" alt="Screenshot 2024-01-19 at 5 19 34 AM" src="https://github.com/AppFlowy-IO/AppFlowy/assets/68953739/4ed9caec-751e-401a-a48b-c6c337388f6d"> https://github.com/AppFlowy-IO/AppFlowy/assets/68953739/1855d71d-bd35-407f-ab36-396aa0ebdd80 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
mirror 2026-03-23 22:22:22 +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#6245
No description provided.