Skip to content

Investigate missing image upload button - #1940

Merged
amirbiron merged 3 commits into
mainfrom
cursor/investigate-missing-image-upload-button-gpt-5.1-codex-high-2251
Dec 3, 2025
Merged

Investigate missing image upload button#1940
amirbiron merged 3 commits into
mainfrom
cursor/investigate-missing-image-upload-button-gpt-5.1-codex-high-2251

Conversation

@amirbiron

@amirbironamirbiron commented Dec 3, 2025

Copy link
Copy Markdown
Owner

✨ תיאור קצר

הכפתור להעלאת תמונות לא הופיע עקב קריאה לפונקציות JS לפני הגדרתן, מה שגרם לשגיאה בטעינה. תיקנתי את סדר הטעינה והוספתי את כל הלוגיקה הנדרשת לניהול תמונות בקבצי Markdown, כולל הצגה, ולידציה, תצוגה מקדימה ומחיקה.

📦 שינויים עיקריים

  • קוד (Backend)
  • בוט טלגרם
  • מסד נתונים/מיגרציות
  • תיעוד (docs/)
  • DevOps/CI/CD

פירוט נקודות (רשימת תבליטים):

  • העברת הגדרות הפונקציות toggleImageTriggerVisibility ו־handleMarkdownImageFiles לפני הקריאה אליהן כדי למנוע שגיאות JS בטעינה.
  • הטמעת לוגיקה מלאה לניהול תמונות ב־Markdown:
    • הצגת/הסתרת כפתור ההעלאה בהתאם לסיומת הקובץ (.md).
    • ולידציה של קבצים נבחרים (סוג, גודל, מניעת כפילויות).
    • שימוש ב־DataTransfer לניהול קבצים ב־input.
    • רינדור תצוגות מקדימות של תמונות, אפשרות הסרה ופתיחה במסך מלא.
    • ניקוי objectURLs בעת הסרה או לפני עזיבת הדף.

🧪 בדיקות

  • בדיקה ידנית: ודאתי שהכפתור מופיע/נעלם בהתאם לסיומת הקובץ, שניתן לבחור תמונות, שהן מוצגות כתצוגה מקדימה, ושהסרתן עובדת.
  • Unit
  • Integration
  • Manual

🧪 בדיקות נדרשות ב‑PR

  • 🔍 Code Quality & Security
  • Unit Tests (3.11)
  • Unit Tests (3.12)

📝 סוג שינוי

  • feat: פיצ'ר חדש
  • fix: תיקון באג
  • docs: שינוי תיעוד בלבד
  • refactor: שינוי קוד ללא שינוי התנהגות
  • perf: שיפור ביצועים
  • chore/ci: תשתית/CI
  • breaking change: שינוי שובר תאימות

✅ צ'קליסט

  • הקוד עוקב אחרי הסגנון (Black/isort/flake8/mypy) - Lint checked for JS.
  • בדיקות רצות ועוברות - Manual testing passed, mobile testing requested.
  • תיעוד עודכן (README/Docs) - Not relevant.
  • אין סודות/מפתחות בקוד
  • אין מחיקות מסוכנות/פעולות על root (ראו .cursorrules)
  • הודעת הקומיט תואמת Conventional Commits (ע"פ הטבלה)
  • CHANGELOG עודכן אם נדרש - Not required.
  • כל ה‑Required Checks לעיל ירוקים - Will run in CI.
  • צילום/וידאו UI מצורף אם רלוונטי - Not attached, mobile testing requested.

🧩 השפעות/סיכונים

  • השפעה אפשרית על פרודקשן, ביצועים, או אבטחה: תיקון באג ב־JS, סיכון נמוך. משפר חווית משתמש.

🔗 קישורים

🧯 סיכון / החזרה לאחור (Rollback)

  • תוכנית חזרה לאחור במקרה תקלה: חזרה לגרסה קודמת של הקובץ webapp/templates/upload.html.

Open in CursorOpen in Web


Note

Implements Markdown image attachment UX in webapp/templates/upload.html, including visibility toggle, validation, previews, removal, fullscreen view, and safer file input syncing.

  • Upload page (webapp/templates/upload.html):
    • Markdown image UX:
      • Show/hide #imageUploadTrigger based on .md filename; disable #markdownImageInput when not .md.
      • Status and errors via #markdownImageStatus and #markdownImageError; empty-state handling in #markdownImagesPreview.
      • File handling: type/size limit (2MB), max 6 images, duplicate detection, humanFileSize.
      • Previews rendering with remove buttons; update underlying input via DataTransfer when supported; clear input fallback.
      • Fullscreen viewer (open/close, caption, body overflow lock); ESC and backdrop click to close; revoke objectURLs on removal and beforeunload.
    • Utilities/flow:
      • toggleImageTriggerVisibility, handleMarkdownImageFiles, reset/remove/sync/render helpers.
      • supportsDataTransfer detection; additional updateMarkdownImageStatus calls.

Written by Cursor Bugbot for commit 9a37537. This will update automatically on new commits. Configure here.

Co-authored-by: amirbiron <amirbiron@gmail.com>
@cursor

cursorBot commented Dec 3, 2025

Copy link
Copy Markdown
Contributor

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@github-actions

github-actionsBot commented Dec 3, 2025

Copy link
Copy Markdown
Contributor

🧯 Dangerous deletes guard report

Policy: see .cursorrules — dangerous deletions are blocked unless wrapped safely.

Summary:

  • Flagged findings (blocking): 0
    0
  • Excluded matches (not blocking): 15
  • Total matches (all files): 125

Flagged findings (file:line:snippet):
(none)

Excluded matches (by path pattern)
./Dockerfile:37: rm -rf /var/lib/apt/lists/*
./Dockerfile:109: rm -rf /var/lib/apt/lists/*
./webapp/static/js/md_preview.bundle.js.map:4: "sourcesContent": ["// Markdown-it plugin to render GitHub-style task lists; see\n//\n// https://github.com/blog/1375-task-lists-in-gfm-issues-pulls-comments\n// https://github.com/blog/1825-t … [truncated]
./README.md:813:find . -name "__pycache__" -exec rm -rf {} +
./docs/DOCUMENTATION_GUIDE.md:453:rm -rf _build
./docs/Makefile:24:	rm -rf $(BUILDDIR)
./node_modules/mermaid/dist/chunks/mermaid.core/chunk-KS23V3DP.mjs.map:4: "sourcesContent": ["{\n \"name\": \"mermaid\",\n \"version\": \"11.12.0\",\n \"description\": \"Markdown-ish syntax for generating flowcharts, mindmaps, sequence … [truncated]
./node_modules/mermaid/dist/chunks/mermaid.esm.min/chunk-4HFYJGYH.mjs.map:4: "sourcesContent": ["{\n \"name\": \"mermaid\",\n \"version\": \"11.12.0\",\n \"description\": \"Markdown-ish syntax for generating flowcharts, mindmaps, sequen … [truncated]
./node_modules/mermaid/dist/chunks/mermaid.esm.min/chunk-4HFYJGYH.mjs:1:var r={name:"mermaid",version:"11.12.0",description:"Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graph … [truncated]
./node_modules/mermaid/dist/chunks/mermaid.esm/chunk-2M32CCKP.mjs.map:4: "sourcesContent": ["{\n \"name\": \"mermaid\",\n \"version\": \"11.12.0\",\n \"description\": \"Markdown-ish syntax for generating flowcharts, mindmaps, sequence d … [truncated]
./node_modules/mermaid/dist/mermaid.min.js:1524:`,"getStyles"),c1e=RQe});var h1e={};dr(h1e,{diagram:()=>NQe});var NQe,f1e=N(()=>{"use strict";$ge();a1e();l1e();u1e();NQe={parser:Fge,db:n1e,renderer:o1e,styles:c1e}});var m1e,g1e=N(()=>{"use … [truncated]
./node_modules/mermaid/dist/mermaid.js.map:4: "sourcesContent": ["/**\n* Default values for dimensions\n*/\nconst defaultIconDimensions = Object.freeze({\n\tleft: 0,\n\ttop: 0,\n\twidth: 16,\n\theight: 16\n});\n/**\n* Default values for tr … [truncated]
./node_modules/mermaid/dist/mermaid.min.js.map:4: "sourcesContent": ["/**\n* Default values for dimensions\n*/\nconst defaultIconDimensions = Object.freeze({\n\tleft: 0,\n\ttop: 0,\n\twidth: 16,\n\theight: 16\n});\n/**\n* Default values fo … [truncated]
./node_modules/katex/package.json:153: "build": "rimraf dist/ && mkdirp dist && cp README.md dist && rollup -c --failAfterWarnings && webpack && node update-sri.js package dist/README.md",
./node_modules/katex/src/fonts/Makefile:139:	rm -rf pfa ff otf ttf woff woff2

@github-actions

github-actionsBot commented Dec 3, 2025

Copy link
Copy Markdown
Contributor

⏱️ Performance report

(No performance test durations collected. Mark tests with @pytest.mark.performance.)

@sentry

sentryBot commented Dec 3, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Co-authored-by: amirbiron <amirbiron@gmail.com>
@amirbiron
amirbiron marked this pull request as ready for review December 3, 2025 10:05
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Comment threadwebapp/templates/upload.html
Comment threadwebapp/templates/upload.html
Co-authored-by: amirbiron <amirbiron@gmail.com>
@amirbiron
amirbiron merged commit 4f6d2f6 into mainDec 3, 2025
21 checks passed
Sign up for freeto 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

@amirbiron@cursoragent