-
Notifications
You must be signed in to change notification settings - Fork 3.8k
feat(dashboards): embed live dashboard panels in markdown #8527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6d54f88
feat(dashboards): embed live dashboard panels in markdown
TheodoreSpeaks b42e3f3
improvement(dashboards): lazy-load markdown dashboard embeds
TheodoreSpeaks 6b4f7bd
fix(dashboards): address review on chart annotations and embed refresh
TheodoreSpeaks 2281a12
fix(dashboards): re-anchor reset embeds and cover the collab placehol…
TheodoreSpeaks 2b0d291
fix(dashboards): scope live refresh to each embed and place the chart…
TheodoreSpeaks File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...kspaceId]/files/components/file-viewer/rich-markdown-editor/markdown-streaming-context.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| import { createContext } from 'react' | ||
|
|
||
| /** True while agent output is streaming into the editor, for node views that render its content. */ | ||
| export const MarkdownStreamingContext = createContext(false) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...spaceId]/files/components/file-viewer/rich-markdown-editor/slash-command/commands.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| /** | ||
| * @vitest-environment jsdom | ||
| */ | ||
| import { Editor } from '@tiptap/core' | ||
| import { describe, expect, it } from 'vitest' | ||
| import { createMarkdownEditorExtensions } from '@/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/editor-extensions' | ||
| import { SLASH_COMMANDS } from '@/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/slash-command/commands' | ||
|
|
||
| const chart = SLASH_COMMANDS.find((command) => command.title === 'Chart') | ||
|
|
||
| describe('Chart slash command', () => { | ||
| it.each([ | ||
| ['an empty paragraph', '<p>/chart</p>'], | ||
| ['the end of existing text', '<p>Intro /chart</p>'], | ||
| ])('puts the caret at the start of the starter fence from %s', (_, content) => { | ||
| const editor = new Editor({ | ||
| extensions: createMarkdownEditorExtensions({ placeholder: '' }), | ||
| content, | ||
| }) | ||
| const end = editor.state.doc.content.size - 1 | ||
| const from = editor.state.doc.textBetween(0, end).indexOf('/') + 1 | ||
| chart?.run({ editor, range: { from, to: end } }) | ||
| const { $from } = editor.state.selection | ||
| expect($from.parent.type.name).toBe('codeBlock') | ||
| expect($from.parent.attrs.language).toBe('dashboard') | ||
| expect($from.parentOffset).toBe(0) | ||
| editor.destroy() | ||
| }) | ||
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.