Skip to content

Commit 5ee4a18

Browse files
committed
docs(mobile-client): add entity details feature documentation
- Create new documentation page for Entity Details feature - Describe core components, functionalities, and design principles - Explain integration with other features like AccountBloc and FeedInjectorService - Highlight reusability for Topics and Sources
1 parent d3ffd80 commit 5ee4a18

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: Entity Details
3+
description: Learn how the app displays detailed pages for topics and sources.
4+
---
5+
import { Card, CardGrid } from '@astrojs/starlight/components';
6+
7+
The Entity Details page is a versatile component designed to display a detailed view for content entities like **Topics** and **Sources**. It serves as a hub for a specific entity, showing its description and a feed of all related headlines.
8+
9+
## Core Components
10+
11+
- **`EntityDetailsBloc`**: The BLoC that powers this feature. It is responsible for fetching the primary entity's data (e.g., the `Topic` object) and then fetching a paginated list of `Headline` items that are associated with that entity. It also syncs with the `AccountBloc` to manage the "follow" status of the entity.
12+
13+
- **`EntityDetailsPage`**: The main UI widget. It can be initialized in two ways: by passing a full entity object (like a `Topic` or `Source`) or by passing an `entityId` and `contentType`. The page displays the entity's details at the top and a scrollable list of related headlines below.
14+
15+
## Key Functionalities
16+
17+
<CardGrid>
18+
<Card title="Generic and Reusable" icon="puzzle">
19+
This page is designed to be generic. The same `EntityDetailsPage` is used to display information for both Topics and Sources, reducing code duplication and ensuring a consistent user experience across different content types.
20+
</Card>
21+
<Card title="Dynamic Content Loading" icon="list-ordered">
22+
The page first loads the details of the entity itself. Once the entity is loaded, the `EntityDetailsBloc` begins fetching the associated headlines, with support for infinite scrolling to load more articles as the user scrolls down.
23+
</Card>
24+
<Card title="Follow/Unfollow Actions" icon="user-check">
25+
A prominent "follow" button allows users to follow or unfollow the displayed topic or source. This action is dispatched to the `AccountBloc`. The `EntityDetailsBloc` subscribes to state changes from the `AccountBloc` to reactively update the UI of the follow button.
26+
</Card>
27+
<Card title="Integrated Feed" icon="newspaper">
28+
The list of related headlines is not just a simple list; it's a fully integrated feed. The `FeedInjectorService` is used to dynamically insert ads and other content into the headline list, just like in the main headlines feed.
29+
</Card>
30+
</CardGrid>

0 commit comments

Comments
 (0)