Skip to content

markdown widget#1433

Merged
gugu merged 2 commits into
mainfrom
markdown-widget
Nov 14, 2025
Merged

markdown widget#1433
gugu merged 2 commits into
mainfrom
markdown-widget

Conversation

@gugu

@gugu gugu commented Nov 14, 2025

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings November 14, 2025 11:57
@gugu gugu enabled auto-merge (squash) November 14, 2025 11:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 adds a new Markdown widget that enables markdown rendering and editing capabilities across table display, record view, and record edit contexts. The implementation uses ngx-markdown for rendering and the Monaco-based code editor for editing with syntax highlighting.

Key Changes

  • Added three markdown field components: display (for tables), view (for record detail), and edit (for record editing)
  • Integrated markdown components into the widget registry for all three contexts
  • Implemented truncation logic for table display to handle long markdown content

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
frontend/src/app/consts/table-display-types.ts Registers MarkdownDisplayComponent in the table display widget registry
frontend/src/app/consts/record-view-types.ts Registers MarkdownRecordViewComponent in the record view widget registry
frontend/src/app/consts/record-edit-types.ts Registers MarkdownEditComponent in the record edit widget registry
frontend/src/app/components/ui-components/table-display-fields/markdown/markdown.component.ts Implements table display with truncation and copy-to-clipboard functionality
frontend/src/app/components/ui-components/table-display-fields/markdown/markdown.component.spec.ts Basic component creation test for table display
frontend/src/app/components/ui-components/table-display-fields/markdown/markdown.component.html Template with markdown rendering, tooltip, and copy button
frontend/src/app/components/ui-components/table-display-fields/markdown/markdown.component.css Styling for inline table display with ellipsis
frontend/src/app/components/ui-components/record-view-fields/markdown/markdown.component.ts Implements read-only markdown rendering for record detail view
frontend/src/app/components/ui-components/record-view-fields/markdown/markdown.component.spec.ts Basic component creation test for record view
frontend/src/app/components/ui-components/record-view-fields/markdown/markdown.component.html Template for full markdown rendering in record view
frontend/src/app/components/ui-components/record-view-fields/markdown/markdown.component.css Styling for record view with proper markdown element spacing
frontend/src/app/components/ui-components/record-edit-fields/markdown/markdown.component.ts Implements Monaco-based markdown editor with theme support
frontend/src/app/components/ui-components/record-edit-fields/markdown/markdown.component.spec.ts Basic component creation test for edit component
frontend/src/app/components/ui-components/record-edit-fields/markdown/markdown.component.html Template for code editor with markdown syntax highlighting
frontend/src/app/components/ui-components/record-edit-fields/markdown/markdown.component.css Styling for code editor container
frontend/src/app/components/dashboard/db-table-view/db-table-widgets/db-table-widgets.component.ts Imports MarkdownEditComponent and adds placeholder widget settings

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +14 to +18
public renderedMarkdown: string = '';

ngOnInit(): void {
this.renderedMarkdown = this.value || '';
}

Copilot AI Nov 14, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The renderedMarkdown property is unnecessary as it's just a copy of this.value. Consider using value directly in the template: <markdown [data]="value || ''"></markdown>. This simplifies the code and removes unnecessary state management.

Suggested change
public renderedMarkdown: string = '';
ngOnInit(): void {
this.renderedMarkdown = this.value || '';
}

Copilot uses AI. Check for mistakes.
Comment on lines +10 to +15
@Component({
selector: 'app-markdown-display',
templateUrl: './markdown.component.html',
styleUrls: ['../base-table-display-field/base-table-display-field.component.css', './markdown.component.css'],
imports: [CommonModule, MarkdownModule, ClipboardModule, MatIconModule, MatButtonModule, MatTooltipModule]
})

Copilot AI Nov 14, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The @Injectable() decorator is missing. Other similar table display components (e.g., TextDisplayComponent, LongTextDisplayComponent) use this decorator. Add @Injectable() above the @Component decorator for consistency.

Copilot uses AI. Check for mistakes.
Comment on lines +17 to +21
public renderedMarkdown: string = '';
public truncatedValue: string = '';

ngOnInit(): void {
this.renderedMarkdown = this.value || '';

Copilot AI Nov 14, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The renderedMarkdown property is initialized but never used. The template uses truncatedValue instead. Consider removing this unused property.

Suggested change
public renderedMarkdown: string = '';
public truncatedValue: string = '';
ngOnInit(): void {
this.renderedMarkdown = this.value || '';
public truncatedValue: string = '';
ngOnInit(): void {

Copilot uses AI. Check for mistakes.
@gugu gugu merged commit 9ab217b into main Nov 14, 2025
13 checks passed
@gugu gugu deleted the markdown-widget branch November 14, 2025 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants