6 Commits

Author SHA1 Message Date
39b5c3e40f
feat: Implement user detail screen and refactor navigation
This commit introduces a dedicated user detail screen, enabling users to view profiles, and refactors the navigation flow, particularly for post and image details, to be more modular and robust.

**Key Changes:**

*   **feat(UserDetailScreen):**
    *   Added a new `UserDetailScreen` to display user information, including their avatar, name, bio, and a list of their posts.
    *   Implemented a `UserDetailViewModel` to fetch user data and their associated posts from the repository.
    *   The screen is composed of several modular components: `UserDetailCard`, `UserStatsSection`, and `PostsSection`.
    *   Includes loading skeletons and an empty state for the user's post list.
    *   Integrated a pull-to-refresh mechanism to update user data.

*   **feat(Navigation):**
    *   Added a new `UserDetail` route (`user_detail/{userId}`) to the navigation graph.
    *   Users can now navigate from a post card or post detail view to the author's `UserDetailScreen`.
    *   Clicking a post in the `UserDetailScreen` navigates to the corresponding `PostDetailScreen`.

*   **refactor(Navigation & Post/Image Detail):**
    *   Decoupled the text and image detail views, removing the `PostDetailContainer` that previously managed mode switching with `AnimatedContent`.
    *   `PostDetailScreen` and `ImageDetailScreen` are now independent navigation destinations.
    *   Navigation from a post to its image view is now a direct navigation action to `ImageDetailScreen`, simplifying the logic.
    *   The route for `PostDetail` has been simplified to `post_detail/{postId}`, removing the `mode` parameter.

*   **feat(Shared Element Transition):**
    *   Implemented a shared element transition for the user avatar, animating it from `PostCardItem` to `UserDetailScreen`.
    *   The avatar transition key is based on `user_avatar_{userId}` for consistent animations.

*   **refactor(ImageDetailScreen):**
    *   Improved the shared element transition for images by setting `placeHolderSize` to `animatedSize` and disabling `renderInOverlayDuringTransition`, which can resolve certain animation artifacts.

*   **refactor(Repository):**
    *   Added `getUserPosts(userId)` to the `UserRepository` to fetch all post metadata for a specific user.
2025-10-06 11:40:55 +08:00
e373670715
refactor: Improve shared element transition for images
This commit refactors the shared element transitions for images to be more specific and robust, creating a smoother animation between the post list/detail and the full-screen image viewer.

**Key Changes:**

*   **Refined Shared Element Keys:**
    *   The shared element key for images is now based on both `postId` and `imageIndex` (e.g., `post_image_{postId}_{imageIndex}`). This replaces the previous, less specific key (`post_card_{postId}`), ensuring that the correct image animates, especially in multi-image posts.

*   **Improved Animation:**
    *   The animation `tween` duration has been standardized to 400ms with a `FastOutSlowInEasing` curve for a more polished and consistent feel across all image transitions.

*   **Navigation & State Handling:**
    *   The navigation route for `PostDetail` now accepts an `imageIndex` parameter, allowing direct navigation to a specific image within the image detail view.
    *   The `PostDetailContainer` now uses the passed `initialImageIndex` to correctly display the selected image when entering image mode.
    *   Shared element transitions are now conditionally applied only during the initial navigation into a mode (text or image) to prevent animation conflicts when switching between them.

*   **Component Updates:**
    *   `PostCardImages` and `PostDetailImages` now accept `sharedTransitionScope` and `animatedContentScope` to correctly apply the shared element modifier to each image.
    *   `ImageDetailScreen` has been updated to use the new `imageIndex`-based keying for its `ZoomableImage`.
2025-10-06 02:47:03 +08:00
93f95bf9c3
feat: Implement image detail view and text/image mode switching
This commit introduces a dedicated image detail screen and integrates it with the post detail view, allowing users to switch between a text-focused layout and an immersive, image-centric one.

**Key Changes:**

*   **feat(ImageDetailScreen):**
    *   Added a new `ImageDetailScreen` for a full-screen, immersive image viewing experience.
    *   Implemented a `HorizontalPager` to allow swiping between multiple images.
    *   Included zoom (pinch-to-zoom) and double-tap-to-zoom functionality for images.
    *   Overlaid post information (author, content snippet) on a blurred background, which can be swiped up to switch back to the text detail view.
    *   The background is a blurred version of the current image, creating an ambient effect.

*   **feat(Navigation):**
    *   Created a `PostDetailContainer` to manage the animated transition between `PostDetailScreen` (text mode) and `ImageDetailScreen` (image mode).
    *   Updated the navigation route for `PostDetail` to accept a `mode` parameter (`text` or `image`) to handle deep linking directly into the image view.
    *   Clicking an image in the feed or post details now navigates to the image mode, preserving the shared element transition.

*   **refactor(PostDetail):**
    *   Modified `PostCardItem` and `PostDetailScreen` to pass both `postId` and the image `index` on image clicks.
    *   Refactored the image click handler to trigger the navigation to the new image detail mode.
2025-10-06 01:29:15 +08:00
6a1bc7ad97
feat: Implement core features with MVVM and Hilt
This commit introduces a comprehensive set of features, establishing the core functionality of the application using an MVVM architecture with Hilt for dependency injection.

**Key Changes:**

*   **UI & Navigation:**
    *   Implemented navigation between the main feed, post details, and login screens using Jetpack Navigation Compose.
    *   Added `TalkScreen` for displaying a feed of posts and `PostDetailScreen` for viewing individual posts and their comments.
    *   Created a `LoginScreen` with input fields and authentication logic.
    *   Introduced `PostCardItem` and `CommentItem` Composables for a consistent and reusable UI.
    *   Added shared element transitions for a smoother user experience when navigating to post details.

*   **Architecture & State Management:**
    *   Integrated Hilt for dependency injection across ViewModels and Repositories.
    *   Created ViewModels (`TalkViewModel`, `PostDetailViewModel`, `UserViewModel`, `CommentViewModel`, etc.) to manage UI state and business logic.
    *   Implemented Repository pattern for abstracting data sources from the backend API.
    *   Defined UI state data classes to ensure a predictable and observable state flow.

*   **Data & Models:**
    *   Introduced data models for `PostCard` and `CommentCard` to aggregate and display complex data structures.
    *   Added `PostDetailRepository` to orchestrate fetching of post and comment data concurrently.
    *   Refined DTOs, such as `CreateCommentDto`, for API interactions.

*   **Dependencies & Tooling:**
    *   Added Hilt, Navigation Compose, and Lifecycle ViewModel dependencies.
    *   Included the `pangu-jvm` library for improved text formatting with spacing between Chinese and English characters.
2025-10-06 00:29:51 +08:00
6d1c03ec85
refactor: change mutable properties to immutable in data classes 2025-10-05 11:42:29 +08:00
586425998d
Initial Commit 2025-10-05 01:20:02 +08:00