feat: move config.py to config.example.py, exclude config.py from git tracking

- Copy config.py to config.example.py as template (tracked in git)
- Add config.py to .gitignore (local config per developer)
- Update README.md with configuration setup instructions
- Fix outdated references (TinyDB -> SQLite, add missing files)
- Persist goal selection across task and note pages
This commit is contained in:
Yuyao Huang
2026-05-09 10:12:37 +08:00
parent 3c325bdb0f
commit 2629e8f2cd
4 changed files with 41 additions and 30 deletions
+7 -6
View File
@@ -107,7 +107,7 @@ async function openNote(noteId) {
document.getElementById("note-modal").classList.add("active");
}
function openNewNote() {
async function openNewNote() {
editingNoteId = null;
document.getElementById("note-modal-title").textContent = "New Note";
document.getElementById("note-id").value = "";
@@ -120,7 +120,11 @@ function openNewNote() {
document.getElementById("note-modal").classList.add("active");
if (savedGoalId) {
populateTasks(savedGoalId);
await populateTasks(savedGoalId);
const goal = goals.find(g => g.id === savedGoalId);
if (goal && goal.selected_task_id) {
document.getElementById("note-task").value = goal.selected_task_id;
}
} else {
document.getElementById("note-task").innerHTML = '<option value="">None</option>';
}
@@ -225,10 +229,7 @@ document.addEventListener("DOMContentLoaded", () => {
populateTasks(goalId);
});
document.getElementById("filter-goal").addEventListener("change", async () => {
const goalId = parseInt(document.getElementById("filter-goal").value) || null;
savedGoalId = goalId;
await patch("/api/user/selected-goal", { goal_id: goalId });
document.getElementById("filter-goal").addEventListener("change", () => {
loadNotes();
});