ledgerrz/IDEA.md
Daan Meijer a687d7ac4d
Some checks failed
linter / quality (push) Failing after 1m2s
tests / ci (8.3) (push) Failing after 52s
tests / ci (8.4) (push) Failing after 1m4s
tests / ci (8.5) (push) Failing after 1m5s
docs: Update IDEA.md with session achievements and implementation details
2026-06-15 23:41:11 +02:00

4.3 KiB

The idea behind this application is to be able to keep track of scores within Dynamics. A Dynamic is usually between two people, but it might be between multiple people. I don't think it currently makes sense to have a Dynamic for a single person, but there should not be a hard requirement for it to be that way. Users can have multiple Dynamics, even with the same people.

A Dynamic has scores (Ledgers?). In the definition of a score, some people have the power to add items that mutate the score. Others can add suggestions, which aren't automatically accepted, but instead are awaiting approval. These "Mutations" can have text or media attached to them. A Mutation also has a "chat stream" where it can be discussed, like a forum post. It should have an activity log, containing the chat stream, but also when it was created and when it was approved or denied.

A score (Ledger) also needs to have rules accompanied by it. These rules should just be a text field at first. These rules should not be editable by everybody.

Dynamics have a rules-segment too. Not all people within a dynamic can edit these. Dynamics have an activity log too, with a forum-post-like chat.

The interface should be in Vue, nicely structured into components and pages. Esthetic is BDSM centered, but clean. Start with dark mode, light mode (camouflaged as a more innocent, corporate esthetical theme) might be a good feature in the future.

Make use of inertia, laravel reverb for notifications, pest for tests. Make git commits for features.


Session Developments & Achievements

During this session, we successfully built out and verified several core architectural features of the Ledgerrz application:

  1. BEM Styling Refactoring (BDSM Theme first):

    • Replaced inline Tailwind classes across all core Vue pages and layout components (Dynamics/Index.vue, Dynamics/Create.vue, Dynamics/Show.vue, Ledgers/Show.vue, ParticipantsList.vue, LedgerList.vue, CreateLedgerForm.vue, AddMutationForm.vue, and MutationList.vue) with structured BEM scoped CSS blocks.
    • Utilized Tailwind v4 @apply and @reference inside <style scoped> blocks to prevent code duplication, enforce a dark-first BDSM aesthetic, and maintain clear separation of concerns.
  2. Ledger Alignment & Scoring Logic:

    • Added an alignment column (positive, neutral, negative) to Ledgers, affecting the color coding of mutations:
      • Positive Alignment: higher score is better; additions are green (+), demerits/deductions are red (-).
      • Negative Alignment: lower score is better (demerits); deductions are green (-) as they reduce demerits, and additions/infractions are red (+) as they increase demerits.
      • Neutral Alignment: standard scoring, styled in gray/neutral colors.
    • Added an "Alignment" dropdown selector in the ledger creation form.
  3. Demerit Authorship Correction:

    • Corrected database seeders so demerits/penalty mutations are authored by the Dominant/Owner user (alice or testUser) rather than the submissive (bob), aligning with realistic power exchange dynamics.
  4. Read Cursor & Dashboard Activities Highlights:

    • Designed and built a polymorphic read_cursors table to track a user's last-viewed timestamp on individual Dynamics and Ledgers.
    • Developed ActivityService to chronological sort and partition dynamic activity (messages, ledger creation) and ledger activity (mutations, approval updates, and comments) into unread vs. read categories.
    • Highlighted unread entities grouped together on the user's dashboard, displaying the last two already-read items as muted context followed by highlighted unread activities with a prominent NEW badge.
    • Visiting a Dynamic/Ledger automatically updates its read cursor, removing it from subsequent dashboard loads.
    • Dynamically shared the unread entity count as a global Inertia prop, rendering a vibrant red dot notification badge over a bell icon in the top-right of the header.
  5. Broadcasts, Environment & Verification:

    • Configured real-time notifications utilizing Laravel Reverb.
    • Documented CLI environment test pollution learnings inside AGENTS.md to prevent future CSRF 419 errors.
    • Ensured full production assets compilation (npm run build) and achieved 45/45 passing Pest PHP tests with 206 assertions.