-
Notifications
You must be signed in to change notification settings - Fork 712
Add Markdown rendering for commit messages #10638
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Co-authored-by: Byron <[email protected]>
164bc93 to
28fcbf3
Compare
|
This PR was motivated by #10634 . My apologies in advance if the code is offensive, but AI slop aside, would markdown rendering for commits be a feature we want @PavelLaptev @estib-vega and CC @krlvi?
This PR obviously is less than a prototype, and more like a previsualization, knowing that code blocks apparently don't work, and there definitely would be a need to see the original text by some means in case it's botched or needs to be copied. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, let's do it.
We should keep an eye on performance impact to see if e.g. a lot of commits start to slow down rendering though.
Otherwise the change is sound
|
It would be nice also if when you double-click on the text area containing the commit message (whether it's only showing the abbreviated form or the full form) to automatically enter edit mode. This would make it easier/faster to edit or to copy the raw commit message including the markdown tags. |
|
Thanks for taking a look! Indeed, the changes needed to truly get this to work would be bigger, in the sense that some of the markdown has to be toned down to not be overbearing. Let's see how far we can push it. |
|
@copilot Make sure the headers in Markdown are only printed with slightly larger than normal text, to not dominate the whole user interface. |
|
@Byron I’m afraid Copilot might mess with the styles, so this probably needs some manual work. |
|
This is fine either way from a product perspective. Cant comment on the code itself tho |
- Markdown now only renders when "Show original wrapping" is disabled - When "Show original wrapping" is enabled, displays plain text with original formatting - Header sizes (h1-h4) reduced to 1.1em to not dominate the UI - Headers in titles inherit parent font size and display inline Co-authored-by: Byron <[email protected]>
Headers are now toned down to 1.1em (slightly larger than normal text) to maintain hierarchy without dominating the UI. Additionally, markdown only renders when "Rewrap message" is enabled - when "Show original wrapping" is selected, plain text is displayed instead. Commit: 28fcbf3 |
|
Apologies, I didn't want to force a feature (and the work) on anyone so I thought Copilot could one-shot its way to something that fulfils the requirement, before being cleaned up by a human 😅. In any case, after testing this it turned out to be surprisingly usable, and even disabling markdown works already. Screen.Recording.2025-10-14.at.16.33.05.movSo maybe it's ready to be cleaned up and it's a feature then? |
|
FWIW I have a feeling that Claude Code is better at one shot-ing solutions than Copilot - but requires more babysitting |
|
@Byron, no worries. The PR is not bad, just needs, as Kiril said, "babysitting". |
|
Thanks @PavelLaptev, appreciated!
I'd love to be able to control this, but my quick-and-easy AI-"gun" doesn't seem to have this setting yet.
It's not even clear to me which Model is used in this PR 😅. |
|
I am posting here as it's my most recent memory about markdown rendering. While wondering if we already have code that adjusts header heights to match the overall design, I did notice that somehow all margins got lost in the markdown view of the branch listing. CC @PavelLaptev if there is an easy fix.
|
|
Closed in favor of #10798 . |





Overview
This PR enables Markdown rendering for commit message titles and bodies in the desktop app, matching the behavior of PR descriptions in the web app.
Markdown rendering is only active when "Rewrap message" mode is enabled (the default). When users select "Show original wrapping," commit messages display as plain text with original formatting preserved.
Changes
Commit messages now support rich text formatting including:
codespansImplementation
CommitTitle.svelte
MarkdownContentcomponent from@gitbutler/uiusing themarkedlexerrewrapprop is true<h3>tags)CommitDetails.svelte
Markdowncomponent from@gitbutler/uifor full block-level markdown supportrewrapprop is true; otherwise displays plain text withwhite-space: pre-line<p>to<div>to properly accommodate block elementsCommitView.svelte & UnappliedCommitView.svelte
rewrap={$rewrapCommitMessage}prop toCommitTitleto control markdown renderingConsistency
This implementation reuses the same Markdown rendering components already used in the web app for PR descriptions and chat messages, ensuring a consistent user experience across the application.
Preserved Functionality
All existing features continue to work as expected:
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.