Commit Graph

359 Commits

Author SHA1 Message Date
9dceb99a98 群聊创建失败提示弹窗问题 2025-09-05 14:17:09 +08:00
9f14b35847 防抖调整 2025-09-04 18:28:11 +08:00
9b7349a761 暗黑模式下创建群聊界面不显示置灰状态的创建群聊按钮问题;输入框光标颜色 2025-09-04 14:23:15 +08:00
23f3baf238 Merge remote-tracking branch 'upstream/main' 2025-09-03 18:39:42 +08:00
1f1101e260 动态输入评论UI调整 2025-09-03 18:38:11 +08:00
ca9f4a372b Merge remote-tracking branch 'origin/main' 2025-09-03 18:07:59 +08:00
d93373d8fa Refactor: Add debounce for navigation and optimize comments loading
- Implemented debounced navigation to prevent multiple rapid navigations.
- Replaced Pager-based comment loading with a simpler list-based approach for improved performance and reduced complexity.
- Added loading and error states for comment fetching.
- Introduced `debouncedClickable` modifier for handling click events with debounce.
- Updated image viewer to use simple navigation arrows instead of HorizontalPager for better user experience.
- Added a new string resource for password length error.
2025-09-03 18:07:44 +08:00
ae7254163a Refactor: Add debounce for navigation and optimize comments loading
- Implemented debounced navigation to prevent multiple rapid navigations.
- Replaced Pager-based comment loading with a simpler list-based approach for improved performance and reduced complexity.
- Added loading and error states for comment fetching.
- Introduced `debouncedClickable` modifier for handling click events with debounce.
- Updated image viewer to use simple navigation arrows instead of HorizontalPager for better user experience.
- Added a new string resource for password length error.
2025-09-03 18:02:39 +08:00
e49e509c38 暗黑模式缺省图;UI调整 2025-09-03 17:37:52 +08:00
d703b5ae05 Refactor: Add debounce for navigation and optimize comments loading
- Implemented debounced navigation to prevent multiple rapid navigations.
- Replaced Pager-based comment loading with a simpler list-based approach for improved performance and reduced complexity.
- Added loading and error states for comment fetching.
- Introduced `debouncedClickable` modifier for handling click events with debounce.
- Updated image viewer to use simple navigation arrows instead of HorizontalPager for better user experience.
- Added a new string resource for password length error.
2025-09-03 16:03:57 +08:00
824be5fad8 图片添加加载效果
- 为AsyncImage添加了Shimmer加载效果
- 优化了热门动态的加载逻辑
- 统一了ViewModel的重置方法名
2025-09-03 14:59:47 +08:00
79547de2db 账户编辑、评论点赞功能优化和UI调整
**功能优化:**

*   **账户编辑:**
    *   昵称和个人简介输入时自动去除换行符。
    *   修复了进入编辑页面时可能未正确加载或重置用户资料的问题。
    *   保存资料时,确保昵称和个人简介中的换行符被移除。
    *   清除裁剪的头像图片,避免重复使用。
*   **评论点赞/取消点赞:**
    *   引入乐观更新策略,提升用户体验,点赞/取消点赞操作会立即反映在UI上,然后进行后台API调用。
    *   增加防抖机制,防止用户快速重复点击点赞/取消点赞按钮导致多次API请求。

**UI调整:**

*   **账户编辑页面:**
    *   页面切换动画调整为iOS风格的底部滑入滑出效果。
2025-09-03 14:21:13 +08:00
16f95782f8 优化AI页面资源管理和数据加载
- AgentViewModel:
    - 新增 `refreshAgentData` 方法用于刷新推荐Agent数据。
    - 新增 `ensureDataLoaded` 方法用于检查推荐Agent数据是否为空,如果为空则重新加载。
- ResourceCleanupManager:
    - `cleanupPageResources` 方法新增 `preserveRecommendedData` 参数,用于控制是否保留推荐数据。
    - 新增 `cleanupAiPageCompletely` 方法,用于完全清理AI页面资源(包括推荐数据),主要用于登出等场景。
- Agent.kt:
    - 在页面进入时调用 `viewModel.ensureDataLoaded()` 确保推荐Agent数据已加载。
    - 页面退出时不再清理推荐Agent数据,只在完全登出或需要彻底清理时才清理。

此更改旨在:
- 避免不必要的推荐Agent数据重复加载。
- 优化AI页面退出时的资源清理逻辑,仅在需要时才清理推荐数据。
2025-09-03 11:49:53 +08:00
3aa0172580 Api地址调整 2025-09-03 11:42:59 +08:00
a950504d6f 修改头像昵称获取方式,修改接口地址 2025-09-03 11:41:28 +08:00
288728f142 修复添加Agent时取消选择头像后数据被清空的问题
- 引入`isSelectingAvatar`状态来标记是否正在选择头像。
- 当用户从图片裁剪页面返回或取消选择时,不再清空`AddAgentViewModel`中的数据。
- 仅当用户从`AddAgent`页面返回(并且不是在选择头像的过程中)时,才清空已填写的数据。
- 调整了`AddAgent`页面的返回逻辑,以确保在选择头像过程中返回时数据得以保留。
2025-09-03 11:05:12 +08:00
db85deea96 群聊仅自己可见开关调整 2025-09-02 18:28:37 +08:00
7882ab8f19 评论区UI调整 2025-09-02 17:38:56 +08:00
2b0d33fdbe 上架图-缺省图调整 2025-09-02 16:32:59 +08:00
0ac3312fea 群聊信息UI调整 2025-09-01 18:52:50 +08:00
2f61850c33 群聊信息;更改密码UI调整 2025-09-01 18:17:50 +08:00
6c743a6cac VIP页面UI调整 2025-09-01 18:01:43 +08:00
c202f0d280 UI调整 2025-09-01 17:54:38 +08:00
c20b6ba682 动态tab栏UI调整
- 移除不安全的HttpClient,使用安全的HttpClient
- 动态tab栏非激活状态颜色调整
2025-09-01 17:46:00 +08:00
ab43f154f5 Refactor: 优化智能体操作交互
- 个人主页智能体列表项增加长按操作,用于弹出操作菜单。
- 实现智能体操作菜单弹窗,提供删除等操作选项。
- 增加删除智能体确认对话框,防止误操作。
- 移除账号页面密码输入框重构为通用组件。
2025-09-01 17:14:22 +08:00
9c7c87722b 切换评论排列方式时屏幕下方会出现红线调整 2025-09-01 16:51:12 +08:00
337bda46a2 Ai列表的游客模式优化 2025-09-01 16:14:53 +08:00
2e176605f7 Merge remote-tracking branch 'origin/main' 2025-09-01 16:03:58 +08:00
6721d715e7 关注、粉丝列表点击关注按钮增加游客登录判断 2025-09-01 16:03:12 +08:00
b9fac2c1ee 暗黑模式下更换头像后上方白边调整 2025-09-01 16:02:05 +08:00
118a6cf986 优化DropdownMenu UI
- 修复聊天页静音的显示文案问题
- 优化DropdownMenu的UI
2025-09-01 15:50:10 +08:00
36d322ef8c Reset ViewModels on logout/account switch
This commit introduces a `ResetModel()` function to `AgentViewModel` and `MineAgentViewModel` to clear their state.

This function is now called in `ResourceCleanupManager` and `AppState` during logout or when switching accounts to ensure that data from the previous session is not retained.

Additionally, the search and group name input fields in `CreateGroupChatScreen` are now single-line.
2025-09-01 15:36:22 +08:00
5c12982908 Refactor: Use common password validator
Refactors password validation logic to use a common `PasswordValidator` utility. This ensures consistent password validation rules across different parts of the application, including:

- User login
- Email sign-up
- Password change
- Account removal

Also adds a string resource for password too long error message.
2025-09-01 15:10:14 +08:00
4d319351b7 朋友圈刷新方式调整 2025-09-01 15:02:39 +08:00
76bcb1e7fc Limit user bio display to one line
Ensures that user bios in the user item component are truncated to a single line with an ellipsis if they exceed the available width. This applies to both users with existing bios and those with the "No bio here." placeholder.
2025-09-01 14:34:03 +08:00
83cff9d56c Enhance AI Agent Profile Interaction
This commit introduces several enhancements to how AI agent profiles are displayed and interacted with:

**Profile Display:**
- **AI Account Distinction:** Profile pages now differentiate between regular user accounts and AI agent accounts.
    - AI agent profiles will not display the "Agents" tab in their profile.
    - The profile header height is adjusted for AI accounts.
- **Navigation Parameter:** An `isAiAccount` boolean parameter is added to the `AccountProfile` navigation route to indicate if the profile being viewed belongs to an AI.

**Interaction & Navigation:**
- **Avatar Click Navigation:**
    - Clicking an AI agent's avatar in various lists (Hot Agents, My Agents, User Agents Row, User Agents List) now navigates to the agent's dedicated profile page.
    - When navigating to an agent's profile from an agent list, `isAiAccount` is set to `true`.
- **Chat Initiation:** Clicking the chat button on AI agent cards in the "Agent" tab (both Hot and My Agents) now correctly initiates a chat with the respective AI.
- **ViewModel Updates:**
    - `AgentViewModel`, `MineAgentViewModel`, and `HotAgentViewModel` now include a `goToProfile` function to handle navigation to agent profiles, correctly passing the `isAiAccount` flag.

**Code Refinements:**
- Click handlers for agent avatars and chat buttons are now wrapped with `DebounceUtils.simpleDebounceClick` to prevent multiple rapid clicks.
- The `UserContentPageIndicator` now conditionally hides the "Agent" tab based on the `isAiAccount` status.
- `UserAgentsRow` and `UserAgentsList` now accept an `onAvatarClick` callback for navigating to agent profiles.
- `AgentItem` (used in `UserAgentsRow`) and `UserAgentCard` (used in `UserAgentsList`) now handle avatar clicks.
- The general `Agent` composable (used in `AiPostComposable`) now also supports an `onAvatarClick` callback.
2025-09-01 14:17:44 +08:00
484d641554 Enhance AI Agent Profile Interaction
This commit introduces several enhancements to how AI agent profiles are displayed and interacted with:

**Profile Display:**
- **AI Account Distinction:** Profile pages now differentiate between regular user accounts and AI agent accounts.
    - AI agent profiles will not display the "Agents" tab in their profile.
    - The profile header height is adjusted for AI accounts.
- **Navigation Parameter:** An `isAiAccount` boolean parameter is added to the `AccountProfile` navigation route to indicate if the profile being viewed belongs to an AI.

**Interaction & Navigation:**
- **Avatar Click Navigation:**
    - Clicking an AI agent's avatar in various lists (Hot Agents, My Agents, User Agents Row, User Agents List) now navigates to the agent's dedicated profile page.
    - When navigating to an agent's profile from an agent list, `isAiAccount` is set to `true`.
- **Chat Initiation:** Clicking the chat button on AI agent cards in the "Agent" tab (both Hot and My Agents) now correctly initiates a chat with the respective AI.
- **ViewModel Updates:**
    - `AgentViewModel`, `MineAgentViewModel`, and `HotAgentViewModel` now include a `goToProfile` function to handle navigation to agent profiles, correctly passing the `isAiAccount` flag.

**Code Refinements:**
- Click handlers for agent avatars and chat buttons are now wrapped with `DebounceUtils.simpleDebounceClick` to prevent multiple rapid clicks.
- The `UserContentPageIndicator` now conditionally hides the "Agent" tab based on the `isAiAccount` status.
- `UserAgentsRow` and `UserAgentsList` now accept an `onAvatarClick` callback for navigating to agent profiles.
- `AgentItem` (used in `UserAgentsRow`) and `UserAgentCard` (used in `UserAgentsList`) now handle avatar clicks.
- The general `Agent` composable (used in `AiPostComposable`) now also supports an `onAvatarClick` callback.
2025-09-01 01:10:35 +08:00
12b3c15083 允许在群聊列表中跳转到群聊信息页面 2025-09-01 00:02:20 +08:00
cb253d3276 完善个人信息编辑
- 修复了从相册选择图片时,如果文件名不包含扩展名导致的崩溃问题。
- 在编辑个人信息页面增加了“修改密码”的入口。
- 修复了新建Agent时,保存按钮状态更新不及时的问题。
- 优化了新建Agent时,对异常的处理。
2025-08-31 23:59:05 +08:00
2907e7f9a6 Refactor: 优化关注列表和代码逻辑
本次提交主要包含以下更改:

- **关注/粉丝列表逻辑修正**:修复了在 `FollowerListViewModel` 和 `FollowingListViewModel` 中 `followerId` 和 `followingId` 属性赋值错误的问题,确保正确加载关注和粉丝列表。
- **分页大小调整**:将 `BaseFollowModel` 中分页加载的 `pageSize` 从 5 调整为 20,以提高用户体验。
- **个人资料页智能体展示**:
    - 在 `AccountProfileV2` 和 `AccountProfileViewModel` 中增加了对用户智能体列表的加载和展示逻辑。
    - 修复了 `MyProfileViewModel` 中加载当前用户智能体时 `authorId` 传递错误的问题。
    - 优化了 `UserAgentsRow` 和 `UserAgentsViewModel` 的逻辑,确保正确加载和显示用户智能体,并在用户切换时清理旧数据。
- **代码清理**:移除了部分冗余的 `println` 调试信息。
- **Agent创建流程优化**:在 `AddAgentViewModel` 和 `AgentImageCropScreen` 中,确保在已有裁剪图片时直接使用,避免重复裁剪。
2025-08-31 23:50:52 +08:00
281169cfcb UI优化 2025-08-31 23:26:13 +08:00
ba7eeeca90 增加智能体头像裁剪页面
- 新增 `AgentImageCropScreen.kt` 用于智能体头像的裁剪和预览。
- 调整导航逻辑,添加智能体时跳转到新的 `AgentImageCrop` 路由。
- 原有的 `ImageCropScreen` 专门用于处理个人资料头像的裁剪。
- `AddAgentViewModel` 中移除 `isFromAddAgent` 标志,通过不同的导航路由区分头像裁剪来源。
2025-08-31 23:18:33 +08:00
00824ff7b4 Refactor: 优化个人主页和账户主页帖子加载逻辑
- 统一MyProfileViewModel和AccountProfileViewModel中的帖子加载逻辑,使用一致的pageSize。
- 在ProfileWrap和AccountProfileV2中传递正确的postCount。
- 在ProfileV3中改进了加载更多帖子的触发条件,确保在有更多数据时才触发加载。
- 修复了注册页面勾选协议和促销选项后,错误状态未清除的问题。
- 为DataLoader和ProfileV3中的滚动加载逻辑添加了详细日志,方便调试。
2025-08-31 23:04:52 +08:00
3777a76c44 群聊头像支持点击跳转到群信息页面 2025-08-31 22:24:53 +08:00
40ccd70e80 Add VIP selection page and related data models
This commit introduces a new VIP selection page (`VipSelPage.kt`) that allows users to choose between Premium and Standard membership plans.

Key changes include:

*   **New VIP Selection UI:**
    *   `VipSelPage.kt`: Implements the UI for selecting VIP plans, displaying prices, and benefits.
    *   `SelfProfileAction.kt`: Updated to include a "Rave Premium" button alongside "Edit Profile".
*   **Data Models for Membership:**
    *   `MembershipModels.kt`: Defines data classes for membership configuration (`MembershipConfigData`, `ConfigData`, `Member`, `Benefit`, `Good`), price models (`VipPriceModel`), page data models (`VipPageDataModel`), and request bodies (`ValidateProductRequestBody`, `ValidateData`).
    *   `VipModelMapper`: Provides functions to transform backend data into UI-friendly models for price and benefit display.
*   **API Integration:**
    *   `RiderProAPI.kt`: Added new endpoints `getMembershipConfig` to fetch membership details and `validateAndroidProduct` for product validation.
*   **Navigation:**
    *   `Navi.kt`: Added `VipSelPage` to the navigation routes.
    *   `ProfileV3.kt`: The "Rave Premium" button in the self profile action now navigates to the `VipSelPage`.
*   **Theming:**
    *   `Colors.kt`: Added new color definitions for premium buttons, VIP benefit highlighting, and price card states (selected/unselected).
*   **Assets:**
    *   `ic_member.webp`: New icon for the "Rave Premium" button.
2025-08-31 22:17:20 +08:00
5759d4ec95 导航切换动画调整
将默认的淡入淡出动画效果替换为更接近iOS风格的侧滑动画,提升页面切换的流畅度和视觉体验。

**具体变更:**

*   **页面进入:** 新页面从右侧滑入。
*   **页面退出:** 当前页面向右侧滑出,前一页面从左侧轻微偏移处滑回。
*   **动画时长:** 统一设置为280毫秒。

**影响范围:**

*   图片详情页 (`ImagePagerScreen`)
*   创建群聊页 (`CreateGroupChatScreen`)

**其他优化:**

*   **创建群聊页UI调整:**
    *   群聊名称输入框样式统一,采用圆角灰色背景。
    *   底部创建按钮适配导航栏高度。
    *   列表区域自适应填满剩余空间,防止内容被遮挡。
    *   选择成员列表项固定高度,避免选中状态变化时布局跳动。
    *   为头像和选择框添加默认图和占位图。
*   **ImageLoader优化:**
    *   实现全局共享的 `ImageLoader` 实例,避免重复创建,提高内存缓存利用率。
*   **列表性能优化:**
    *   为好友列表和AI助手列表的 `items` 添加 `key`,提升列表项更新效率。
*   **资源清理调整:**
    *   移除了在离开首页和动态页时全量清理资源的操作,以避免返回时列表重置或不必要的重新加载。
*   **ProfileV3页代码清理:**
    *   移除未使用的导入。
2025-08-31 21:13:06 +08:00
21200910c1 Refactor: 个人主页UI及智能体列表功能调整
- **个人主页UI调整:**
    - "编辑个人资料"按钮样式调整为与"私信"按钮一致。
    - "关注"按钮样式调整为渐变色,"已关注"状态下显示灰色边框。
    - "私信"按钮样式调整为灰色背景。
    - "帖子"、"粉丝"、"关注"文案调整。
    - 个人主页背景色适配深色模式。
    - 个人主页内容切换Tab图标化,并添加下划线指示器。
- **智能体列表功能:**
    - 新增`UserAgentsList.kt`用于展示用户的智能体列表。
    - 在个人主页中集成智能体列表展示(新的Tab页)。
    - 调整`UserAgentsRow`组件,使其能够加载并展示当前用户或其他用户的智能体,并添加"更多"按钮。
    - `MyProfileViewModel`中增加对智能体数据的加载和管理。
    - `UserAgentsViewModel`调整为可以加载指定用户或当前用户的智能体数据。
- **其他:**
    - `Colors.kt`中新增`profileBackground`颜色定义。
    - `Agent.kt`中调整了`getAgent`方法返回类型。
2025-08-31 20:23:28 +08:00
a79628026c 首页UI调整 2025-08-29 18:39:59 +08:00
7c0d35ec8c 首页搜索调整 2025-08-28 18:58:22 +08:00
da5fdcbd57 删除账户UI调整 2025-08-28 14:30:47 +08:00