Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

refactor: improve markdown rendering on notifications (cherry-pick #17112)#17197

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
stirby merged 1 commit intorelease/2.21fromcherry-pick-e15a3b-release/2.21
Apr 1, 2025
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletionssite/package.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -140,6 +140,7 @@
"@storybook/test": "8.4.6",
"@swc/core": "1.3.38",
"@swc/jest": "0.2.37",
"@tailwindcss/typography": "0.5.16",
"@testing-library/jest-dom": "6.6.3",
"@testing-library/react": "14.3.1",
"@testing-library/react-hooks": "8.0.1",
Expand Down
39 changes: 36 additions & 3 deletionssite/pnpm-lock.yaml
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -53,7 +53,14 @@ export const Markdown: Story = {
notification: {
...MockNotification,
read_at: null,
content: "Hello **world**!",
content:
"Template **Write Coder on Coder with AI** has failed to build 1/33 times over the last week.\n\n**Report:**\n\n**sweet_cannon7** failed 1 time:\n\n* [edward / coder-on-coder-claude / #34](https://dev.coder.com/@edward/coder-on-coder-claude/builds/34)\n\nWe recommend reviewing these issues to ensure future builds are successful.",
actions: [
{
label: "View workspaces",
url: "https://dev.coder.com/workspaces?filter=template%3Acoder-with-ai",
},
],
},
},
};
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
import type { InboxNotification } from "api/typesGenerated";
import { Avatar } from "components/Avatar/Avatar";
import { Button } from "components/Button/Button";
import { Link } from "components/Link/Link";
import { SquareCheckBig } from "lucide-react";
import type { FC } from "react";
import Markdown from "react-markdown";
Expand DownExpand Up@@ -28,14 +29,16 @@ export const InboxItem: FC<InboxItemProps> = ({
</div>

<div className="flex flex-col gap-3 flex-1">
<span
className={cn([
"text-content-secondary text-sm font-medium whitespace-break-spaces [overflow-wrap:anywhere]",
"[&_p]:m-0",
])}
<Markdown
className="text-content-secondary prose-sm font-medium [overflow-wrap:anywhere]"
components={{
a: ({ node, ...props }) => {
return <Link {...props} />;
},
}}
>
<Markdown>{notification.content}</Markdown>
</span>
{notification.content}
</Markdown>
<div className="flex items-center gap-1">
{notification.actions.map((action) => {
return (
Expand Down
2 changes: 1 addition & 1 deletionsite/tailwind.config.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -75,5 +75,5 @@ module.exports = {
},
},
},
plugins: [require("tailwindcss-animate")],
plugins: [require("tailwindcss-animate"), require("@tailwindcss/typography")],
};
Loading

[8]ページ先頭

©2009-2025 Movatter.jp