feat: datatable debounce#1042
Merged
Merged
Conversation
|
🔄 AI PR Review sedang antri di server...
|
affandii06
added a commit
that referenced
this pull request
May 22, 2026
* Fix/detail statistik pangan tidak tampil (#989) * fix: data detail statistik tidak tampil * fix: perbaikan detail presisi statistik pangan * fix: perbaikan detail presisi statistik pangan * Tambahkan test * hapus * fix: tambahkan link detail untuk belum mengisi, jumlah dan total agar seragam * perbaikan judul * perbaikan filter tahun * [ci skip] memutahirkan catatan rilis --------- Co-authored-by: Ahmad Affandi <caspianp98@yahoo.com> * Feat: detail statistik presisi sandang (#1014) * fix: data detail statistik tidak tampil * fix: perbaikan detail presisi statistik pangan * fix: perbaikan detail presisi statistik pangan * Tambahkan test * hapus * fix: tambahkan link detail untuk belum mengisi, jumlah dan total agar seragam * feat: detail statistik sandang * perbaikan sesuai rekomendasi AI review * perbaiki test * perbaikan judul * perbaikan test * perbaikan filter tahun * [ci skip] memutahirkan catatan rilis --------- Co-authored-by: Ahmad Affandi <caspianp98@yahoo.com> * Merge Pull Request Feat: detail statistik papan (#1016) * simpan dulu * feat: detail presisi papan * tambahkan test * perbaikan mengikuti rekomendasi AI review * perbaikan filter tahun --------- Co-authored-by: Ahmad Affandi <caspianp98@yahoo.com> * Merge Pull Request From feat: detail statistik pendidikan (#1017) * feat: detail statistik pendidikan * perbaikan sesuai rekomendasi AI review * perbaikan test * perbaikan filter tahun * [ci skip] memutahirkan catatan rilis --------- Co-authored-by: Ahmad Affandi <caspianp98@yahoo.com> * Merge Pull Request From Feat: detail statistik ketenagakeerjaan (#1019) * simpan dulu * feat: detail statistik ketenagakerjaan * perbaikan filter tahun * perbaikan filter tahun * [ci skip] memutahirkan catatan rilis --------- Co-authored-by: Ahmad Affandi <caspianp98@yahoo.com> * Merge Pull Request From feat: detail statistik keagamaan (#1020) * feat: detail statistik keagamaan * [ci skip] memutahirkan catatan rilis --------- Co-authored-by: Ahmad Affandi <caspianp98@yahoo.com> * Merge Pull Request From fix: tinymce pada artikel (#1022) * fix: tinymce pada artikel * [ci skip] memutahirkan catatan rilis --------- Co-authored-by: Ahmad Affandi <caspianp98@yahoo.com> * Merge Pull Request From fix: error ketika halaman login menampilkan captcha (#1024) * fix: error ketika halaman login menampilkan captcha * [ci skip] memutahirkan catatan rilis --------- Co-authored-by: Ahmad Affandi <caspianp98@yahoo.com> * Merge Pull Request From Validasi kategori artikel ketika membuat artikel baru (#1027) * validasi kategori artikel ketika membuat artikel baru * [ci skip] memutahirkan catatan rilis --------- Co-authored-by: Ahmad Affandi <caspianp98@yahoo.com> * Merge Pull Request From Fix: ijinkan upload video pada tinymce (#1029) * fix: tinymce pada artikel * fix: ijinkan upload video pada tinymce * allow tag video * perbaikan config * upgrade versi tinymce * [ci skip] memutahirkan catatan rilis --------- Co-authored-by: Ahmad Affandi <caspianp98@yahoo.com> * Merge Pull Request From Perbaiki tekan enter di form kategori membuat refresh halaman (#1028) * perbaiki tekan enter membuat refresh halaman * sesuaikan label aksi tertukar di tabel kategori * perbaiki tombol simpan melalui cursor * [ci skip] memutahirkan catatan rilis --------- Co-authored-by: Ahmad Affandi <caspianp98@yahoo.com> * Merge Pull Request From Validasi kategori artikel ketika membuat artikel cms baru (#1035) * Validasi kategori artikel ketika membuat artikel cms baru * test * [ci skip] memutahirkan catatan rilis --------- Co-authored-by: Ahmad Affandi <caspianp98@yahoo.com> * Feat/detail statistik jaminan sosial (#1030) * feat: Detail statistik Jaminan Sosial * simpan dulu * [ci skip] memutahirkan catatan rilis --------- Co-authored-by: Ahmad Affandi <caspianp98@yahoo.com> * Merge Pull Request From feat: detail statistik kesehatan (#1034) * feat: detail kesehatan * [ci skip] memutahirkan catatan rilis --------- Co-authored-by: Ahmad Affandi <caspianp98@yahoo.com> * Merge Pull Request From feat: detail statistik seni (#1036) * feat: detail statistik seni * perbaikan judul * tambahkan judul * [ci skip] memutahirkan catatan rilis --------- Co-authored-by: Ahmad Affandi <caspianp98@yahoo.com> * Merge Pull Request From fix: gambar logo desa pada website desa aktif (#1038) * fix: gambar logo desa pada website desa aktif * fix: gambar logo desa pada website desa aktif * ikuti rekomendasi AI review * perbaiki test * [ci skip] memutahirkan catatan rilis --------- Co-authored-by: Ahmad Affandi <caspianp98@yahoo.com> * Merge Pull Request From fix: perbaikan tampilan website ketika slider belum diisi (#1040) * fix: perbaikan tampilan website ketika slider belum diisi * [ci skip] memutahirkan catatan rilis --------- Co-authored-by: Ahmad Affandi <caspianp98@yahoo.com> * Merge Pull Request From feat: datatable debounce (#1042) * feat: datatable debounce * [ci skip] memutahirkan catatan rilis --------- Co-authored-by: Ahmad Affandi <caspianp98@yahoo.com> * rilis v2605.0.1 --------- Co-authored-by: ahmad afandi <ahmad.afandi85@gmail.com> Co-authored-by: Ahmad Affandi <caspianp98@yahoo.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request: Debounce Pencarian DataTable untuk Mencegah Spam Request
Deskripsi
Implementasi debounce pada fitur pencarian DataTable di seluruh halaman admin OpenKab. Tanpa debounce, setiap karakter yang diketik user langsung memicu request ke server (misal: mengetik "kemiri" menghasilkan 6+ request untuk "k", "ke", "kem", "kemi", "kemir", "kemiri"). Perubahan ini memastikan request hanya dikirim 1x setelah user selesai mengetik.
Perubahan yang dilakukan:
searchDelay: 500pada konfigurasi default DataTable untuk semua tabel di aplikasi.init.dtyang menerapkan custom debounce logic pada input search DataTable.keyup.DT input.DT search.DT keydown.DT) dan menggantinya dengan handler custom yang menggunakansetTimeoutuntuk debounce.Alasan perubahan:
Dampak perubahan:
✅ Performance: Request pencarian berkurang drastis (dari N request per kata menjadi 1 request setelah user selesai mengetik)
✅ Database load: Beban query database berkurang signifikan karena tidak ada query parsial yang tidak perlu
✅ Network efficiency: Bandwidth yang digunakan lebih efisien
✅ User experience: Pencarian tetap responsif dengan delay 500ms yang tidak mengganggu UX
✅ Backward compatible: Tidak mengubah API atau struktur data, hanya mengubah timing request
Masalah Terkait (Related Issue)
Langkah untuk mereproduksi (Steps to Reproduce)
Sebelum perbaikan (masalah):
Setelah perbaikan (fix):
Testing pada fitur lain yang terkait:
Daftar Periksa (Checklist)
Teknis Detail
Penjelasan Teknis
Implementasi debounce menggunakan pola standar JavaScript dengan
setTimeoutdanclearTimeout:Mekanisme kerja:
init.dtdipanggil setiap kali DataTable diinisialisasisearchDelay)previousSearchmencegah redundant search jika nilai tidak berubahclearTimeoutmembatalkan timer sebelumnya saat user masih mengetiktable.search().draw()hanya dipanggil setelah timer selesai (user berhenti mengetik)Optimasi tambahan:
searchDelay: 500di-set sebagai default global untuk semua DataTable1500msjikasearchDelaytidak ditemukan di init configtable.search() !== currentValuemencegah draw ulang jika nilai sudah samaKonfigurasi yang berubah
searchDelay: 500ditambahkan ke$.fn.dataTable.defaultsDependencies yang ditambahkan
Testing
Manual Testing
Screenshots / Video
simplescreenrecorder-2026-05-19_15.32.43.mp4
Sebelum:
Network tab menunjukkan multiple request untuk setiap keystroke saat mengetik "kemiri":
Sesudah:
Network tab menunjukkan hanya 1 request setelah user selesai mengetik:
Breaking Changes
Tidak ada breaking changes. Perubahan hanya mempengaruhi timing request, bukan fungsi atau API.
Migration Guide
Tidak diperlukan.
References
Catatan tambahan:
searchDelaydi$.fn.dataTable.defaultsindex.blade.php)