feat(project): asana icons, 12-col colors, bold sections, all-view menu, desc text color/size
- Project edit modal: color palette 12 columns; icon tabs [기본 아이콘] / [아사나 아이콘] (33 filled icons, value "asana:<name>", 6KB subset font material-symbols-asana.woff2) - Section names bold (board column, list group, rename input) - Inbox: clicking the left inbox area closes the task side panel - Replace top-right scope toggle with admin-only sidebar "전체 보기" (?scope=all, switches in place on project pages) - Description editor: text color and size; server keeps only validated color / font-size on plain spans (desc_inline_style) - Fix goals_meeting_ui [2e] for manual monthly target; bump asset versions Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -131,6 +131,22 @@ PROJECT_ICONS: tuple[str, ...] = (
|
||||
"build", # 도구
|
||||
)
|
||||
|
||||
# 아사나 아이콘(2026-10-08) — 아사나 프로젝트 아이콘과 같은 채워진 모양. 저장 값은 "asana:" + 이름,
|
||||
# 글꼴은 이 33개만 담은 채워진 Material Symbols(static/vendor/material-symbols/material-symbols-asana.woff2).
|
||||
# 이름을 늘리면 그 글꼴도 다시 받아야 한다(docs/PROJECT_MODULE.md 6-12).
|
||||
ASANA_ICON_PREFIX = "asana:"
|
||||
PROJECT_ASANA_ICONS: tuple[str, ...] = (
|
||||
"format_list_bulleted", "view_kanban", "view_timeline", "calendar_month",
|
||||
"rocket_launch", "group", "monitoring", "stars",
|
||||
"bug_report", "lightbulb", "language", "settings",
|
||||
"book_2", "desktop_windows", "check_circle", "adjust",
|
||||
"code_blocks", "campaign", "forum", "work",
|
||||
"article", "landscape", "extension", "id_card",
|
||||
"conversion_path", "speed", "workspace_premium", "steps",
|
||||
"shopping_basket", "map", "confirmation_number", "toll",
|
||||
"web",
|
||||
)
|
||||
|
||||
# 섹션(칸반 컬럼) 색상표 — 모든 편집창이 프로젝트 색상표(32색) 하나를 쓴다.
|
||||
# 섹션에서는 첫 칸(연회색 #c7c4c4, 아사나의 "색 없음")을 고르면 색 없음(NULL, 기본 회색 머리).
|
||||
STAGE_COLOR_PALETTE: tuple[str, ...] = COLOR_PALETTE
|
||||
@@ -288,8 +304,10 @@ def validate_color(color: Any) -> str:
|
||||
|
||||
|
||||
def validate_project_icon(icon: Any) -> str | None:
|
||||
"""프로젝트 아이콘 — PROJECT_ICONS 안의 이름만, 빈값/목록 밖은 None(첫 글자 표시)."""
|
||||
"""프로젝트 아이콘 — PROJECT_ICONS 안의 이름 또는 "asana:" + PROJECT_ASANA_ICONS 이름만, 빈값/목록 밖은 None(첫 글자 표시)."""
|
||||
v = norm_str(icon)
|
||||
if v.startswith(ASANA_ICON_PREFIX):
|
||||
return v if v[len(ASANA_ICON_PREFIX):] in PROJECT_ASANA_ICONS else None
|
||||
return v if v in PROJECT_ICONS else None
|
||||
|
||||
|
||||
@@ -867,6 +885,23 @@ _DESC_ALLOWED_CLASS: dict[str, str] = {"span": _MENTION_CLASS, "ul": "pj-checkli
|
||||
# 허용 태그 목록에 없어 태그는 이미 안 남지만, HTMLParser는 이 둘의 내용을
|
||||
# 별도 데이터로 넘기므로 handle_data 에서 따로 걸러야 한다.
|
||||
_DESC_RAW_TEXT_TAGS: frozenset[str] = frozenset({"script", "style"})
|
||||
# 글자 색·크기(서식 도구, 2026-10-08) — 평범한 span 의 style 에서 이 둘만, 정해진 형식만 남긴다.
|
||||
_DESC_STYLE_COLOR = re.compile(r"^(#[0-9a-f]{3}|#[0-9a-f]{6}|rgb\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*\))$", re.I)
|
||||
DESC_FONT_SIZES: frozenset[str] = frozenset({"12px", "18px", "22px", "28px"})
|
||||
|
||||
|
||||
def desc_inline_style(value: str) -> str:
|
||||
"""span style → "color: …; font-size: …" 중 허용된 것만(나머지 선언·url()·expression 등은 버림)."""
|
||||
kept: list[str] = []
|
||||
for decl in (value or "").split(";"):
|
||||
if ":" not in decl:
|
||||
continue
|
||||
prop, val = (x.strip().lower() for x in decl.split(":", 1))
|
||||
if prop == "color" and _DESC_STYLE_COLOR.match(val) and not any(k.startswith("color:") for k in kept):
|
||||
kept.append(f"color: {val}")
|
||||
elif prop == "font-size" and val in DESC_FONT_SIZES and not any(k.startswith("font-size:") for k in kept):
|
||||
kept.append(f"font-size: {val}")
|
||||
return "; ".join(kept)
|
||||
|
||||
|
||||
def _desc_escape_text(text: str) -> str:
|
||||
@@ -923,7 +958,7 @@ class _DescriptionSanitizer(HTMLParser):
|
||||
# span 은 멘션 칩일 때만 속성을 갖는다 — class 가 pj-mention 이 아니면
|
||||
# data-email 까지 통째로 버린다(평범한 span 으로만 남는다).
|
||||
if tag == "span" and (dict(attrs).get("class") or "").strip() != _MENTION_CLASS:
|
||||
allowed = frozenset()
|
||||
allowed = frozenset({"style"}) # 평범한 span — 글자 색·크기만(desc_inline_style)
|
||||
kept: list[str] = []
|
||||
for name, value in attrs:
|
||||
if name not in allowed:
|
||||
@@ -939,6 +974,10 @@ class _DescriptionSanitizer(HTMLParser):
|
||||
continue
|
||||
if name == "data-checked" and value.strip() != "true":
|
||||
continue
|
||||
if name == "style":
|
||||
value = desc_inline_style(value)
|
||||
if not value:
|
||||
continue
|
||||
kept.append(f'{name}="{_desc_escape_attr(value)}"')
|
||||
attr_text = (" " + " ".join(kept)) if kept else ""
|
||||
self.out.append(f"<{tag}{attr_text}>")
|
||||
|
||||
Reference in New Issue
Block a user