Tangyuan/.idea/deploymentTargetSelector.xml
grtsinry43 0f5bfe6aec
feat: Implement "Create Post" screen with image upload
This commit introduces a new "Create Post" screen, enabling users to compose and publish posts with text and up to three images. The implementation includes a dedicated ViewModel, robust state management, and an asynchronous image upload flow.

**Key Changes:**

*   **feat(Create Post Screen):**
    *   Added `CreatePostScreen.kt`, a new Composable screen for creating posts.
    *   The UI includes a text input field, selectors for "Section" and "Category," and an image picker/preview area.
    *   Implemented `SelectionBottomSheet` as a reusable component for picking sections and categories from a modal bottom sheet.
    *   The "Publish" button is dynamically enabled based on content validation and image upload status.
    *   Error messages are displayed to the user via a snackbar-like component.

*   **feat(CreatePostViewModel):**
    *   Created a new `CreatePostViewModel` to manage the logic and state (`CreatePostState`) of the creation process.
    *   Fetches post categories on initialization.
    *   Handles image selection and manages an asynchronous upload queue. Each selected image is immediately uploaded to the backend via `MediaRepository`.
    *   The ViewModel tracks the upload progress for each image and updates the UI accordingly.
    *   The `createPost` function validates all inputs, compiles the post data (including uploaded image UUIDs), and sends it to the repository.

*   **feat(Navigation):**
    *   Added a `CreatePost` route to the navigation graph (`Screen.kt`).
    *   Integrated the new screen into `App.kt` with custom horizontal slide transitions.
    *   The publish button on the main screen's top bar now navigates to the `CreatePostScreen`.
    *   Upon successful post creation, the user is navigated back to the main screen.

*   **refactor(PostDetailViewModel):**
    *   Adjusted the `createComment` logic to correctly handle `parentCommentId`, sending `0L` instead of `null` when there is no parent comment.
2025-10-09 00:53:20 +08:00

18 lines
612 B
XML

<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetSelector">
<selectionStates>
<SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" />
<DropdownSelection timestamp="2025-10-08T15:39:42.580350198Z">
<Target type="DEFAULT_BOOT">
<handle>
<DeviceId pluginId="PhysicalDevice" identifier="serial=6fbe7ac" />
</handle>
</Target>
</DropdownSelection>
<DialogSelection />
</SelectionState>
</selectionStates>
</component>
</project>