chore: remove unused imghdr import and dead CSS rules, fix attachment uploader DOM structure, add space after icon spans in templates, and increase test stderr capture limit

This commit is contained in:
2026-05-13 20:48:39 +00:00
parent 4958c23c0d
commit 1c5406204e
11 changed files with 23 additions and 16 deletions
-1
View File
@@ -46,7 +46,6 @@ async def create_post(request: Request):
if len(content_bytes) > 5 * 1024 * 1024:
logger.warning(f"Image too large: {image_file.filename}")
else:
import imghdr
ext = Path(image_file.filename).suffix.lower()
allowed = {".png", ".jpg", ".jpeg", ".gif", ".webp", ".svg"}
if ext not in allowed:
-4
View File
@@ -23,10 +23,6 @@
background: var(--accent-light);
}
.attachment-upload-container button.attachment-upload-btn input[type="file"] {
display: none;
}
.attachment-upload-container button.attachment-upload-btn.uploading {
pointer-events: none;
opacity: 0.6;
-3
View File
@@ -667,9 +667,6 @@ img {
padding-top: 0;
}
.page-messages .messages-layout {
margin-top: calc(var(--nav-height) + 1rem);
}
.modal-overlay {
display: none;
+2
View File
@@ -439,6 +439,8 @@ class Application {
if (parent) {
const actions = parent.querySelector(".comment-form-actions");
if (actions) {
actions.style.position = "relative";
actions.appendChild(picker.wrapper);
actions.insertBefore(btn, actions.firstChild);
}
}
+2 -1
View File
@@ -21,8 +21,8 @@ class AttachmentUploader {
const input = document.createElement("input");
input.type = "file";
input.multiple = true;
input.style.display = "none";
input.addEventListener("change", () => this.handleFiles(input.files));
this.button.appendChild(input);
this.button.addEventListener("click", (e) => {
e.preventDefault();
@@ -48,6 +48,7 @@ class AttachmentUploader {
this.errorEl.className = "attachment-upload-error";
this.container.appendChild(this.button);
this.container.appendChild(input);
this.container.after(this.errorEl);
this.container.after(this.previewList);
+1 -1
View File
@@ -111,7 +111,7 @@
<div class="footer-inner">
<span class="footer-copy">&copy; DevPlace</span>
<nav class="footer-links">
<a href="/bugs"><span class="icon">🐛</span>Bug Report</a>
<a href="/bugs"><span class="icon">🐛</span> Bug Report</a>
</nav>
</div>
</footer>
+2 -2
View File
@@ -68,7 +68,7 @@
<div class="bugs-header">
<h1>Bug Reports</h1>
{% if user %}
<button class="btn btn-primary btn-sm" data-modal="create-bug-modal"><span class="icon">&#x1F41B;</span>Report Bug</button>
<button class="btn btn-primary btn-sm" data-modal="create-bug-modal"><span class="icon">&#x1F41B;</span> Report Bug</button>
{% endif %}
</div>
@@ -119,7 +119,7 @@
{% include "_attachment_form.html" %}
<div style="display: flex; gap: 0.75rem; justify-content: flex-end;">
<button type="button" class="modal-close btn btn-secondary">Cancel</button>
<button type="submit" class="btn btn-primary"><span class="icon">&#x1F4E4;</span>Submit Report</button>
<button type="submit" class="btn btn-primary"><span class="icon">&#x1F4E4;</span> Submit Report</button>
</div>
</form>
</div>
+1 -1
View File
@@ -122,7 +122,7 @@
<a href="/projects"><span class="icon">&#x1F680;</span>Projects</a>
<a href="/auth/login"><span class="icon">&#x1F511;</span>Login</a>
<a href="/auth/signup"><span class="icon">&#x2728;</span>Sign Up</a>
<a href="/bugs"><span class="icon">&#x1F41B;</span>Bug Report</a>
<a href="/bugs"><span class="icon">&#x1F41B;</span> Bug Report</a>
</div>
</footer>
</div>