เรียนรู้วิธีใช้ Built-in Change Log Feature ของ Frappe เพื่อแสดง What is New Popup ให้ User เมื่อ App มีการ Update เวอร์ชัน

Frappe Framework มี Built-in Feature สำหรับแสดง "What's New" Popup Dialog ให้ User เมื่อพวกเขา Login หลังจาก App มีการ Update เวอร์ชัน Feature นี้ช่วยให้ User รู้ว่ามี Features ใหม่หรือ Bug Fixes อะไรบ้าง
เมื่อ User Login หลังจาก App Update, Frappe จะ:
__version__ ของ App กับ Version ที่เก็บไว้your_app/
├── your_app/
│ ├── __init__.py # มี __version__ = "x.y.z"
│ └── change_log/
│ ├── current/
│ │ ├── readme.md # Placeholder (จำเป็น)
│ │ └── changes.md # Placeholder ว่าง
│ ├── v0/ # Major Version 0.x.x
│ │ └── v0_9_2.md
│ └── v1/ # Major Version 1.x.x
│ ├── v1_0_0.md
│ ├── v1_1_0.md
│ └── v1_5_0.md
v{major}/ - Group ตาม Major Versionv{major}_{minor}_{patch}.md - Version ด้วย Underscores1.5.0 → v1/v1_5_0.mdแต่ละ Version File ใช้ Format นี้:
# Updates detailed
- Feature description พร้อมคำอธิบายสั้นๆ
- อีก Feature หรือ Improvement
- Extended settings:
- Sub-feature 1
- Sub-feature 2
- Sub-feature 3
# Updates detailed
- Section ที่สองของ Updates (Optional)
- Features หรือ Fixes เพิ่มเติม# Updates detailed (ตรงเป๊ะ)-- สำหรับ Sub-items# Updates detailed Heading ได้หลายอัน# สร้าง Directory Structure
mkdir -p your_app/change_log/v1 your_app/change_log/current
# สร้าง Placeholder Files
cat > your_app/change_log/current/readme.md << 'EOF'
Leave change log files in this folder for user release notes.
(this file is just a placeholder, don't delete it)
EOF
touch your_app/change_log/current/changes.md
# สร้าง Version File (ตัวอย่าง 1.5.0)
cat > your_app/change_log/v1/v1_5_0.md << 'EOF'
# Updates detailed
- Your feature description here
- Another update or improvement
EOF# Updates detailed
## Document Scanner - OCR Integration 🔍
- **Google Vision OCR Integration**: ทดสอบ OCR บน Scanned Documents
- Raw Text Extraction View
- Parsed Data JSON View
- Copy to Clipboard Button
- **Quick Scan Mode**: Pipeline แบบน้อยที่สุด
- Detect → Crop → Sharpen เท่านั้น
- ประมวลผลเร็วขึ้นสำหรับ Simple Documents
## Bug Fixes
- แก้ไข Deskew Threshold สำหรับ Document Straightening
- ปรับปรุง Luminance Merge ด้วย Conservative Clampingเมื่อใช้ Automated Release:
v{major}_{minor}_{patch}.mdgit push --follow-tags# 1. สร้าง Changelog File
cat > your_app/change_log/v1/v1_6_0.md << 'EOF'
# Updates detailed
- เพิ่ม Dark Mode Toggle
- ปรับปรุง Performance การโหลดหน้า
- แก้ไข Bug การ Export PDF
EOF
# 2. Commit
git add .
git commit -m "feat: add dark mode and fix PDF export"
# 3. Bump Version
yarn release:minor # หรือ npm version minor
# 4. Push
git push --follow-tags# your_app/__init__.py
__version__ = "1.6.0"สำคัญ: Version ใน __init__.py ต้องตรงกับชื่อไฟล์ Changelog
v1_5_0.md ไม่ใช่ v1.5.0.md__version__: ใน __init__.py ต้องตรงกับ Version Filev{major}/ Folder# Updates detailed เป๊ะ- ถูกต้องv{major}/ Folder ที่ถูก# ใน bench console
bench --site your-site.local consoleimport your_app
print(your_app.__version__)แต่ละ App ใน Bench สามารถมี Change Log ของตัวเองได้:
frappe-bench/
├── apps/
│ ├── frappe/
│ │ └── frappe/change_log/
│ ├── erpnext/
│ │ └── erpnext/change_log/
│ └── your_app/
│ └── your_app/change_log/
เมื่อ User Login หลัง Update, Frappe จะรวม Changelogs จากทุก Apps ที่มี Version Change
Frappe's Built-in Change Log Feature ช่วยให้:
สิ่งที่ต้องทำ:
change_log/ Directory Structure# Updates detailed Heading__init__.py