Conversation
- Introduced RampRoleMappingController to handle role mapping operations. - Added RampRoleMappingService for managing role mappings and ensuring custom roles exist. - Updated SyncController to integrate role mapping logic during employee sync. - Enhanced UI components to support role mapping configuration and display. - Implemented role mapping data fetching and saving in the employee sync process.
…nc operations - Added IntegrationSyncLoggerService to log role discovery and mapping processes. - Updated RampRoleMappingController to log role discovery events and results. - Enhanced SyncController to log employee sync operations and their outcomes. - Modified Prisma schema to include sync logs in IntegrationConnection and Organization models.
…ping endpoints - Added validation to check if the connection exists and belongs to the correct organization in both role mapping and get role mapping methods. - Enhanced error handling to return appropriate HTTP status codes for missing connections.
…figuration - Updated SyncController to log when role mapping is not configured during manual sync. - Modified response structure to include logging of sync results when no Ramp roles are found. - Ensured that sync operations provide detailed logging for better traceability.
…oleMappingService - Removed the role count check when ensuring custom roles exist, streamlining the role creation process. - Updated documentation to clarify the purpose of the ensureCustomRolesExist method.
…ontent - Enhanced error handling in fetchRoles and handleRefresh functions to ensure error messages are displayed appropriately. - Added error logging to provide better traceability during role fetching and refreshing operations.
…to tofik/ramp-integration
- Updated RampRoleMappingController to preserve existing role mappings when saving discovered roles. - Introduced saveDiscoveredRoles method in RampRoleMappingService to save only discovered roles without altering the role_mapping field. - Improved handling of existing mappings to ensure data integrity during role updates.
- Introduced RampApiService to handle access token retrieval and user fetching from the Ramp API. - Refactored RampRoleMappingController and SyncController to utilize RampApiService for improved user management. - Removed redundant access token and user fetching logic from controllers, enhancing code maintainability.
[dev] [tofikwest] tofik/ramp-integration
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
PR SummaryMedium Risk Overview Ramp sync behavior changes. Employee sync is refactored to use a shared UI adds Ramp role-mapping configuration. The People page gets a new Role Mapping tab plus a modal sheet that is shown when Ramp sync requires mapping; the flow discovers roles, lets admins map to built-in/custom roles (with permission matrix), saves, then retries sync. Policy editor AI is reworked to inline suggestions. Removes the diff-based “apply changes” flow and introduces suggestion ranges with top-bar controls, per-selection inline AI edits, a redesigned assistant chat UI with stop support, and expanded tests/mocks for markdown conversion and the new suggestions hook. Minor: Written by Cursor Bugbot for commit f85e757. This will update automatically on new commits. Configure here. |
Updating models to gemini flash lite
CS-184 Make sure azure assessment title is not empty so that cloud tests scanning is always successful.
* docs: add per-hunk feedback design spec for suggested changes Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: add per-hunk feedback UI to proposed changes card Add pencil icon button to the accept/reject pill that opens an inline text input for per-hunk AI feedback. Submitting sends contextual feedback through the existing chat, shows a shimmer loading state for the targeted hunk, and remaps decisions when the proposal changes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: enhance policy editor with improved proposal handling and UI updates - Refactor `getLatestProposedPolicy` to `getLatestCompletedProposal` for better tracking of proposals across the entire conversation. - Update `PolicyContentManager` to utilize the new proposal fetching logic and manage proposal states more effectively. - Revamp `PolicyAiAssistant` UI to improve user interaction and feedback display. - Introduce confirmation for applying all changes in `ProposedChangesCard`, ensuring user intent is clear before executing bulk actions. - Update `.gitignore` to exclude new directories related to superpowers documentation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: filter no-change hunks, merge skip blocks, and improve AI prompt - Filter out hunks with only whitespace-only changes from the diff view - Merge adjacent skip blocks and no-change hunks into a single "Show N unchanged lines" section - Count changes by reviewable sections (hunks) instead of individual lines - Reject All now marks all hunks as rejected instead of clearing to pending - Strengthen system prompt to preserve unchanged text verbatim Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * docs: add inline suggestion mode design spec Spec for replacing the separate ProposedChangesCard with inline TipTap decorations rendered directly in the policy editor. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(policy-editor): add inline suggestion types, position map, and range computation Add shared types for inline suggestions (DiffSegment, SuggestionRange, PositionMap), a position map builder that maps ProseMirror doc nodes to markdown line numbers, and a suggestion range computer that diffs markdown and produces positioned ranges with word-level diff segments. Includes comprehensive tests for both modules. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(editor): add SuggestionsExtension and thread props through editor chain Add TipTap ProseMirror plugin for inline suggestion decorations (modify, insert, delete) with gutter widgets for accept/reject/feedback actions. Extend Editor, AdvancedEditor, and PolicyEditor with additionalExtensions and onEditorReady props. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(policy-editor): integrate inline suggestions into PolicyDetails Replace ProposedChangesCard with inline editor suggestions using useSuggestions hook and SuggestionsTopBar. Remove diff/patch utility functions (createGitPatch, applySelectedHunks, convertContentToMarkdown) that are no longer needed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor(suggestions): remove ProposedChangesCard and unused utilities Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * test(suggestions): add unit tests for useSuggestions hook Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(suggestions): add remaining inline suggestion files Add useSuggestions hook, SuggestionsTopBar component, suggestion CSS styles, implementation plan doc, and fix PolicyDetails tests for new inline suggestions dependencies. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(suggestions): cursor-style navigation, bolder styling, render new sections as rich content - add prev/next navigation with keyboard shortcuts (F7/Shift+F7) - accept/reject current change from top bar (Cmd+Shift+Enter/Backspace) - focused change highlighting with extra emphasis - render new section widgets as proper DOM nodes (headings, lists, paragraphs) instead of raw markdown text - bolder red/green diff colors with underlines and strikethroughs - dark mode support for suggestion styles - add left padding to editor when suggestions active for gutter visibility Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(suggestions): rewrite decoration building to walk document tree The previous approach used character offsets from diff segments as ProseMirror positions, but PM positions include structural tokens (open/close tags for blocks), so positions diverged for multi-block hunks. Decorations were created but not rendered. New approach: - Use doc.descendants() to find text blocks overlapping each range - Apply Decoration.node() to each block individually (always works) - Only attempt inline word-level diffs for single-block modifications - Render new section widgets using DOMSerializer for proper styling Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(suggestions): lock editor during review, fix gutter placement - Make editor non-editable while suggestions are pending via ProseMirror editable prop — prevents content changes during review - Place gutter widgets inside the first text block of each range (pos + 1) so they render correctly for list items and nested blocks Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(suggestions): remove left margin, show modify as green+red pair - Remove has-suggestions padding that pushed content right - Gutter buttons now inline (no absolute positioning/margin needed) - Modify hunks now show as green block (proposed) above red strikethrough block (original) — making it clear they're one change - Accepting replaces old (red) with new (green) - Remove unused suggestion-modified class Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(suggestions): fix bold text in new sections, place widgets at top level - Reset font-weight to normal in .suggestion-new-section so only headings inside are bold, not body text and list items - Place insertion widgets and gutter buttons at depth-1 (doc child) position so they render outside nested structures (lists, blockquotes) and don't inherit parent element styling Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(suggestions): merge overlapping ranges, remove inline gutter buttons - Merge overlapping/adjacent hunks that resolve to the same doc position into a single modify range — prevents duplicate button sets - Remove inline gutter buttons entirely — accept/reject is handled by the sticky top bar with navigation (cleaner, no layout issues) - Remove gutter CSS and callback plumbing (no longer needed) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore(suggestions): clean up unused extension options Remove onAccept/onReject/onFeedback from SuggestionsExtensionOptions since accept/reject is handled entirely by the top bar. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(suggestions): auto-scroll to first change when suggestions arrive Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(suggestions): enhance suggestions functionality with action bars and improved UI - Introduced action bars for accepting, rejecting, and providing feedback on suggestions. - Updated the suggestions top bar for better navigation and user interaction. - Enhanced styling for suggestion elements, including new CSS for action buttons and suggestion groups. - Improved the logic for scrolling to the first change and handling suggestion states. - Added support for showing/hiding toolbars based on suggestion activity. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(suggestions): enhance policy editor with feedback input and improved suggestion handling - Added a new SuggestionFeedbackInput component for inline feedback on suggestions. - Updated PolicyContentManager to handle editing and feedback submission for suggestions. - Enhanced useSuggestions hook to manage editing state and loading indicators. - Improved buildPositionMap and computeSuggestionRanges functions for better handling of list items and content normalization. - Updated styles for suggestion elements to improve user experience. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: resolve merge conflicts and clean up imports - Fix @comp/ui → @trycompai/ui import paths after merge - Remove duplicate @trycompai/email entries in tsconfig.json - Suppress Node.js deprecation warnings in dev script Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat(policy-editor): enhance AI assistant and suggestions functionality - Adjusted media query for wide desktop view to 1280px. - Integrated stop functionality for AI assistant chat. - Improved layout for AI assistant and suggestions top bar. - Enhanced scrolling behavior for suggestion ranges. - Added history tracking for suggestion ranges to support undo functionality. - Updated markdown parsing to ensure accurate rendering of proposed content. This update aims to improve user experience in the policy editor by refining the AI assistant's interaction and enhancing the suggestions management system. * feat(policy-editor): improve suggestion system, chat UX, and RBAC - Rewrite buildPositionMap with two-pass approach for accurate line-to-position mapping - Extend delete ranges to next heading boundary for full section deletions - Merge adjacent diff hunks within 20 positions to prevent split deletions - Use single markdown parser (markdownToTipTapJSON) for both preview and accept - Move AI tools from direct DB access to API calls with cookie forwarding for RBAC - Strip previous proposePolicy content from conversation history to prevent reuse - Add multi-step tool calling with stopWhen(stepCountIs(5)) - Add thinking indicator, stop button, and tool loading states to chat UI - User messages render as right-aligned bubbles, compact tool cards - Auto-dismiss proposals on active→inactive transition - Undo support: Cmd+Z restores previous suggestion ranges - Lock editor during pending suggestions, restore original editable state - Side panel: sticky positioning, viewport-relative height, internal scroll - Editor bottom shadow instead of border for visual end marker - Comprehensive tests: 82 tests for position mapping and range computation, 27 tests for markdown parser, 55 tests for suggestion hook lifecycle Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Mariano Fuentes <marfuen98@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
apps/app/src/app/(app)/[orgId]/policies/[policyId]/editor/components/PolicyDetails.tsx
Show resolved
Hide resolved
- Introduced a new API endpoint for editing specific sections of policy suggestions, allowing users to submit feedback and receive updated text. - Refactored the `useSuggestions` hook to handle feedback submission directly via the new API, removing the previous callback mechanism. - Updated `PolicyContentManager` to utilize the new feedback handling logic, improving the user experience when providing suggestions. - Enhanced tests for the `useSuggestions` hook to cover the new feedback functionality and ensure robust behavior. This update aims to streamline the feedback process in the policy editor, making it more intuitive and efficient for users. Co-authored-by: Mariano Fuentes <marfuen98@gmail.com>
|
|
||
| const roleCounts = new Map<string, number>(); | ||
| for (const user of users) { | ||
| const role = user.role ?? 'UNKNOWN'; |
There was a problem hiding this comment.
Role Discovery / Sync Mismatch for Roleless Users
Medium Severity
In discoverRoles, Ramp users whose role is null/undefined are counted under the synthetic key 'UNKNOWN' — so 'UNKNOWN' appears in the UI as a configurable role. During actual sync in syncRampEmployeesInner, those same users are looked up in roleMappingLookup with the key '' (empty string) because rampUser.role ?? '' is used. Since no mapping entry has the key '', the lookup always falls back to 'employee', silently ignoring whatever the user mapped 'UNKNOWN' to.
Additional Locations (1)
…2326) - Add InlineEditBubble component using TipTap BubbleMenu - Select text → click "AI Edit" → type instruction → Cmd+Enter - Converts selection to markdown preserving structure (headings, bullets) - AI edits just the selected content via /api/policies/:id/edit-section - Replaces at top-level block boundaries for clean insertion - Selection stays highlighted when clicking AI Edit - Disabled when suggestion decorations are active - Unit tests for markdown conversion logic (10 tests) Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
There are 5 total unresolved issues (including 3 from previous reviews).
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| TableHead, | ||
| TableHeader, | ||
| TableRow, | ||
| Button, |
There was a problem hiding this comment.
Unused import and hook value in people component
Low Severity
Button is newly added to the import from @trycompai/design-system and openRoleMappingEditor is destructured from useEmployeeSync, but neither is referenced anywhere else in the file. The wrapping flex items-center gap-2 container added to the sync area strongly suggests a "Configure Role Mapping" button was intended here but was never rendered, leaving dead imports and an orphaned hook value.
Additional Locations (1)
| import { db, type Prisma } from '@db'; | ||
| import type { RoleMappingEntry } from '@trycompai/integration-platform'; | ||
|
|
||
| const BUILT_IN_ROLES = ['owner', 'admin', 'auditor', 'employee', 'contractor']; |
There was a problem hiding this comment.
Unused constant dead code in mapping service
Low Severity
BUILT_IN_ROLES is declared but never referenced anywhere in ramp-role-mapping.service.ts. The actual built-in role logic is handled via DEFAULT_BUILT_IN_MAPPINGS and the isBuiltIn flag on mapping entries. This orphaned constant creates a misleading impression that it's used to filter or validate roles somewhere in the service.
|
🎉 This PR is included in version 3.8.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |


This is an automated pull request to release the candidate branch into production, which will trigger a deployment.
It was created by the [Production PR] action.