Skip to content

Conversation

@milos-dukic
Copy link
Contributor

This is the PR for #103

  • Readme updated.
  • Env MAX_ATTACHMENT_SIZE_IN_BYTES added
  • Helpers for checking MAX_ATTACHMENT_SIZE_IN_BYTES added
  • UI updated - when the limit is exceeded there is a notice below the input, for 2 seconds, after which it disappears
  • BE message model updated with new validation
  • Tests added

Preview:
example

@milos-dukic milos-dukic changed the title [Feature - Max Attachment Size] - UI check and notice implemented. BE validation added. ENV added. Tests added. Readme updated. [Feature - Max Attachment Size] - UI check and notice implemented. BE validation, ENV variable, tests added. Readme updated. Nov 29, 2025
@milos-dukic milos-dukic force-pushed the feature-max-attachment-size branch from 5626e6d to 562679e Compare December 3, 2025 09:19
… validation added. ENV added. Tests added. Readme updated.
@milos-dukic milos-dukic force-pushed the feature-max-attachment-size branch from 562679e to 7daf51b Compare December 22, 2025 15:19
</div>
</fieldset>

<div class="composer-notice" data-composer-target="attachmentNotice">File exceeds max attachment size (<%= max_attachment_size_in_bytes %> bytes)</div>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that a regular user who reads an error message about a max size in bytes will not understand what the limit is and the error message will leave them wondering, I find it much more intuitive for the error message to be in megabytes (MB). Megabytes is something that most users understand, and the file limit that most sysadminds would choose, will also be in megabytes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, but size in MBs is rounded(when you try to inspect/view file properties), while in bytes it isn't, and that can be a bit confusing, bytes are more precise.

padding: var(--block-space-half) calc(var(--inline-space) + 1vw);
}

.composer-notice {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the screenshot preview, I think it would be better (In terms of UI) for the error message to be a little further from the message/input box (eg. a margin-top of a couple of pixels or similar).

Copy link
Contributor Author

@milos-dukic milos-dukic Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the problem is that input element for texting, is stand-alone component i.e. external library, so that is the reason I put it below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants