APP REVIEW — Daily. by Elaine (lizhuoning)

LOADED_SRC URL

https://producingtechnology.com/65-apps/lizhuoning_185002_15200395_daily-planner.html

BEHAVIOR SUMMARY

THINGS THAT DIDN'T WORK AS EXPECTED

IMPROVEMENT PROMPT

You are improving a single-file HTML/CSS/JS daily planner app called "Daily." that loads
a JSON file and renders a 2x2 card dashboard (date, mood, tasks, note) in a warm
paper-notebook aesthetic using Lora serif and DM Mono fonts.

Apply the following fixes and additions without altering the visual design, color palette,
or typography:

1. ADD localStorage persistence:
   - After any state change (task toggle, task add, mood change, note save), call
     localStorage.setItem('daily_state', JSON.stringify(state)).
   - On page load, check localStorage for a saved state and load it automatically,
     skipping the drop screen. Show a small dismissible banner: "Restored previous session."
   - The "load new file" button should also call localStorage.removeItem('daily_state').

2. ADD a JSON export button:
   - In the app header, next to "load new file", add an "export json" button
     styled identically to the reload button.
   - Clicking it serialises the current state to a formatted JSON string, creates a
     Blob, and triggers a download as "daily-export.json".

3. FIX the date discrepancy:
   - Replace the static date in the Date card with today's actual date using
     new Date() instead of parsing s.day.date, so the greeting and the calendar
     number always match.
   - Keep s.day.date in the data model for reference, but add a note "(planned)"
     beneath the calendar number if it differs from today's date.

4. ADD a JSON schema hint on the drop screen:
   - Below the "Use sample data" button, add a collapsible details element
     labelled "Expected JSON format" in the mono font.
   - Inside, show a pretty-printed minimal example covering all required and optional
     fields (user.name, day.date, day.mood, day.note, routines[].id, routines[].tasks[]).

5. ADD task deletion:
   - Add a small "x" button at the right edge of each task row (visible on hover).
   - Clicking it removes the task from the routine, updates the progress bar, and
     re-renders without full page reload.

6. FIX multiple routines layout:
   - If there are more than one routine, wrap all routine cards in a full-width
     grid column span so they don't disrupt the Date / Mood / Note card layout.
   - Alternatively, stack all routines into a single card with tab navigation between them.

7. FIX the drop target:
   - Attach the dragover/dragleave/drop event listeners to document.body instead of
     only the label element, so dragging a file anywhere onto the drop screen works.

8. ADD mood picker dismiss on outside click:
   - Add a one-time document click listener when the mood picker opens that closes
     the picker if the click target is outside the mood card.
   - Also close on Escape key.

9. ADD date validation with a friendly error:
   - In the loadJSON function, after parsing, check that new Date(state.day.date)
     is a valid date. If not, show an inline error message below the drop zone instead
     of an alert(), with a hint like: 'day.date must be in YYYY-MM-DD format.'