Examples
Code Review
Complete task payload from the RobotRock dashboard Examples gallery. Open Examples in your workspace to interact with the same task in the inbox UI.
Inbox preview
Rendered by the dashboard (static preview route). Matches docs light/dark mode. Handle actions are disabled; use the toolbar to submit this example to your inbox or view its configuration.
Task
{
"type": "code-review",
"name": "Pull Request: Feature Implementation",
"description": "This PR implements a new authentication feature with JWT tokens. Review this code submission and provide feedback"
}Context
{
"data": {
"code": "import jwt from 'jsonwebtoken';\n \nexport function generateToken(userId: string): string {\n- return jwt.sign({ userId }, process.env.JWT_SECRET, { expiresIn: '24h' });\n+ const secret = process.env.JWT_SECRET;\n+ if (!secret) {\n+ throw new Error('JWT_SECRET is not defined');\n+ }\n+ \n+ return jwt.sign(\n+ { userId, iat: Math.floor(Date.now() / 1000) },\n+ secret,\n+ { expiresIn: '24h' }\n+ );\n}\n \nexport function verifyToken(token: string): { userId: string } {\n- return jwt.verify(token, process.env.JWT_SECRET) as { userId: string };\n+ const secret = process.env.JWT_SECRET;\n+ if (!secret) {\n+ throw new Error('JWT_SECRET is not defined');\n+ }\n+ \n+ return jwt.verify(token, secret) as { userId: string };\n}",
"prMetadata": {
"author": "developer@example.com",
"repository": "backend-api",
"branch": "feature/jwt-auth",
"prNumber": "#1234",
"filesChanged": 5,
"linesAdded": 234,
"linesRemoved": 12,
"breakingChanges": false
}
},
"ui": {
"code": {
"ui:title": "/src/auth/jwt.ts",
"ui:widget": "code",
"ui:options": {
"language": "diff"
}
},
"prMetadata": {
"ui:title": "PR Metadata",
"items": {
"prNumber": {
"ui:title": "PR Number"
},
"filesChanged": {
"ui:title": "Files Changed"
},
"linesAdded": {
"ui:title": "Lines Added"
},
"linesRemoved": {
"ui:title": "Lines Removed"
},
"breakingChanges": {
"ui:title": "Breaking Changes"
}
}
}
}
}Actions
[
{
"title": "Approve Code",
"description": "Approve this code submission",
"id": "approve",
"schema": {
"type": "object",
"properties": {
"review-notes": {
"type": "string",
"title": "Review Notes"
}
}
},
"ui": {
"review-notes": {
"ui:widget": "textarea",
"ui:placeholder": "Enter review notes..."
}
}
},
{
"title": "Request Changes",
"description": "Request changes before approval",
"id": "request-changes",
"schema": {
"type": "object",
"required": [
"change-request",
"priority"
],
"properties": {
"change-request": {
"type": "string",
"title": "Change Request",
"description": "Describe the changes needed"
},
"priority": {
"type": "string",
"title": "Change Priority",
"description": "What is the priority of these changes?",
"enum": [
"critical",
"high",
"medium",
"low"
],
"enumNames": [
"Critical - Must fix before merge",
"High - Should fix before merge",
"Medium - Nice to have",
"Low - Optional improvements"
]
}
}
},
"ui": {
"change-request": {
"ui:widget": "textarea",
"ui:placeholder": "Enter requested changes..."
},
"priority": {
"ui:widget": "radio"
}
}
}
]Widgets used
coderadiotextarea
See Context for widget reference.