Commit Graph

110 Commits

Author SHA1 Message Date
a2nr a18d3f660c feat(ble-deployer): add CMD_RESET for Arduino DTR pulse reset 2026-07-05 17:38:40 +07:00
a2nr bba06933bd feat(elemes): v3.1 checkpoint — BLE deployer enhancements before port to Velxio
v3.1 enhancements (4 Jul 2026):
- Baud dropdown (9600/19200/38400) + CMD_SET_BAUD
- LED blink patterns per-state (IDLE/RECEIVING/FLASHING/SERIAL_BRIDGE)
- Arduino event-based connect/disconnect (CherryUSB)
- Serial terminal always visible saat paired
- Re-deploy fix: serial_bridge_stop before parser
- Dual baud: 115200 STK500 + 9600 serial bridge
- Footer v15, SW cache v14

This is a checkpoint commit. Next cycle: port Deploy from
SvelteKit (DeployTab.svelte) to Velxio React app (native integration).
DeployTab.svelte will be deprecated after port complete.
2026-07-04 20:21:46 +07:00
a2nr 3dd29e1ba1 revert: DATA sendCommandWithRetry ke f6a04b8 (direct write+waitForAck, no readPoll)
cad90eb merutekan DATA melalui sendCommand() dengan readPoll state===1
yang selalu true — menyebabkan chunk lambat 5s/kirim saat ACK di-drop.
Kembalikan ke direct writeValueWithResponse + waitForAck.
Selama transfer aktif tidak ada idle gap (Qualcomm >8s), jadi ACK notify
tidak terpengaruh idle-drop.

Perubahan:
- sendCommandWithRetry: build payload sendiri, pakai chunkCRC param,
  write+waitForAck langsung (tidak lewat sendCommand)
- sendCommand: hanya handle INIT dan END (DATA dihapus dari blok)
- Hapus writeSucceeded flag (tidak lagi dipakai)
- Hapus readPoll fallback untuk DATA
- Bump v12 (Footer + SW cache)
2026-07-01 06:07:57 +07:00
a2nr 26ada16c4d feat(frontend): bump version badge + SW cache to v11 for deploy verification 2026-07-01 05:12:42 +07:00
a2nr c20b2d5a8e fix: END ACK regression — readPoll pintar + INIT_ACK_INDEX 0xFFFE + binary_parser.c git track
Akar masalah:
- 4a6ef8c menambah binary_parser_reset() di handler re-deploy SERIAL_BRIDGE
  yang menghapus expected_total_crc setelah INIT — menyebabkan CRC mismatch
  di END. Source 1d3a489 sudah menghapus reset-nya, tapi device butuh rebuild.
- cad90eb merutekan DATA melalui sendCommand() dengan readPoll state===1
  yang selalu true saat DATA — write gagal dilaporkan sukses.

Perbaikan:
1. readPoll pintar untuk DATA: state===1 tidak lagi dianggap sukses.
   readPoll hanya fast-fail di state>=5; deadline fallback hanya ok
   jika writeValueWithResponse sukses (GATT write response = bukti delivery).
2. INIT_ACK_INDEX=0xFFFE (Fase 3): inisialisasi INIT dengan index unik
   menghilangkan tabrakan dengan DATA[0] (index 0). binary_parser.c echo
   index recv di ACK INIT. Guard handleFlashingNotification diperluas.
3. pendingAcks.clear() di awal deployHex mencegah poisoning antar deploy.
4. Track firmware inti ke git: binary_parser.c, checksum.c, stk500v1.c,
   usb_host.c + headers + CMakeLists + sdkconfig + partitions.

Build: ESP-IDF v6, ESP32-S3, flash via /dev/ttyACM0
2026-07-01 05:10:38 +07:00
a2nr d146e445d6 feat(frontend): add version badge (v10) in footer for deploy verification 2026-06-30 19:39:15 +07:00
a2nr 1d3a48940e fix(firmware+frontend): remove binary_parser_reset() re-deploy wipes CRC + tighten INIT poll
Firmware (state_machine.c):
- Remove binary_parser_reset() from SERIAL_BRIDGE→RECEIVING handler
- Remove binary_parser_reset() from ERROR→RECEIVING handler
- Parser's INIT handler already resets itself; calling reset AFTER
  INIT payload processing wipes expected_total_crc to 0 → CRC fail

Frontend (ble-deployer.ts):
- Tighten INIT readValue poll: state===1 (RECEIVING) only
  Previously accepted state >= 1 && <= 4 which could false-positive
  on FLASHING(3) or SERIAL_BRIDGE(4) stale states

Cache v9 → v10
2026-06-30 19:21:35 +07:00
a2nr 6ccbb88678 bump(frontend): cache v8→v9 for clean SW refresh 2026-06-30 18:32:05 +07:00
a2nr cad90ebd2e fix(frontend): route DATA through sendCommand for readValue() fallback
sendCommandWithRetry now delegates to sendCommand() instead of
using raw writeValueWithResponse + await ackPromise. This ensures
DATA chunks also benefit from the readValue() state poll fallback
when Android BLE notify is unreliable after idle.
2026-06-30 18:14:03 +07:00
a2nr 4a6ef8ce57 feat(firmware): serial bridge throttle, LED blink fix, re-deploy safety
serial_bridge.c + .h:
- Implement 20pkt/s throttle with 240-byte buffer
- serial_bridge_on_usb_data() for buffering USB serial data
- Flush every 50ms or 500ms stale timeout

led_button.c + .h:
- Per-color LED blink toggle in led_button_tick()
- BLUE_BLINK 200ms, RED_BLINK 100ms, GREEN_BLINK 200ms
- Fix: was set_led(true,true,true) for all blink patterns

main.c:
- Route USB serial data through serial_bridge_on_usb_data
- Add led_button_tick() call in main loop

state_machine.c:
- Add binary_parser_reset() on SERIAL_BRIDGE re-deploy
2026-06-30 18:13:42 +07:00
a2nr f6a04b81ba fix: re-deploy crash + readValue poll for INIT/DATA
Firmware (state_machine.c):
- Add EVENT_BLE_INIT handler to SERIAL_BRIDGE state
  -> transition back to RECEIVING for re-deploy
- Add EVENT_BLE_INIT handler to ERROR states
  -> allows re-deploy from error without pressing Retry

Frontend (ble-deployer.ts):
- Add readValue() state poll for INIT and DATA commands
  (same Android notify idle-drop bug affects these too)
- INIT success: firmware state >= 1 (RECEIVING+)
- DATA success: firmware state == 1 (RECEIVING)
- Error on state >= 5
2026-06-30 17:55:26 +07:00
a2nr 9918aafe41 fix: Phase B — readValue() state poll fallback for END ACK
Firmware:
- Add BLE_GATT_CHR_F_READ to flashing characteristic
- Read callback returns state_machine_get_current() as 1 byte
  (4=SERIAL_BRIDGE=success, 5/6=ERROR)

Frontend:
- Replace ineffective pendingAcks poll with readValue() poll
- CCCD refresh fire-and-forget (non-blocking)
- Race ackPromise (notify) vs readPoll (readValue)
- Clean up ackPromise resolver on readPoll win
- Cache v7 → v8
2026-06-30 17:35:23 +07:00
a2nr 9dda8fe3e6 fix: event-driven poll loop for END ACK to work around Android BLE notification delivery issue on Qualcomm chipsets
- Race ackPromise against a polling loop that yields to the event loop
  every 200ms (vs a single blocking await that can miss notifications)
- bump SW cache v5→v6
2026-06-30 13:12:55 +07:00
a2nr e4ec3f1ded feat: custom evaluation config 2026-06-17 20:34:36 +07:00
a2nr 120a1338c0 feat: enhance fullscreen mode slide and hide able slide 2026-05-14 20:25:21 +07:00
a2nr bc49877123 feat: update to support folder inside content folder to easy to manage 2026-05-14 19:45:10 +07:00
a2nr 8485425d0f docs: add slide tutorial for teacher 2026-05-14 19:04:24 +07:00
a2nr 58e897f743 feat: add markdown-based interactive slide carousel with fullscreen mode 2026-05-14 18:53:46 +07:00
a2nr 9e5617274e add : docomentation 2026-05-14 16:33:45 +07:00
a2nr 7384b6e585 feat: readable content: 2026-05-14 16:26:11 +07:00
a2nr 5f150da651 fix: progress path fix 2026-05-12 14:49:18 +07:00
a2nr 86d2851593 fix: generate token only change progress lesson 2026-05-12 08:37:25 +07:00
a2nr c578d1b4d6 feat: lets teacher entry thier own token an name in token 2026-05-12 08:09:16 +07:00
a2nr 31dfe87c60 feat: update generate token to always complete every lesson for teacher only. 2026-05-12 08:03:02 +07:00
a2nr be534f3512 fix: robust lesson parsing for flexible home.md formats 2026-05-11 11:35:28 +07:00
a2nr 097f2c5609 feat: enhance lesson UI with centered images, bordered tables, and conditional output tab 2026-05-11 07:27:15 +07:00
a2nr 438d96ef13 feat: update image capability inside quiz 2026-05-10 20:38:35 +07:00
a2nr 60469925ea docs: update README and documentation with quiz features, add example quiz and flowchart lessons 2026-05-10 09:39:17 +07:00
a2nr 459ceff2d8 fix: prevent localStorage leakage and fix navigation by implementing component isolation and reactive state management 2026-05-10 09:14:00 +07:00
a2nr ea3556d05f feat: implement interactive quiz with secure content protection, scoring, and teacher reset 2026-05-09 13:04:42 +07:00
a2nr 7e77748b6b feat: add quiz feature 2026-05-08 09:50:07 +07:00
a2nr 9ed207d2fa feat: implement secured lesson prerequisite system with interactive links and auto-docking UI 2026-05-07 10:54:42 +07:00
a2nr 9910a92364 remove test log 2026-05-06 10:51:51 +07:00
a2nr cbbd7cfb7a update locust file 2026-05-06 09:09:54 +07:00
a2nr d28cab70fa fix: script locust file remove /lessons path 2026-05-06 08:32:26 +07:00
a2nr 2b6ec21633 perf: fix race conditions with file locking and optimize backend latency 2026-05-05 22:57:19 +07:00
a2nr 7a3a2ecc13 update help asset and documentation to release version 2026-05-05 15:05:06 +07:00
a2nr a124cf5e6d fix(flowchart): prevent arrow overlaps with obstacle-aware orthogonal routing 2026-05-02 22:04:26 +07:00
a2nr c103bc02ad feat(flowchart): support interactive embedding in markdown with readonly mode and frontend evaluation 2026-05-02 19:45:04 +07:00
a2nr 433c095394 feat(flowchart): implement text-based logic with auto-layout and migrate evaluation to frontend 2026-05-02 18:47:46 +07:00
a2nr 0ff56ed9d2 bug fix : leak content python_expected_output 2026-05-01 15:32:55 +07:00
a2nr 9cee4f2f74 feat: refactoring canvas flowchart 2026-05-01 12:15:20 +07:00
a2nr 6db1344622 feat: maximize workspace on mobile mode 2026-05-01 11:24:41 +07:00
a2nr c5348a9166 add feature: flowchart maker 2026-05-01 09:09:45 +07:00
a2nr 6f1b86226e Enhance UI Experience 2026-04-28 12:47:53 +07:00
a2nr f8de0cab5f feat: implement \"Coba\" button for code blocks
and improve mobile UX

   - Menambahkan fitur tombol \"Coba ▶\" untuk menyalin kode
     materi ke editor secara otomatis.
   - Implementasi setupTryButtons.ts (Svelte Action) untuk
     injeksi tombol berdasarkan label bahasa Markdown (c, python,
  `arduino).
   - Mengatur perilaku tombol agar hanya memuat kode dan
     memfokuskan tab (No Auto-Run) untuk memberikan kesempatan
     siswa meninjau kode.
   - Optimasi tampilan Mobile (< 768px):
       - Tombol \"Coba\" selalu terlihat (tanpa hover).
       - Otomatis membuka workspace ke mode 'half-sheet' dan
         melakukan smooth scroll ke editor saat tombol diklik.
   - Sinkronisasi urutan render: setupTryButtons dijalankan
     sebelum highlightAllCode untuk memastikan deteksi bahasa
     yang akurat.
   - Update documentation.md dengan panduan penggunaan fitur
     tombol \"Coba\" dan dokumentasi refactoring modularitas
     halaman lesson.
   - Menambahkan modul uji coba LaTeX ke daftar materi di
     home.md
2026-04-27 21:38:36 +07:00
a2nr 5aebd4487d refactor(frontend): pecah komponen raksasa
+page.svelte dan perbaiki backend parser

Pembaruan ini
     mencakup:
- Refactoring skala besar pada halaman lesson SvelteKit untuk efisiensi kode.
- Ekstraksi evaluasi Code, Circuit, dan Velxio ke dalam direktori lib/services/.
- Memisahkan manajemen iframe (Zustand & PostMessage) ke  velxio-manager.ts.
- Memisahkan Tab Panel HTML menjadi komponen spesifik (CodeTab, CircuitTab, VelxioTab).
- Ekstraksi blok <style> menjadi stylesheet terpisah (lesson.css).
- Perbaikan warning A11y & penghapusan class usang pada Navbar.svelte.
- Memperbaiki regex parser 'Available_Lessons' pada lesson_service.py di backend.
- Menambahkan mekanisme auto-append ekstensi '.md' untuk  mengatasi bug Home kosong dan tombol 'Next Lesson' yang hilang akibat format URL baru di home.md.
2026-04-27 13:36:17 +07:00
a2nr b8fb67115e feat: implement LaTeX support with KaTeX and python-markdown-math
3 - Integration of KaTeX in frontend (SvelteKit) with a custom
  renderMath` action.

  - Added `python-markdown-math` extension in backend (Flask). to handle math blocks.
  - Configured Vite to handle KaTeX during SSR and browser rendering.
  - Added a LaTeX test lesson and updated home navigation.
  - Supported both inline ($) and block ($$) math rendering,
   including multi-line support.
2026-04-26 15:47:11 +07:00
a2nr dce4916b94 ui: refactor navbar and improve mobile experience
- Move navigation menu to the leftmost position and
   consolidate actions into a dropdown.
 - Replace clunky mobile sheet handle with explicit
   minimize/maximize buttons.
 - Fix home page content margins for list elements.
 - Ensure student identity remains visible on mobile devices
   with optimized font sizing.
 - Synchronize CircuitJS simulator theme with global
   light/dark mode.
 - Update elemes.sh to provide cleaner output by silencing
   podman-compose logs by default.
2026-04-22 21:04:38 +07:00
a2nr dc1d65ac15 remove blacklist logout feature 2026-04-22 16:56:02 +07:00