Conversation
Signed-off-by: rohan <rohan.chaturvedi@protonmail.com>
Signed-off-by: rohan <rohan.chaturvedi@protonmail.com>
…and description Signed-off-by: rohan <rohan.chaturvedi@protonmail.com>
… app details Signed-off-by: rohan <rohan.chaturvedi@protonmail.com>
Signed-off-by: rohan <rohan.chaturvedi@protonmail.com>
…nts for editing and displaying app descriptions in app settings Signed-off-by: rohan <rohan.chaturvedi@protonmail.com>
Signed-off-by: rohan <rohan.chaturvedi@protonmail.com>
Signed-off-by: rohan <rohan.chaturvedi@protonmail.com>
Signed-off-by: rohan <rohan.chaturvedi@protonmail.com>
Signed-off-by: rohan <rohan.chaturvedi@protonmail.com>
Signed-off-by: Rohan Chaturvedi <rohan.chaturvedi@protonmail.com>
There was a problem hiding this comment.
Pull request overview
This pull request adds markdown-supported app descriptions to the Phase Console, allowing teams to document application requirements, setup instructions, and environment variable context.
Changes:
- Added new React components for viewing and editing markdown descriptions with syntax highlighting
- Created backend mutation and database migration to store app descriptions
- Updated GraphQL schema and queries to include description field
- Integrated description viewer into app dashboard and settings pages
Reviewed changes
Copilot reviewed 22 out of 24 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
frontend/package.json |
Added react-markdown and react-syntax-highlighter dependencies |
frontend/package-lock.json |
Updated lockfile with new dependencies including OpenTelemetry packages from posthog-js upgrade |
frontend/components/common/MarkdownViewer.tsx |
New reusable component for rendering markdown with code syntax highlighting |
frontend/components/apps/AppDescriptionViewer.tsx |
Component displaying truncated description with expandable modal view |
frontend/app/[team]/apps/[app]/settings/_components/AppDescriptionEditor.tsx |
Editor component with Write/Preview tabs for editing descriptions |
frontend/app/[team]/apps/[app]/_components/AppDescription.tsx |
Component integrating description viewer into app dashboard |
backend/api/models.py |
Added description TextField to App model |
backend/api/migrations/0116_app_description.py |
Database migration adding description column |
backend/backend/graphene/mutations/app.py |
New UpdateAppInfoMutation for updating app name and description |
backend/backend/graphene/types.py |
Added description field to AppType GraphQL type |
frontend/graphql/queries/*.gql |
Updated queries to fetch description field |
frontend/apollo/graphql.ts & frontend/apollo/schema.graphql |
Regenerated GraphQL types and schema |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| app.name = name | ||
|
|
||
| if description is not None: |
There was a problem hiding this comment.
Missing validation for description length. Unlike the name field which has a maximum length validation (64 characters), the description field has no length limit. This could potentially allow very large text inputs that may cause performance or storage issues. Consider adding a reasonable maximum length constraint (e.g., 10,000 or 50,000 characters) to prevent abuse.
| if description is not None: | |
| if description is not None: | |
| # Validate description length | |
| if len(description) > 10000: | |
| raise GraphQLError("App description cannot exceed 10000 characters") |
| import { Button } from '@/components/common/Button' | ||
| import { toast } from 'react-toastify' | ||
| import { AppDescriptionEditor } from './_components/AppDescriptionEditor' | ||
| import app from 'next/app' |
There was a problem hiding this comment.
Unused import detected. The app import from 'next/app' is not used anywhere in this file and should be removed.
| import app from 'next/app' |
|
|
||
| interface MarkdownViewerProps { | ||
| text: string | ||
| className?: string | ||
| } | ||
|
|
||
| export const MarkdownViewer = ({ text, className }: MarkdownViewerProps) => { | ||
| const { theme } = useContext(ThemeContext) | ||
|
|
||
| const components = { | ||
| code(props: any) { |
There was a problem hiding this comment.
The any type is used for the props parameter. Consider using proper typing for the code component props. React-markdown provides types for component props that should be used instead of any to improve type safety.
| interface MarkdownViewerProps { | |
| text: string | |
| className?: string | |
| } | |
| export const MarkdownViewer = ({ text, className }: MarkdownViewerProps) => { | |
| const { theme } = useContext(ThemeContext) | |
| const components = { | |
| code(props: any) { | |
| import type { Components } from 'react-markdown' | |
| import type { CodeComponent } from 'react-markdown/lib/ast-to-react' | |
| interface MarkdownViewerProps { | |
| text: string | |
| className?: string | |
| } | |
| type CodeProps = Parameters<CodeComponent>[0] | |
| export const MarkdownViewer = ({ text, className }: MarkdownViewerProps) => { | |
| const { theme } = useContext(ThemeContext) | |
| const components: Components = { | |
| code(props: CodeProps) { |
| )} | ||
| > | ||
| <Avatar serviceAccount={account} size="md" /> | ||
| <Avatar serviceAccount={account!} size="md" /> |
There was a problem hiding this comment.
The non-null assertion operator ! is used here without prior validation. While the GraphQL schema indicates serviceAccounts can contain nullable items (Array<Maybe<ServiceAccountType>>), the code assumes they're non-null. Consider adding a filter to remove null values or handle the potential null case explicitly.
🔍 Overview
This PR introduces the ability for users to add detailed, markdown-supported descriptions to their Apps. This allows teams to document application requirements, setup instructions, useful commands, and environment variable context directly within the Phase Console.
💡 Proposed Changes
New Components
MarkdownViewer: A centralized, reusable component for rendering Markdown.react-syntax-highlighter).JetBrains Monofor code.AppDescriptionViewer: A wrapper component that displays a truncated view of the description with a "Show More" modal for full-screen reading.AppDescriptionEditor: A specialized editor found in App Settings that supports "Write" and "Preview" modes.Pages & Integrations
AppDescriptionEditorto allow users to update the app description.AppDescriptioncomponent to display the documentation at the top of the app view.🖼️ Screenshots or Demo
🎯 Reviewer Focus
Editing Description:
Viewing:
Code Blocks:
json ...).Deep Linking:
*... ```).
Deep Linking:
💚 Did You...