feat(metadata-editor): save metadata details on create#4499
feat(metadata-editor): save metadata details on create#4499mergify[bot] merged 2 commits intobox:masterfrom
Conversation
WalkthroughAdded optional confidence-score support to metadata creation: Changes
Sequence Diagram(s)(Skipped — change is primarily payload construction inside the API call, not a multi-component sequential flow that benefits from a diagram.) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ast-grep (0.42.1)src/api/__tests__/Metadata.test.jsThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/api/__tests__/Metadata.test.js (1)
3019-3019: Prefer using the shared constant instead of repeating'AI_ACCEPTED'literals in expectations.Using
AI_ACCEPTED_PROCESShere keeps tests aligned with production constants if the token ever changes.♻️ Proposed refactor
-import { +import { + AI_ACCEPTED_PROCESS, ERROR_CODE_CREATE_METADATA, ERROR_CODE_DELETE_METADATA, ERROR_CODE_FETCH_METADATA_SUGGESTIONS, @@ - process: 'AI_ACCEPTED', + process: AI_ACCEPTED_PROCESS, @@ - process: 'AI_ACCEPTED', + process: AI_ACCEPTED_PROCESS, @@ - process: 'AI_ACCEPTED', + process: AI_ACCEPTED_PROCESS, @@ - process: 'AI_ACCEPTED', + process: AI_ACCEPTED_PROCESS,Also applies to: 3077-3077, 3242-3242, 3366-3366
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/api/__tests__/Metadata.test.js` at line 3019, Replace the hard-coded 'AI_ACCEPTED' string in the test expectations with the shared constant AI_ACCEPTED_PROCESS: import AI_ACCEPTED_PROCESS from the module that exports it, then update occurrences like the object with process: 'AI_ACCEPTED' (and the other noted locations) to use process: AI_ACCEPTED_PROCESS so tests stay in sync with production constants.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/api/__tests__/Metadata.test.js`:
- Line 3019: Replace the hard-coded 'AI_ACCEPTED' string in the test
expectations with the shared constant AI_ACCEPTED_PROCESS: import
AI_ACCEPTED_PROCESS from the module that exports it, then update occurrences
like the object with process: 'AI_ACCEPTED' (and the other noted locations) to
use process: AI_ACCEPTED_PROCESS so tests stay in sync with production
constants.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: a6dfd577-aeab-43aa-96eb-116f08a22a23
📒 Files selected for processing (4)
src/api/Metadata.jssrc/api/__tests__/Metadata.test.jssrc/constants.jssrc/elements/content-sidebar/hooks/useSidebarMetadataFetcher.ts
dbae50b to
daf4267
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/constants.js (1)
447-447: Consider moving this constant to the Metadata section.The
AI_ACCEPTED_PROCESSconstant is semantically related to metadata processing (used when building confidence score details), but it's placed under the "Sidebar View" section comment. For better code organization, consider relocating it to the "Metadata" section around lines 86-98 where other metadata-related constants are defined.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/constants.js` at line 447, Move the AI_ACCEPTED_PROCESS constant into the Metadata constants group to improve organization: locate the export const AI_ACCEPTED_PROCESS: 'AI_ACCEPTED' = 'AI_ACCEPTED'; declaration and cut it from the Sidebar View section, then paste it near the other metadata-related constants (the block that contains metadata keys and confidence-related constants) so it lives with related symbols; ensure the export name and value remain unchanged and update any nearby comments to reflect the metadata grouping.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/constants.js`:
- Line 447: Move the AI_ACCEPTED_PROCESS constant into the Metadata constants
group to improve organization: locate the export const AI_ACCEPTED_PROCESS:
'AI_ACCEPTED' = 'AI_ACCEPTED'; declaration and cut it from the Sidebar View
section, then paste it near the other metadata-related constants (the block that
contains metadata keys and confidence-related constants) so it lives with
related symbols; ensure the export name and value remain unchanged and update
any nearby comments to reflect the metadata grouping.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: cd9b9bd9-7538-4666-9b06-43f1c5eebc27
📒 Files selected for processing (4)
src/api/Metadata.jssrc/api/__tests__/Metadata.test.jssrc/constants.jssrc/elements/content-sidebar/hooks/useSidebarMetadataFetcher.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- src/elements/content-sidebar/hooks/useSidebarMetadataFetcher.ts
- src/api/tests/Metadata.test.js
Merge Queue Status
This pull request spent 11 seconds in the queue, including 1 second running CI. Required conditions to merge
|
Summary by CodeRabbit
New Features
createMetadataRedesignmethod with adding$detailsfield to the payload whenisConfidenceScoreEnabledis truthyTests
Screen.Recording.2026-04-08.at.18.54.51.mov