palette tooltip: contextual description per lock state; earned date below Unlocked in green — TDD
- _palettes_for_user: shoptalk→description; "available by default" / "explore to unlock" / "recognized via {Title}"; unlocked_date key carries earned_at ISO for Note-unlocked
- template: data-shoptalk→data-description; data-unlocked-date now holds ISO datetime (was literal "Default")
- dashboard.js: lockText drops "— Default"; dateLine renders "Apr 22, 2026 · 3:05 AM" after Unlocked line
- _palette-picker.scss: tt-shoptalk→tt-description in display:block list; tt-date added
- _tooltips.scss: .tt-date mirrors .tt-expiry w. --priGn colour
Code architected by Disco DeDisco <discodedisco@outlook.com>
Git commit message Co-Authored-By:
Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -358,7 +358,7 @@ class NotePaletteContextTest(TestCase):
|
||||
bardo = next(p for p in palettes if p["name"] == "palette-bardo")
|
||||
self.assertFalse(bardo["locked"])
|
||||
|
||||
def test_note_palette_shoptalk_contains_note_title(self):
|
||||
def test_note_palette_description_contains_note_title(self):
|
||||
Note.objects.create(
|
||||
user=self.user, slug="stargazer", earned_at=timezone.now(),
|
||||
palette="palette-bardo",
|
||||
@@ -366,7 +366,41 @@ class NotePaletteContextTest(TestCase):
|
||||
response = self.client.get("/")
|
||||
palettes = response.context["palettes"]
|
||||
bardo = next(p for p in palettes if p["name"] == "palette-bardo")
|
||||
self.assertIn("Stargazer", bardo["shoptalk"])
|
||||
self.assertIn("Stargazer", bardo["description"])
|
||||
|
||||
def test_default_palette_description_is_available_by_default(self):
|
||||
response = self.client.get("/")
|
||||
palettes = response.context["palettes"]
|
||||
default = next(p for p in palettes if p["name"] == "palette-default")
|
||||
self.assertEqual(default["description"], "available by default")
|
||||
|
||||
def test_locked_palette_description_is_explore_to_unlock(self):
|
||||
response = self.client.get("/")
|
||||
palettes = response.context["palettes"]
|
||||
bardo = next(p for p in palettes if p["name"] == "palette-bardo")
|
||||
self.assertEqual(bardo["description"], "explore to unlock")
|
||||
|
||||
def test_note_palette_description_is_recognized_via(self):
|
||||
Note.objects.create(
|
||||
user=self.user, slug="stargazer", earned_at=timezone.now(),
|
||||
palette="palette-bardo",
|
||||
)
|
||||
response = self.client.get("/")
|
||||
palettes = response.context["palettes"]
|
||||
bardo = next(p for p in palettes if p["name"] == "palette-bardo")
|
||||
self.assertEqual(bardo["description"], "recognized via Stargazer")
|
||||
|
||||
def test_note_palette_entry_includes_unlocked_date_iso(self):
|
||||
earned = timezone.now()
|
||||
Note.objects.create(
|
||||
user=self.user, slug="stargazer", earned_at=earned,
|
||||
palette="palette-bardo",
|
||||
)
|
||||
response = self.client.get("/")
|
||||
palettes = response.context["palettes"]
|
||||
bardo = next(p for p in palettes if p["name"] == "palette-bardo")
|
||||
self.assertIn("unlocked_date", bardo)
|
||||
self.assertEqual(bardo["unlocked_date"], earned.isoformat())
|
||||
|
||||
def test_note_without_palette_field_keeps_swatch_locked(self):
|
||||
Note.objects.create(
|
||||
|
||||
Reference in New Issue
Block a user