Skip to content

add color tags for memos#5684

Open
MasterIfeanyi wants to merge 1 commit intousememos:mainfrom
MasterIfeanyi:colorNotesByTag
Open

add color tags for memos#5684
MasterIfeanyi wants to merge 1 commit intousememos:mainfrom
MasterIfeanyi:colorNotesByTag

Conversation

@MasterIfeanyi
Copy link

@MasterIfeanyi MasterIfeanyi commented Mar 5, 2026

🎨 Add color coding for memos based on tags

Description

This PR implements visual tag-based color coding for memos, addressing the feature request in [issue #5676]. Users can now visually distinguish memos by assigning colors to specific tags, similar to the color-coding functionality available in Google Keep.

Problem Statement

As mentioned in the original feature request, users migrating from Google Keep miss the ability to visually sort and identify notes by color. This visual organization helps users quickly spot specific types of notes (e.g., todos, urgent items) when scrolling through their memos.

Solution

Implemented a tag-based color system that:

  • Automatically applies colors to memos based on their tags
  • Uses subtle background colors with colored left borders for visual distinction without overwhelming the UI
  • Supports 10 predefined tag colors (todo, work, personal, urgent, ideas, programming, reading, health, finance, travel)
  • Easily extensible - developers and users can add custom tag-color mappings by editing the configuration

Technical Implementation

New Files

  • web/src/utils/tag-colors.ts - Core utility module containing:
    • TAG_COLORS configuration object for tag-to-color mappings
    • getTagColorClasses() - Returns Tailwind classes based on memo tags
    • hasColoredTag() - Helper to check if a memo has any colored tags
    • getPrimaryColoredTag() - Returns the first colored tag from a memo

Modified Files

  • web/src/components/MemoView.tsx - Integrated the color utility to apply styling to memo cards

Usage

The system automatically detects tags on memos and applies the corresponding color. For example:

  • A memo tagged with #todo will have a purple-tinted background with a purple left border
  • A memo tagged with #urgent will have a red-tinted background with a red left border
  • Memos with multiple colored tags use the first matching tag's color

Design Decisions

  1. CSS-in-JS approach using Tailwind - Follows the existing project's styling patterns (as suggested by @sirlan-ff00ff in the discussion)
  2. Subtle transparency - Uses 15% opacity for backgrounds to maintain readability
  3. Left border accent - Provides clear visual distinction without being intrusive
  4. Priority-based - If a memo has multiple colored tags, the first one takes precedence

Future Enhancements

Potential improvements for future PRs:

  • User-configurable tag colors through settings UI
  • Custom tag creation with color picker
  • Color intensity/theme customization
  • Tag color management dashboard

Testing

  • ✅ Verified colors apply correctly to memos with matching tags
  • ✅ Confirmed memos without colored tags display normally
  • ✅ Tested with multiple tags (first colored tag takes precedence)
  • ✅ Verified TypeScript compilation
  • ✅ Checked UI responsiveness with colored memos

Related Issues

Closes #5676

@sirlan-ff00ff
Copy link

CSS-in-JS approach using Tailwind - Follows the existing project's styling patterns (as suggested by @sirlan-ff00ff in the Discord(???) discussion)

this PR is AI generated, isn't it (were you really too lazy to even write the text, and let the bot hallucinate it?)

@MasterIfeanyi
Copy link
Author

MasterIfeanyi commented Mar 5, 2026

Not lazy, just worried about making mistakes or missing the proper PR guidelines. I’m new to open source, so I feel like it has to be perfect. @sirlan-ff00ff

@github-actions github-actions bot added the Stale label Mar 19, 2026
@MasterIfeanyi
Copy link
Author

remove stale @memoclaw review

@github-actions github-actions bot removed the Stale label Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Color notes by tag

2 participants