[PR #8001] [MERGED] feat: optimize share section and share tab logic #8266

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

📋 Pull Request Information

Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/8001
Author: @LucasXu0
Created: 5/29/2025
Status: Merged
Merged: 6/2/2025
Merged by: @LucasXu0

Base: mainHead: guest_role_v2


📝 Commits (10+)

  • b4af492 feat: optimize share section and share tab logic
  • 2a61438 feat: new people with access section
  • 8ab77a1 feat: new copy link widget
  • f64fd0a fix: hide member page for guest user
  • b423ef2 fix: hide sites page for guest user
  • cb31c41 feat: support access level in document
  • e36d149 fix: can't edit the title when access level is read
  • 7088288 feat: guest role can't get page outside the flatten shared pages
  • a911da2 chore: refactor user workspace bloc
  • 23f578c feat: show guest role in workspace menu

📊 Changes

133 files changed (+3674 additions, -1615 deletions)

View changed files

📝 frontend/appflowy_flutter/assets/test/workspaces/database/v069.afdb (+1 -1)
📝 frontend/appflowy_flutter/integration_test/desktop/cloud/workspace/collaborative_workspace_test.dart (+1 -1)
📝 frontend/appflowy_flutter/lib/ai/widgets/ai_prompt_modal/ai_prompt_database_modal.dart (+1 -1)
📝 frontend/appflowy_flutter/lib/ai/widgets/ai_prompt_modal/ai_prompt_modal.dart (+1 -0)
📝 frontend/appflowy_flutter/lib/ai/widgets/prompt_input/select_sources_bottom_sheet.dart (+2 -2)
📝 frontend/appflowy_flutter/lib/ai/widgets/view_selector.dart (+1 -0)
frontend/appflowy_flutter/lib/features/page_access_level/data/repositories/page_access_level_repository.dart (+24 -0)
frontend/appflowy_flutter/lib/features/page_access_level/data/repositories/rust_page_access_level_repository_impl.dart (+117 -0)
frontend/appflowy_flutter/lib/features/page_access_level/logic/page_access_level_bloc.dart (+136 -0)
frontend/appflowy_flutter/lib/features/page_access_level/logic/page_access_level_event.dart (+42 -0)
frontend/appflowy_flutter/lib/features/page_access_level/logic/page_access_level_state.dart (+80 -0)
📝 frontend/appflowy_flutter/lib/features/share_tab/data/models/share_access_level.dart (+1 -0)
frontend/appflowy_flutter/lib/features/share_tab/data/models/shared_group.dart (+25 -0)
📝 frontend/appflowy_flutter/lib/features/share_tab/data/repositories/local_share_with_user_repository_impl.dart (+3 -2)
📝 frontend/appflowy_flutter/lib/features/share_tab/data/repositories/rust_share_with_user_repository_impl.dart (+2 -2)
📝 frontend/appflowy_flutter/lib/features/share_tab/logic/share_tab_bloc.dart (+48 -119)
frontend/appflowy_flutter/lib/features/share_tab/logic/share_tab_event.dart (+134 -0)
frontend/appflowy_flutter/lib/features/share_tab/logic/share_tab_state.dart (+113 -0)
📝 frontend/appflowy_flutter/lib/features/share_tab/presentation/share_tab.dart (+56 -17)
📝 frontend/appflowy_flutter/lib/features/share_tab/presentation/widgets/access_level_list_widget.dart (+22 -15)

...and 80 more files

📄 Description

Feature Preview

  • new share menu design
  • new shared with me section design (next PR)
  • exclude the members/sites tab if user is guest
  • disable workspace editable fileds in workspace tab if user is guest
  • permission control:
    • if user is a guest, he can't get the view info that not in the shared views.
    • share private views

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.

Summary by Sourcery

Refactor share tab and shared section features: unify naming conventions, externalize event/state classes, update repository implementations, adopt new ghost-button design, add shared section toggle behavior, and align tests accordingly

New Features:

  • Add expand/collapse toggle for the SharedSection UI

Enhancements:

  • Rename ShareWithUserBloc to ShareTabBloc and extract its events and state into separate files
  • Rename shared_section repository interfaces and implementations with Impl suffix and update imports
  • Replace static header widgets in SharedSection and Favorites with AFGhostIconTextButton and introduce mainAxisAlignment support
  • Streamline bloc logic by removing redundant result resets and conditionally rendering SharedPagesList based on isExpanded

Tests:

  • Update bloc and widget tests to use ShareTabBloc, SharedSectionBloc, and new repository implementations

Chores:

  • Reorganize file structure by moving event, state, and repository definitions into dedicated files
  • Move local repository classes to test folders and rename them with Impl suffix

🔄 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/8001 **Author:** [@LucasXu0](https://github.com/LucasXu0) **Created:** 5/29/2025 **Status:** ✅ Merged **Merged:** 6/2/2025 **Merged by:** [@LucasXu0](https://github.com/LucasXu0) **Base:** `main` ← **Head:** `guest_role_v2` --- ### 📝 Commits (10+) - [`b4af492`](https://github.com/AppFlowy-IO/AppFlowy/commit/b4af4924f71e2ff413f7a1dbaa175297be7a076e) feat: optimize share section and share tab logic - [`2a61438`](https://github.com/AppFlowy-IO/AppFlowy/commit/2a6143803f6ce902bd25bfa383f524a7cc1eb8aa) feat: new people with access section - [`8ab77a1`](https://github.com/AppFlowy-IO/AppFlowy/commit/8ab77a1c0b5edc515a9a1a0494a35c00551637c8) feat: new copy link widget - [`f64fd0a`](https://github.com/AppFlowy-IO/AppFlowy/commit/f64fd0a67fa8d3d190d7cd9b01864e2f3430eaa2) fix: hide member page for guest user - [`b423ef2`](https://github.com/AppFlowy-IO/AppFlowy/commit/b423ef215f1a1a99dbc78598ed2079aa3208132f) fix: hide sites page for guest user - [`cb31c41`](https://github.com/AppFlowy-IO/AppFlowy/commit/cb31c41cd47d5fb5142070e377c17a205e72825b) feat: support access level in document - [`e36d149`](https://github.com/AppFlowy-IO/AppFlowy/commit/e36d149a252bb4b6890512e3a18a3fc48ed1cb96) fix: can't edit the title when access level is read - [`7088288`](https://github.com/AppFlowy-IO/AppFlowy/commit/7088288e0fb06667a5923eb8583f41ffcb1d60f9) feat: guest role can't get page outside the flatten shared pages - [`a911da2`](https://github.com/AppFlowy-IO/AppFlowy/commit/a911da2cdaf9f03f6b7805eb63f6742a6450f8ae) chore: refactor user workspace bloc - [`23f578c`](https://github.com/AppFlowy-IO/AppFlowy/commit/23f578c8600187729d43653b4b25f502e9904035) feat: show guest role in workspace menu ### 📊 Changes **133 files changed** (+3674 additions, -1615 deletions) <details> <summary>View changed files</summary> 📝 `frontend/appflowy_flutter/assets/test/workspaces/database/v069.afdb` (+1 -1) 📝 `frontend/appflowy_flutter/integration_test/desktop/cloud/workspace/collaborative_workspace_test.dart` (+1 -1) 📝 `frontend/appflowy_flutter/lib/ai/widgets/ai_prompt_modal/ai_prompt_database_modal.dart` (+1 -1) 📝 `frontend/appflowy_flutter/lib/ai/widgets/ai_prompt_modal/ai_prompt_modal.dart` (+1 -0) 📝 `frontend/appflowy_flutter/lib/ai/widgets/prompt_input/select_sources_bottom_sheet.dart` (+2 -2) 📝 `frontend/appflowy_flutter/lib/ai/widgets/view_selector.dart` (+1 -0) ➕ `frontend/appflowy_flutter/lib/features/page_access_level/data/repositories/page_access_level_repository.dart` (+24 -0) ➕ `frontend/appflowy_flutter/lib/features/page_access_level/data/repositories/rust_page_access_level_repository_impl.dart` (+117 -0) ➕ `frontend/appflowy_flutter/lib/features/page_access_level/logic/page_access_level_bloc.dart` (+136 -0) ➕ `frontend/appflowy_flutter/lib/features/page_access_level/logic/page_access_level_event.dart` (+42 -0) ➕ `frontend/appflowy_flutter/lib/features/page_access_level/logic/page_access_level_state.dart` (+80 -0) 📝 `frontend/appflowy_flutter/lib/features/share_tab/data/models/share_access_level.dart` (+1 -0) ➕ `frontend/appflowy_flutter/lib/features/share_tab/data/models/shared_group.dart` (+25 -0) 📝 `frontend/appflowy_flutter/lib/features/share_tab/data/repositories/local_share_with_user_repository_impl.dart` (+3 -2) 📝 `frontend/appflowy_flutter/lib/features/share_tab/data/repositories/rust_share_with_user_repository_impl.dart` (+2 -2) 📝 `frontend/appflowy_flutter/lib/features/share_tab/logic/share_tab_bloc.dart` (+48 -119) ➕ `frontend/appflowy_flutter/lib/features/share_tab/logic/share_tab_event.dart` (+134 -0) ➕ `frontend/appflowy_flutter/lib/features/share_tab/logic/share_tab_state.dart` (+113 -0) 📝 `frontend/appflowy_flutter/lib/features/share_tab/presentation/share_tab.dart` (+56 -17) 📝 `frontend/appflowy_flutter/lib/features/share_tab/presentation/widgets/access_level_list_widget.dart` (+22 -15) _...and 80 more files_ </details> ### 📄 Description <!--- Thank you for submitting a pull request to AppFlowy. The team will dedicate their best efforts to reviewing and approving your pull request. If you have any questions about the project or feedback for us, please join our [Discord](https://discord.gg/wdjWUXXhtw). --> <!--- If your pull request adds a new feature, please drag and drop a video into this section to showcase what you've done! If not, you may delete this section. --> ### Feature Preview - [x] new share menu design - [ ] new shared with me section design (next PR) - [x] exclude the members/sites tab if user is guest - [x] disable workspace editable fileds in workspace tab if user is guest - [x] permission control: - [x] if user is a guest, he can't get the view info that not in the shared views. - [x] share private views <!--- List at least one issue here that this PR addresses. If it fixes the issue, please use the [fixes](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests) keyword to close the issue. For example: fixes https://github.com/AppFlowy-IO/AppFlowy/pull/2106 --> --- <!--- Before you mark this PR ready for review, run through this checklist! --> #### 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. ## Summary by Sourcery Refactor share tab and shared section features: unify naming conventions, externalize event/state classes, update repository implementations, adopt new ghost-button design, add shared section toggle behavior, and align tests accordingly New Features: - Add expand/collapse toggle for the SharedSection UI Enhancements: - Rename ShareWithUserBloc to ShareTabBloc and extract its events and state into separate files - Rename shared_section repository interfaces and implementations with Impl suffix and update imports - Replace static header widgets in SharedSection and Favorites with AFGhostIconTextButton and introduce mainAxisAlignment support - Streamline bloc logic by removing redundant result resets and conditionally rendering SharedPagesList based on isExpanded Tests: - Update bloc and widget tests to use ShareTabBloc, SharedSectionBloc, and new repository implementations Chores: - Reorganize file structure by moving event, state, and repository definitions into dedicated files - Move local repository classes to test folders and rename them with Impl suffix --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
mirror 2026-03-23 23:23:23 +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#8266
No description provided.