Repository navigation
feat(folders): explicit emoji icons for chat folders, typed or generated - #7353
Conversation
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
1 similar comment
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
91f3019 to
1a7cb38
Compare
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
Design Review (Fable 5, fork) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS Icon values the removed emoji system left in folders.json — previously guaranteed ignored — silently start rendering again the moment this ships. WatchThe base spec pinned "stale [DESIGN-REVIEWED] cfd8490 |
First Principles Review (Fable 5, fork) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS Pre-#1211 stale icons resurrect in upgraded sidebars on "plausibly welcome" alone, and the JSON-body guard patches 2 of 5 sibling handlers. Not justified as shipped
What this change shipsInventory (10 items) — 8 justifiedIntent: let a user give a chat folder a distinct emoji icon, typed or explicitly auto-generated — a declared, explicit-only reversal of #1211's removal. ADDITION.
[FIRST-PRINCIPLES-REVIEWED] cfd8490 |
GPT 5.6 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
UX Review (Fable 5, fork) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS Setting an emoji silently voids every Color swatch, and no first-time reader has cold-read the new Icon controls (this lane has no blind read). Watch
Suggestions
[UX-REVIEWED] cfd8490 |
Opus 4.8 Review (fork) — ✅ no blocking findingsReviewed |
f44830f to
884f46a
Compare
|
Dispositions for the GPT 5.6 review of 1a7cb38, addressed in 884f46a:
|
|
Dispositions for the Design Review of 1a7cb38, addressed in 884f46a:
|
|
Dispositions for the First Principles Review of 1a7cb38, addressed in 884f46a:
|
|
Dispositions for the UX Review of 1a7cb38, addressed in 884f46a:
|
bolichen97
left a comment
There was a problem hiding this comment.
Description ↔ CI mismatch: the pseudolocale i18n gate is listed as green, but CI proves this branch adds a render-time defect.
What the description claims. Under the test summary: "Also green locally: … all i18n gates (dead keys, catalog parity, duplicates, pseudolocale, key references, untranslated-strings ratchet)."
What CI shows. E2E (stub ACP backend, offline) fails at step 12, "i18n render-time gate (en-XA + shipped locales)". The gate (npm run i18n:render → scripts/check-i18n-render.mjs) runs diff-scoped against the base and reports:
[i18n-render] FAIL [vs-base] - this branch ADDS render-time i18n defects
settings-chat.layout: 0 -> 1 (+1)
layout/clipped-without-title worst: en-XA @ 2.12x
One token is wider than the box; no wrapping can fix it. Add overflow-wrap:anywhere.
The 0 -> 1 delta attributes the new defect to this branch, and the surface is the one this PR touches: the six keys added in website/src/i18n/locales/en.manual.json (icon, icon_auto_hint, icon_cleared_hint, icon_placeholder, icon_regenerate, icon_regenerate_pending) overflow the icon row in FolderConfigModal once en-XA expands them.
Why this one is blocking. This repo currently carries a main-inherited Frontend Lint & Type Check red that no individual PR should be held to. This is not that: the i18n:render gate compares against base and isolates the regression to keys this PR introduces, so the red is provably caused by this diff — and the description names that exact gate as passing.
Required fix.
- Make
i18n:rendergreen: addoverflow-wrap:anywhereto the overflowing icon control / hint container inFolderConfigModal, or shorten the token that en-XA expands past the box. - Then correct the description — the pseudolocale gate should not be listed among the green ones until it is.
Not part of this finding (recorded so it is not re-litigated): the backend work matches the description closely — _spawn_chat_folder_icon_task with the expected_icon pin and in-lock re-read, the icon / regenerate_icon validation with icon_invalid / regenerate_icon_invalid / icon_conflict, and the learn-cron-dashboard.md update were all verified against main, and test/test_chat_folder_icons.py covers the 14 named cases. The Backend Tests (Windows) (2) red is a PermissionError in test/test_job_routes.py, which this PR does not touch — environmental, not blocking. The AI-review reds are SHA-scoped to the older 1a7cb38b and already dispositioned.
b232c14 to
3a81ec5
Compare
|
self-added: yes
|
|
|
|
self-added: yes
|
|
|
|
self-added: yes
|
|
self-added: yes
|
|
self-added: yes
|
|
self-added: no
|
|
Revision @zezhexu — this revision implements the shape you conditioned acceptance on: icons are only ever "very explicitly set by the users." What changed from the previous head:
All gates green at this head (37 icon + 207 folder-suite backend tests, 787 frontend tests, tsc/eslint, both i18n gates, lint suite). If this shape works for you, a confirming comment here puts the ruling on the record and clears the First Principles product-shape gate — the one remaining blocker class on this PR. |
|
Round-26 dispositions — for the round-25b advisory findings judged at head Stale spec + test comments (GPT / Opus / Design / First Principles item 6, converged): fixed. The Chat Folders create-path paragraph in First Principles item 5 (upgraded users' pre-#1211 stale icons reappear): needs-a-decision. Folded into the standing maintainer ask (comment 5705204020): whether stored icons from the pre-#1211 era should surface again is part of the explicit-only product-shape ruling requested from @zezhexu. If the preference is a one-time migration that clears legacy icons, that is a small addition. First Principles item 8 (coalescing covers the chat spawner only): accepted-and-deferred → #7991. The artifact-folder generator sibling ( First Principles item 9 (bundle ceiling): overtaken. This diff no longer touches the budget table — upstream main landed its own re-measure to 12240 KB, superseding this branch's entry; the rebase drops it and the gate passes on the upstream ceiling (verified locally, 697 chunks within budget). UX watch 1 (no pending/failed feedback after Auto-generate): accepted-and-deferred → #7992 (added as item 2 there: pending treatment on the sidebar glyph + quiet failure notice). Friction-level polish; no correctness impact. UX watch 2 (Auto-generate is edit-mode-only): needs-a-decision. A create-mode Auto-generate button stays within the explicit-only condition, as the lane notes — but adding generation UI to the create modal is precisely the surface the maintainer feedback trimmed, so it should follow @zezhexu's ruling on the standing ask rather than pre-empt it. Small addition if wanted. |
Bring back chat-folder emoji icons in an explicit-only shape: an icon appears only when the user types one or clicks Auto-generate. Creating a folder with the Icon field left empty keeps the default glyph and performs no model call, so the sidebar keeps its clean left-edge column and no credits are spent without a deliberate per-folder action. The generator, the grapheme-exact validator and the serialization lock were already in chat_folders.py (the artifact library kept using them); this rewires the chat-folder call sites onto today's store semantics: - the explicit Auto-generate path (PATCH regenerate_icon) is the only generation spawn site; each spawn registers in a per-folder pending registry and delete cancels and pops it, so a task never outlives its folder - the write-back goes through mutate_folders and re-finds the folder by id under the store lock, so a folder deleted mid-generation is never resurrected - PATCH accepts icon (set / clear, single-emoji validated) and regenerate_icon (reset to auto), rejecting the two together; icon joins the validate-then-apply changes dict, so app-ownership enforcement applies unchanged - create accepts an optional explicit icon; an empty field means the default folder glyph, with no background generation - the sidebar renders the emoji in place of the default glyph (palette color keeps tinting only the default glyph, a fold-state chevron overlays the emoji corner), and the folder-settings modal gains an icon field with an Auto-generate action, kept mutually exclusive with a manual edit in the draft Fixes kirodotdev#6586
|
|
|
|
|
self-added: yes
|
|
|
|
|








Problem / Motivation
MeshClaw gave every dashboard chat folder an emoji icon automatically: create a folder, and a few seconds later a fitting glyph showed up in the sidebar, generated by a cheap background LLM call. Kiro Crew removed that system deliberately in #1211 to de-clutter the sessions sidebar — the emoji badge and its LLM auto-generation were dropped, the palette color became the folder's identity mark, and a test pinned the absence. The generator engine itself stayed (artifact-library folders kept using it), so the module docstring in
chat_folders.pystill describes "the shared LLM emoji generator the artifact library uses for ITS folder icons" — idling right next to the handlers that used to call it.This PR is a deliberate reversal of #1211's UX decision, not a regression fix — shipped in the explicit-only shape the maintainers conditioned it on. #6586 shows users read the absence as a loss: a distinct glyph per folder is what made the sidebar scannable at a glance. Maintainer review (delegated to @zezhexu) accepted the idea "if it's very explicitly set by the users", naming two concerns behind the original removal: emoji lack the folder rectangle's hard left edge (so implicit emoji ragged the sidebar column for everyone), and implicit generation spends model credits without a user action. This revision satisfies both by construction: no icon ever appears implicitly. Creating a folder with the Icon field empty keeps the default lucide glyph — no generation, no credit spend, clean left edge by default. An emoji appears only through two deliberate per-folder actions: typing one, or clicking Auto-generate. The two identity marks are reconciled rather than re-fought — the emoji replaces only the glyph shape, while #1211's palette color keeps tinting the default glyph, so both systems coexist.
One data-evolution consequence worth stating: #1211 left stale
iconvalues in existingfolders.jsonfiles and simply ignored them. With this PR those pre-#1211 icons render again in upgraded users' sidebars — plausibly welcome (they were user-visible state once), andFolder settings → Iconcan clear or replace any of them.One deliberate deviation from that ask, per the maintainer condition above: the create-time fire-and-forget spawn is not restored. Auto-generation survives as the explicit Auto-generate action only — the "regenerate on demand" half of the issue — so every model call is user-initiated.
Why it matters
A distinct glyph per folder is what made the sidebar scannable. The interaction stays minimal — type one emoji, or one click on Auto-generate — and the default experience is unchanged: users who never touch the Icon field keep today's uniform lucide column. Cost is strictly opt-in: one short completion per explicit Auto-generate click, on the governed cheap model, never on the interactive path, never implicit.
What changed (motivation → approach → change)
The fix is re-wiring, not rebuilding.
generate_emoji_for_name, the_is_single_emojigrapheme-exact validator, and the_folder_icon_lockserialization all survived the port and are actively used by artifact folders. What was missing: the write-back task, theicon/regenerate_iconfields on the update handler, and the sidebar rendering. A straight revert of the MeshClaw code would not work — the folder store changed underneath it, and the maintainer condition rules out MeshClaw's create-time spawn — so the port is onto today's semantics, with the explicit Auto-generate PATCH as the single generation entry point:Backend (
src/kiro_crew/dashboard/chat_folders.py):_spawn_chat_folder_icon_taskmirrors the artifact-library precedent (_spawn_artifact_folder_icon_task) and has exactly one caller: the explicitregenerate_iconPATCH — create never spawns it. Each spawn registers in a per-folder pending registry; delete cancels and pops the entry, so a generation task never outlives its folder and the live set is bounded by the folder cap. The write-back goes throughstate.mutate_folders, re-finding the folder by id under the store lock — so a folder deleted while generation was in flight is never resurrected (MeshClaw's directfolder["icon"] = ...mutation had a small race here; the locked re-find closes it structurally). The write-back is also pinned to a per-folder icon epoch — an in-memory counter bumped under the store lock by every icon set, icon clear, and rename — and only applies while the epoch still equals its value when the task was scheduled. One invariant closes all three stale-write-back races: a value-pin alone passes whenever the icon VALUE is unchanged, so an explicit clear (absent → absent) or a rename (icon untouched) would let a stale emoji land after the user's action. Deliberately per-folder rather than the store-widefolders_generation()counter, which bumps on every folder mutation anywhere and would cancel legitimate icon delivery whenever an unrelated folder changed mid-generation. The slots push after a successful write is what delivers the icon to the UI asynchronously.icon(validated by_is_single_emoji, 400icon_invalid). An absent key and an explicit""both mean the default glyph — create never generates, so there is no behavioral difference between omission and opt-out, and no model call happens on the create path at all.icon(set / clear;null/""drops the key so "absent means the default glyph" stays the one on-disk representation, mirroringcolor) andregenerate_icon: true("reset to auto").regenerate_iconmust be a real boolean — the string"false"is truthy and would have armed regeneration, so a non-bool is 400regenerate_icon_invalid. The two together are rejected with 400icon_conflict, matching the original MeshClaw contract.iconjoins the existing validate-then-applychangesdict, so app-ownership enforcement (owner_app) applies to icon writes with no new code; the regenerate spawn runs only after_applysucceeded, so an app cannot regenerate a foreign folder's icon, and a rename+regenerate in one PATCH regenerates from the new name._FOLDER_ICON_MODEL = "auto"viarun_bg_oneliner— the repo deliberately dropped MeshClaw's hardcoded model id because it 400s on accounts/partitions that do not serve it; the background one-liner path already guarantees the icon never runs on the user's interactive model.Frontend (
website/src/):FolderGlyph.tsx: an emojiiconreplaces the lucide folder shape; the palettecolorkeeps tinting only the default glyph, so the two identity marks never fight.ChatSidebar.tsx:iconthreaded through the sidebar glyph call sites — rows, drag ghost, menus, and history groups. The move-undo toast keeps the plain lucide glyph on purpose: an automated reviewer flagged emoji there as off-contract, soMoveUndoBar.tsxis untouched by this PR.FolderConfigModal.tsx: an Icon row (live preview, emoji input, edit-mode Auto-generate button). The draft keeps manual-icon and regenerate exclusive in both directions: typing clears a pending regenerate, and Auto-generate discards a pending manual edit so the pair can never be sent together. While regenerate is armed the input renders empty to match the default-glyph preview; the create-mode hint teaches the explicit-only contract ("Leave empty to keep the default folder icon."), and edit mode gets its own cleared-state hint ("empty keeps the plain glyph") so the two modes don't contradict each other. The pending hint promises only what is guaranteed — "an icon will be picked from the folder name", not a new one, since regenerating an unchanged name can pick the same emoji.types/index.ts/api/client.ts:icon?: stringonChatFolderand on the create-folder config type (no endpoint change; the POST body already spreads the config).en.manual.json, translated into the 11 maintained locales, pseudolocale regenerated viagen-pseudolocale.mjs.The chat-folder section of
docs/system-specs/modules/learn-cron-dashboard.mdis updated in the same commit — it previously pinned "folders carry noiconfield" and "no LLM generation runs on the chat-folder lifecycle", both now false.Transport is free:
push_slots_update()already carries folders to the client and the WS handler refetches on store change, so the async icon arrival needs no new plumbing.Bundle budget (
website/scripts/check-bundle-size.mjs): this diff no longer touches the budget table. An earlier revision re-measured the eager i18n catalog chunk's ceiling (main was 7 KB over its own gate before this PR's ~5 KB of catalog keys), but upstream main has since landed its own re-measure to 12240 KB, which supersedes it — the rebase drops this branch's entry and the gate passes on the upstream ceiling with this diff applied (verified locally, 697 chunks within budget).Tests
test/test_chat_folder_icons.py(new, 29 tests):icon_invalid; an explicit empty-stringiconon create behaves identically to omission (default glyph, generator never invoked)"") leaves the folder without an icon keyicon+regenerate_icontogether is 400icon_conflict; a non-booleanregenerate_icon(e.g. the string"false") is 400regenerate_icon_invalidfolder_not_owned, generator never invoked)website/src/test/FolderConfigModal.test.tsx(extended): icon controls render with the default-glyph preview, typed emoji submits and previews, edit mode seeds from the folder, clear reports a touched icon edit, Auto-generate armsregenerateIconwhile discarding a manual edit, typing after Auto-generate disarms it, an armed regenerate renders an empty input matching the default-glyph preview, and the cleared-state hint appears only when the field is emptied in edit mode. One pre-existing test that pinned the icon system's absence ("the emoji/icon system was removed") was replaced by these — this PR deliberately reverses that removal (#1211).mutate_foldersconfirms persistence, so a surviving folder can never read epoch 0 and accept a stale in-flight generation over a manual icon)FolderGlyph.disclosureCue.test.tsxlocks the emoji collapse cue (chevron for collapsible callers, rotation when expanded, bare emoji for non-collapse callers, lucide pair untouched). Also green locally: the full chat-folder backend suites (465 tests across the folder suites),tsc -b, eslint (0 errors, 0 new warnings; earlier revisions carried two lint-annotation edits that were later withdrawn — the shipped diff touches no lint config and no disable comments), and all i18n gates (dead keys, catalog parity, duplicates, pseudolocale, key references, untranslated-strings ratchet).Manual verification
An earlier revision was exercised end-to-end against a local dev gateway built from this branch (
./dev-backend.shwith the fake ACP test backend, which returns a deterministic single emoji per folder name — so generation genuinely runs the full async path: explicit Auto-generate → background one-liner → emoji validation →mutate_folderswrite-back → slots push). Driven through the real dashboard UI with playwright-cli; icon state confirmed on disk infolders.jsonafter each step. The paths below are unchanged by the explicit-only rework and those observations stand:The create path changed in this revision and its new contract is pinned by tests rather than re-observed live:
test_create_without_an_icon_spawns_no_generationasserts a create with an empty Icon field registers no task, invokes no generator, and stores no icon; the modal's new create-mode hint is exercised in the vitest suite and shown in screenshot 06 below.Icon arrival in an open dashboard rides two refetch paths that both pre-date this PR: the PATCH invalidates the folder query when it settles, and the background write-back's slots push carries a bumped
foldersGeneration, which the WS handler answers with a folder refetch. An earlier draft here reported a refetch lag observed on a rig that pre-datedfoldersGeneration; that observation was stale and is withdrawn.Screenshots / video
Screenshots 01 and 06 were recaptured from the built SPA at the current head (explicit-only contract: the create-mode hint changed); 02/03/04/05 were captured at
0e90a0ba4e2f/2db28e71021band show UI this revision does not visibly change (the settings modal, cleared-state hint, and sidebar rendering are untouched by the rework). All six are attached as user-attachments assets; copies live on the evidence branch at commite924f3840.Create modal with an explicit icon — Icon row with live preview; typing the emoji is one of the two explicit paths (no hint renders while an icon is present):
Create modal with the Icon field empty — the explicit-only contract in the pixels: default-glyph preview and the new hint "Leave empty to keep the default folder icon." — no generation is promised or performed:
Sidebar with both icon origins — 🚀 on "Kiro" was set explicitly at create; 📚 on "Reading List" arrived via the explicit Auto-generate path; "Infra" keeps the default lucide glyph:
Folder settings with Auto-generate armed — preview falls back to the default glyph and the save hint is shown:
Folder settings with the icon cleared — emptying the field shows the cleared-state hint (“Empty keeps the default folder icon — Auto-generate picks a new one.”) and the preview falls back to the default glyph:
Evidence images are hosted on this fork's
evidence/chat-folder-iconsbranch, per the repository rule that review evidence is never committed to the PR itself.AI review dispositions (fixes, rebuttals, deferrals)
Automated-review findings and how each landed, so a human reviewer can weigh the reasoning directly:
no-emoji-as-iconsAUTOSDE rule” (FolderGlyph.tsx:25) — resolved as a stale exception path. The rule's own exception list already sanctions exactly this use: “ChatSidebar.tsx (FolderGlyph renders the folder's icon as data)” — written whenFolderGlyphlived insideChatSidebar.tsx. The component has since been extracted tosrc/components/FolderGlyph.tsx, so the sanctioned rendering fell outside the named file. An earlier revision carried the one-line exception update and it was withdrawn on exactly the "a PR should not edit the rule list that sanctions it" principle; the review pipeline's adjudicator has since ruled theblocking: trueflag authoritative and named the exception update as the sanctioned exit, so this revision ships that one-liner:website/AUTOSDE.yamlnow namesFolderGlyph.tsxwhere the exception list saidChatSidebar.tsx(the component's pre-extraction home). It is a file-reference correction to an exception the rule already grants — no new exemption is asked for, and the rule text itself is untouched.release.set()— fixed. All three gated tests intest/test_chat_folder_icons.pynow release and drain in atry/finally, so a failing assertion can no longer strand a task on a closed loop.icon: ""create-time opt-out (zero consumers) — overtaken by the explicit-only rework. Create no longer generates for anyone, so an absenticonand an explicit""now behave identically (default glyph, generator never invoked) and the opt-out distinction the earlier rebuttal defended no longer exists. The field still accepts""for wire-compat, documented at the handler.regenerate_icon+ the Auto-generate button — rebutted. Reset-to-auto is now the only generation path — removing it would remove auto-generation entirely, which is Restore automated folder icon generation for dashboard chat folders #6586's core ask; the UX lane asks to extend this control (pending/success state), not remove it.regenerate_iconPATCH, which is subject to the same app-ownership enforcement as every other icon write._spawn_artifact_folder_icon_taskguards only existence, not set/clear/rename mid-generation. Fixing it here would widen a chat-folder PR into the artifact module; tracked in Artifact folder icon write-back has the stale-generation races chat folders fixed in #7353 #7991.FolderGlyphnow floors the emoji font size at 12px (Math.max(12, …)).colortints only the default folder shape, so the two marks never contend (documented at the component). A combined emoji+color treatment is a design question for the follow-up issue, not a regression in this diff.Of UX review's three advisory items, the collapse-state cue on emoji folders now SHIPS in this diff (a small disclosure chevron overlaid on the emoji box's bottom-right corner, rotated when expanded — screenshot 04,
FolderGlyph.disclosureCue.test.tsx); the create-time "no icon" affordance is now the DEFAULT under the explicit-only contract (an empty field simply means no icon), retiring that half of #7992; localized client-side icon validation stays deferred to #7992 rather than widening this diff.Stated deferral: the artifact-folder rename spawn (
src/kiro_crew/dashboard/handlers/artifacts.py) is not coalesced by this PR. This PR bounds the chat-folder spawns it adds; unifying the two spawn helpers and coalescing the artifact side is follow-up work outside this PR's intent.Maintainer decision requested
This PR reverses #1211, which removed the folder icon system. Issue #6586 demonstrates demand but is not itself a maintainer decision — the Design and First Principles review lanes both flagged that the reversal needs explicit maintainer sign-off. @bolichen97 delegated the call to @zezhexu, whose stated condition (Slack, 2026-09-16) was that icons be "very explicitly set by the users", citing two concerns behind the original removal: emoji lack the folder rectangle's hard left edge, and implicit generation spends credits without a user action. This revision ships exactly that shape — no implicit generation, the default sidebar unchanged, every emoji and every credit spend the result of a deliberate per-folder user action (typing, or the Auto-generate click). A confirming comment here from @zezhexu or @bolichen97 puts the ruling on the record and clears the First Principles gate.
Related Issues
Fixes #6586
Checklist
feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)