LogoLogo
  • AppFlowy
    • ⭐Start here
      • Welcome to AppFlowy Docs
      • How to get help
      • Install AppFlowy
    • 🛠️Installation
      • 🖥️System Requirements
      • 💿Installation methods
        • Mac / Windows / Linux Packages
          • Installing on Linux
            • Installing & Setting up Flutter on Linux from Source
        • Docker
    • 🌱Community
      • 🤙Get in contact
      • 📔AppFlowy Mentorship Program
        • Program Guidance
        • Proposal Template
        • Pull Request Template
        • Mentorship 2023
          • Mentee Projects
            • Calendar View for AppFlowy Database
            • Custom Themes
            • Shortcuts and Customized Hotkeys for AppFlowy
            • Table
            • ⭐Favorites
            • Code Block
            • Outlines
            • Importers
            • AI Writers
            • Templates
          • Project Ideas
      • ✍️Write for AppFlowy
        • 📃Drafts
          • [Draft] Use Case: Software Engineer
          • [Draft] Use Case: High School Students
          • [Draft] How to add a new property to appflowy database
      • 🍂Hacktoberfest
    • 🛣️Roadmap
    • 🌋Product
      • 💽Data Storage
      • 🎨Customize and Style Content
      • ⏮️Duplicate, Delete, and Restore
      • 💎Databases
        • 🔢Database Properties
        • 🗃️Manage Properties
      • Ⓜ️Markdown
      • ⌨️Shortcuts
      • 🪄AppFlowy AI
      • 🦙AppFlowy Local AI - Ollama
      • 🎨Themes
      • ☁️AppFlowy Cloud
      • 🧩AppFlowy Plugins
        • Table-view Databases
        • Kanban Board
        • Calendar
        • Auto Generator
        • Smart Edit
        • Code Blocks
        • Math Equations
        • Cover
        • Emoji
  • Documentation
    • 💎Software Contributions
      • 🟢Get started
      • 💀Architecture
        • Frontend
          • Tauri
            • 🗺️CodeMap
          • Web
            • 🌟Design Philosophy
          • Flutter
            • 🗺️Project Structure: CodeMap
            • 🧮Grid
            • ⚙️Setting
          • Inter-Process Communication
          • User
            • User Data
            • Events & Notifications
          • Folder
            • Events & Notifications
          • Document
          • Database View
            • Events & Notifications
            • Grid
            • Calendar
            • Kanban Board
        • Backend
          • Initialize
          • Events
          • Delta(WIP)
          • Profiling
          • Database
        • Domain Driven Design
        • Proposals
      • 🏗️Conventions
        • 🔤Naming Conventions
        • ⌨️Code Conventions
          • 🐦Flutter
        • 🐙Git Conventions
      • 💛Submitting Code
        • 🏦Setting Up Your Repositories
        • ⤴️Submitting your first Pull Request
      • 🤟Coding Standards and Practices
        • 👽Rust Backend
    • 🚀AppFlowy
      • 👾How to contribute to AppFlowy
      • 🏗️Building from Source
        • 🌳Flutter Setup
          • 🐧Building on Linux
          • 🍎Building on macOS
          • 🪟Building on Windows
        • 🌐Web Setup
        • 📡Tauri Setup
      • ☁️Debugging with AppFlowy Cloud
      • 🔁Debugging in VS Code
      • ☎️Translate AppFlowy
      • ❓Troubleshooting
      • 👮‍♀️Licenses
    • 🏍️AppFlowy Editor
      • ⌨️How to Implement Markdown Syntax To Style Text In AppFlowy Editor
      • 🧩How to Create a Plugin for AppFlowy Editor
      • 👮‍♀️Licenses
    • ☁️AppFlowy Cloud
      • 🌈Architecture
      • ☀️Deployment
  • Guides
    • Sync Desktop and Mobile
    • Self-Hosting AppFlowy
      • ☁️Self-hosting AppFlowy with AppFlowy Cloud
      • 🆓Self-hosting AppFlowy for free Using Supabase
    • Import From Notion
  • Blog Highlights
    • 🔮Demystifying AppFlowy Editor's Codebase
  • Handbook
    • Core values
Powered by GitBook
On this page
  • Introduction
  • Goal
  • Scope
  • Implementation Design
  • Expected Schedule

Was this helpful?

Edit on GitHub
  1. AppFlowy
  2. Community
  3. AppFlowy Mentorship Program
  4. Mentorship 2023
  5. Mentee Projects

Favorites

Mihir Singh

Introduction

  • Managing and organizing vast amounts of data can be a daunting task. Whether it's navigating through numerous files and folders or trying to locate specific information within a page, the process can often become overwhelming.

  • As users of productivity tools like AppFlowy, we often find ourselves grappling with the challenge of efficiently accessing and prioritizing the content that matters most to us.

  • A favorite mechanism can alleviate this problem of navigating through a vast database by offering users a simple and effective go-to mechanism.

Goal

Goal of this project is to provide users with efficient mechanism for managing and accessing their most important and frequently used content by allowing users to mark views as favorites, the feature aims at advanced navigation, organization and productivity within the app.

Scope

  1. Favorite a Page: Users can easily mark a page as a favorite by navigating to the desired page and clicking a dedicated button at the top-right corner. This action signifies the user's preference for quick access to the selected page.

  2. Favorites Section: A dedicated Favorites section will be introduced in the left sidebar of the AppFlowy interface. Once the user has favorited their first page, this section will automatically appear. It provides users with a centralized location to find their pinned pages and related subdirectories, ensuring easy access to their most important and frequently accessed content.

  3. Remove from Favorites: Users have the flexibility to unpin or remove a page from their Favorites section, allowing them to update their prioritization and keep the Favorites section relevant to their current needs and preferences.

Implementation Design

To implement the favorites feature in AppFlowy, a comprehensive approach involving changes in both AppFlowy's rust and flutter components is proposed. AppFlowy's persitence logic which was previously part of rust-lib in AppFlowy is now separated to a different repository AppFlowy-Collab, current plan is to introduce following changes:

  1. Changes to Existing Persistence Structs (Rust):

    • Each item displayed in the left sidebar will be represented as a View struct. The concept of an 'App' is deprecated.

    • The View struct is defined in the folder-collab crate and exposed using the ViewPB struct.

    • A new variable named is_favorites will be introduced in the View and ViewPB structs. This variable will indicate whether a specific view is a favorite without the need to iterate through all favorited views.

  2. Introduction of New Structs (Rust):

    • Two new structs, FavoritesInfo and FavoritesArray, will be introduced in the collab module.

    • FavoritesInfo will only hold the view_id of the favorited view. This will allow separate persistence of the favorite views.

    • FavoritesArray will utilize ArrayRefWrapper and ViewsMap as underlying constructs to persist all the favorite views.

  3. Calculation of Favorite Views and Data Transfer (Rust):

    • The handlers in the Rust library (rust-lib) will handle requests from the frontend to calculate the views marked as favorites based on user interactions.

    • On every new launch of AppFlowy, a FolderEvent named ReadFavorites will be sent to rust-lib. This event will be handled by a read_favorites_handler function, which will retrieve all the favorite views from persistence, map them to RepeatedViewPB (a list of ViewPB), and return them to the frontend for display under the favorites section.

    • When a favorite is toggled for a view, a FolderEvent named ToggleFavorite will be triggered, carrying the viewId of the designated view. This event will be handled by the toggle_favorites function in rust-lib.

      • If the view is not currently marked as a favorite, it will be added and persisted to the list of favorites.

      • If the view is already marked as a favorite, it will be removed from the list of favorites, effectively unfavoriting it.

      • Furthermore, a ViewPB will be created and returned to the frontend. This ViewPB object will represent the updated view and can be appended to the visible list of views in the favorites section. This ensures that the UI accurately reflects the updated favorite status of the view.

  4. Notification Handling (Rust):

    • A notification system will be implemented to handle updates to the favorite status of views.

    • When the favorite status of a view is updated, a notification named DidUpdateView under FolderNotification will be triggered to update the favorite status of the individual view.

    • A FolderNotification named FavoritesUpdated will be sent every time favorite status of a view is updated. This notification will carry a list of the updated favorite views, which will be displayed under the favorites section in Flutter.

  5. Integration with UI (Flutter):

    • The Flutter component will incorporate a dedicated bloc and service to handle the favorites functionality.

    • This module will be responsible for sending events to rust-lib and processing the notifications received with those events to appropriately update the views in the UI.

  6. Handling Edge Cases (Flutter):

    • Additional notifications will be handled when a view's data is updated in the menu. For example, if a view is renamed, deleted, or its icon is updated, these changes will be propagated to the associated view under the favorites section.

Expected Schedule

By July 6th (Estimated)

By 12th July (Estimated)

By 20th July (Estimated)

PreviousTableNextCode Block

Last updated 1 year ago

Was this helpful?

🌱
📔
⭐