-
Notifications
You must be signed in to change notification settings - Fork 30
feat: enhance public notes functionality with flexible options #141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Make public notes optional to prevent default values causing frontend issues - Add dual editing modes: raw text editing and custom fields (avoid hardcoded schema) - Set raw text mode as default, populate input on edit, submit raw text content always - Add toggle switch: submit raw text when enabled, submit empty & hide controls when disabled - New records default to disabled public notes; auto-expand on edit based on content
|
Linting and formatting issues were automatically fixed. Please review the changes. |
|
@uubulb 麻烦有空review下 |
|
公开备注解析的逻辑,不需要组件内部变量的可以放在组件外部 |
|
|
|
可以再套一层 wrapper,让组件更新可以只传入某个特定字段的值,然后在 wrapper 里再更新 |
|
可否模仿一下 |
Implemented Zod validation patterns, default values, parsing functions, and utility functions for public notes, and updated related internationalization text.
|
Linting and formatting issues were automatically fixed. Please review the changes. |
Replace direct use of i18n.t with react-i18next's useTranslation hook to improve internationalization support.
Removed the pruneEmpty function and simplified the date processing logic, making billingDataMod and planDataMod optional fields. Also optimized the validation logic to handle optional fields.
|
Linting and formatting issues were automatically fixed. Please review the changes. |
|
@Chillln 请问是否已经完成更改?完成的话我就 approve 了 |
|
@uubulb 已经完成更改 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the public notes functionality by making it optional and introducing dual editing modes (raw text and custom fields). The changes aim to prevent frontend issues caused by default values and provide more flexible editing options.
Key changes:
- Made public notes optional to avoid default value issues
- Added dual editing modes: raw text editing and structured custom fields
- Set raw text mode as default with proper validation
- New records default to disabled public notes with auto-expansion based on content
Reviewed Changes
Copilot reviewed 34 out of 35 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main.tsx | Reorganized import statements for better alphabetical ordering |
| src/locales/en/translation.json | Added new translation keys for public note features and removed unused entries |
| src/locales/zh-CN/translation.json | Added corresponding Chinese translations for new public note functionality |
| src/lib/public-note.ts | Created comprehensive library for public note handling with validation, parsing, and manipulation utilities |
| src/hooks/useMediaQuery.tsx | Reordered imports alphabetically |
| src/components/ui/*.tsx | Standardized import ordering and formatting across all UI components |
| src/components/server.tsx | Major refactor of public note functionality with dual mode support and improved validation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
Upgrade multiple npm dependencies to their latest versions, including react, tailwindcss, and eslint. Ignore lock files.
|
@naiba 本地构建测试记录(这次是更新依赖包后再构建的 上次忘记重新install了) 登录页及此次变更页控制台均无报错
后端日志 |
Changed undefined values for bill amount to the default value "0" to avoid potential null value errors.
|
@naiba 编译出来的和本地不一样呢 |
|
你编译出来放自定义主题文件夹里测,能测出来的 |
|
@naiba 刚刚构建的版本我打开有报错 |
|
你本地环境多少有点问题,你研究研究吧 |
|
@naiba 好了 最新构建的没问题了 |


Close #140