-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: add ability to set custom comment content #15
Conversation
'| File Patterns | Mentions |', | ||
'| - | - |\n' | ||
].join('\n') | ||
export const HEADER = '<!-- codemention header -->' |
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.
This is probably an extremely nitpicky thing, but I believe this comment header will no longer have a newline character separating it from the content afterwards. It probably doesn't make a difference when the content is rendered, but I do prefer a newline afterwards.
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 catch! Removing this is a hypothesis about what is responsible for the extra newline behavior we were seeing in the iOS notification:
It doesn't seem to affect the comment on the web, just the one in a notification.
Let me know what you think.
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.
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.
In that case, then I think it makes sense to not have the newline after the comment.
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.
Actually, after merging and testing this, it looks like the link doesn't render correctly on tobyhs/codemention-test#8 (comment)
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.
Hmm. Yep, definitely something up. Feel free to revert and I'll test more tomorrow and find a fix!
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.
Fix: #16
(going to move the header into a footer to fix both issues in a follow-up)
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.
lgtm
'| File Patterns | Mentions |', | ||
'| - | - |\n' | ||
].join('\n') | ||
export const HEADER = '<!-- codemention header -->' |
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.
In that case, then I think it makes sense to not have the newline after the comment.
Why
For mobile notifications that have limited space, the default comment content doesn't optimize for information density. This PR allows overriding the default attribution link. Attribution to the original repo is useful, though, so this PR also allows supplying a custom footer so one can specify the attribution to be posted there (maybe even link to the action itself) (we do something like this in the expo github action: https://github.com/expo/expo-github-action/blob/8108b8660bffafbf7b8132b1b108219f2269f2a0/src/actions/preview.ts#L207)
How
Add configuration value to allow overriding the default preamble and epilogue of the comment content.
Test Plan
Run all tests (updated to test this configuration).