-
Notifications
You must be signed in to change notification settings - Fork 0
Added size warning to email preview #13
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
base: copilot_only-issues-20260113-qodo-grep-copilot_base_added_size_warning_to_email_preview_pr104
Are you sure you want to change the base?
Changes from all commits
658b4fe
459a02d
3b620b4
8583213
35d1aca
579b091
3ebfed0
53789e0
54435fc
c1f1680
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,22 @@ | ||
| {{#if this.isEnabled}} | ||
| {{! Watch for post.updatedAt changes to trigger recalculation after saves }} | ||
| <span {{did-update this.checkEmailSize @post.updatedAtUTC}} class="gh-editor-email-size-warning-container"> | ||
| <span class="gh-editor-email-size-warning gh-editor-email-size-warning--{{this.warningLevel}}" data-warning-active={{if this.warningLevel "true" "false"}}> | ||
| {{#if this.warningLevel}} | ||
| <span class="{{concat "gh-editor-email-warning-icon-" this.warningLevel}}"> | ||
| {{#if (has-block)}} | ||
| <div> | ||
| {{yield this.overLimit this.emailSizeKb}} | ||
| </div> | ||
| {{else}} | ||
| <span {{did-update this.checkEmailSize @post.updatedAtUTC}} class="gh-editor-email-size-warning-container"> | ||
| <span class="gh-editor-email-size-warning gh-editor-email-size-warning--{{this.overLimit}}" data-warning-active={{if this.overLimit "true" "false"}}> | ||
| {{#if this.overLimit}} | ||
| {{svg-jar "email-warning"}} | ||
| </span> | ||
| {{/if}} | ||
| </span> | ||
| {{#if this.overLimit}} | ||
| <div class="gh-editor-email-size-popup"> | ||
| <div class="gh-editor-email-size-popup-title">Looks like this is a long post</div> | ||
| <div class="gh-editor-email-size-popup-text">Emails may get clipped in the inbox behind a "View entire message" link when they're over 100kB.</div> | ||
| <div class="gh-editor-email-size-popup-used">You've used: <span class="yellow">{{this.emailSizeKb}}kB</span></div> | ||
| </div> | ||
| {{/if}} | ||
| </span> | ||
| {{#if this.warningLevel}} | ||
| <div class="gh-editor-email-size-popup"> | ||
| <div class="gh-editor-email-size-popup-title">Looks like this is a long post</div> | ||
| <div class="gh-editor-email-size-popup-text">Email newsletters may get cut off in the inbox behind a "View entire message" link when they're over 100kB.</div> | ||
| <div class="gh-editor-email-size-popup-used">You've used: <span class={{this.warningLevel}}>{{this.emailSizeKb}}kB</span></div> | ||
| </div> | ||
| {{/if}} | ||
| </span> | ||
| {{/if}} | ||
| {{/if}} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -88,6 +88,17 @@ | |
| /> | ||
| </form> | ||
| </div> | ||
| <Editor::EmailSizeWarning @post={{@post}} as |overLimit emailSizeKb| > | ||
| {{#if overLimit}} | ||
| <div class="gh-email-preview-clip-container"> | ||
| {{svg-jar "email-warning"}} | ||
| <div> | ||
| <div class="gh-email-preview-clip-title">This email is <span class="yellow-d1">{{emailSizeKb}}kB</span></div> | ||
|
||
| <div class="gh-email-preview-clip-description">Emails may get clipped in the inbox behind a “View entire message” link when they’re over 100kB.</div> | ||
| </div> | ||
| </div> | ||
| {{/if}} | ||
| </Editor::EmailSizeWarning> | ||
| <iframe | ||
| class="gh-pe-iframe" | ||
| title="Email preview" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -284,3 +284,44 @@ p .gh-preview-email-address { | |
| display: none | ||
| } | ||
| } | ||
|
|
||
| .gh-email-preview-clip-container { | ||
| display: flex; | ||
| background-color: var(--whitegrey-l2); | ||
| border-bottom: 1px solid var(--whitegrey); | ||
| padding: 20px; | ||
| gap: 12px; | ||
| align-items: flex-start; | ||
| } | ||
|
|
||
| .gh-email-preview-clip-container svg { | ||
| margin-top: 3px; | ||
| width: 16px; | ||
| min-width: 16px; | ||
| height: auto; | ||
| } | ||
|
|
||
| .gh-email-preview-clip-container svg path { | ||
| stroke: var(--yellow-d1); | ||
| } | ||
|
|
||
| .gh-email-preview-clip-title { | ||
| font-weight: 600; | ||
| font-size: 1.4rem; | ||
| color: var(--black); | ||
| } | ||
|
|
||
| .gh-email-preview-clip-title.mb { | ||
| margin-bottom: 4px; | ||
| } | ||
|
|
||
| .gh-email-preview-clip-description { | ||
| font-size: 1.3rem; | ||
| text-wrap: pretty; | ||
| color: var(--middarkgrey) | ||
|
||
| } | ||
|
|
||
| .gh-email-preview-clip-used { | ||
| font-size: 1.3rem; | ||
| font-weight: 600; | ||
| } | ||
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.
The class
gh-editor-email-size-warning--{{this.overLimit}}will producegh-editor-email-size-warning--trueorgh-editor-email-size-warning--false. This differs from the previous implementation which used specific warning levels like 'yellow' or 'red'. Ensure corresponding CSS exists for these boolean-based class names, or consider using a more semantic class name.