17 Commits

Author SHA1 Message Date
king cd0a509215 feat(project): add help search and detailed guides 2026-10-03 09:41:09 +09:00
king 7647e4b20f feat(project): add cell moves and width menus 2026-10-03 08:55:15 +09:00
king 2c8542339d fix(project): fit goal rows to text height 2026-10-03 07:59:22 +09:00
king b32f2ac3a3 feat(project): auto-fit goal column widths 2026-10-03 06:55:00 +09:00
king e726f986db perf(project): smooth sidebar resizing
Batch drag updates per frame and defer full layout recalculation until release. Cover resize edge cases and retain goals review records.
2026-10-03 06:45:56 +09:00
king 36a6866b96 style(project): compact toolbar and reset icon 2026-10-03 06:29:50 +09:00
king db39d3b383 fix(project): anchor toolbar above selected cell 2026-10-03 06:23:03 +09:00
king dc2008c5b3 feat(project): add Excel font controls and reflow 2026-10-03 05:47:57 +09:00
king 494d84f7c2 feat(project): add group collapse and UI polish 2026-10-03 05:26:41 +09:00
king 44f6ca4ef7 style(project): reduce board column and card corner radius 2026-10-02 18:02:40 +09:00
king 7f9c7a24d3 style(project): change board column background to ececec 2026-10-02 17:58:19 +09:00
king 22af196d56 feat(project): add Asana-style board completion checks 2026-10-02 17:55:31 +09:00
king 20232baf06 feat(project): add font options and selected goal text formatting
Restore the board header add button to the task side panel while keeping footer quick entry. Add safe, persisted goal text formatting and self-hosted Project font preferences with shared help updates and regression coverage.
2026-10-02 17:28:54 +09:00
king 035cb83d6f feat(project): add inline board tasks and reorder subtasks 2026-10-02 16:38:01 +09:00
king 114af59b26 fix(project): show completed subtasks with filled green checks 2026-10-02 16:13:52 +09:00
king 6a38fdb06a feat(project): match Asana typography sizes and weights 2026-10-02 16:03:52 +09:00
king d387048ebf feat(project): apply Asana system fonts to Project screens
Override the font token only on Project pages, preserve icon and monospace fonts, and update CSS/JS cache versions. Match the image viewer font stack as well.
2026-10-02 15:15:46 +09:00
51 changed files with 3834 additions and 271 deletions
+81 -5
View File
@@ -2275,8 +2275,13 @@ class ProjectStore:
def set_goal_cell(self, *, row_id: int, month: int, body: str, updated_by: str = "") -> None:
m = store.validate_goal_month(month, allow_year=True)
text = store.validate_goal_text(body)
with self._pool.connection() as conn:
if not conn.execute("SELECT 1 FROM goal_rows WHERE id = %s", (row_id,)).fetchone():
with self._pool.connection() as conn, conn.transaction():
# 빈 대상 칸을 포함해 일반 저장·이동·병합이 같은 영역 잠금으로 직렬화된다.
area = conn.execute(
"SELECT a.id AS area_id FROM goal_rows r JOIN goal_areas a ON a.id = r.area_id "
"WHERE r.id = %s FOR UPDATE OF a", (row_id,),
).fetchone()
if not area:
raise KeyError(row_id)
halves = self._table_exists(conn, "goal_cell_merges")
if m > 12 and not halves:
@@ -2285,7 +2290,7 @@ class ProjectStore:
raise store.GoalMigration017Needed()
if halves:
# 병합에 가려진 칸(글은 왼쪽 위 칸에만 둔다) — 다른 창에서 병합된 뒤의 늦은 저장
area_id = conn.execute("SELECT area_id FROM goal_rows WHERE id = %s", (row_id,)).fetchone()["area_id"]
area_id = area["area_id"]
ids, merges, _ = self._area_geometry(conn, int(area_id))
if self._covered_by(merges, ids.index(row_id), store.GOAL_COL_ORDER.index(m)):
raise ValueError("병합된 칸입니다. 새로고침해 주세요.")
@@ -2299,6 +2304,77 @@ class ProjectStore:
(row_id, m, text, store.norm_str(updated_by, lower=True)),
)
def move_goal_cell(
self, *, source_row: Any, source_month: Any, target_row: Any, target_month: Any,
source_body: str, target_body: str, body: str, updated_by: str = "",
) -> str:
"""같은 연도 안에서 셀의 내용·서식을 이동한다. 두 값의 비교와 이동은 한 트랜잭션.
병합 시작 칸끼리도 내용만 이동하며 병합 배치·영역 색·열 너비는 유지한다.
응답만 유실된 요청을 다시 보내면 이미 같은 이동이 완료된 상태는 성공으로 돌려준다.
"""
try:
sr, tr = int(source_row), int(target_row)
except (TypeError, ValueError):
raise ValueError("이동할 셀이 올바르지 않습니다.")
sm = store.validate_goal_month(source_month, allow_year=True)
tm = store.validate_goal_month(target_month, allow_year=True)
if sr <= 0 or tr <= 0 or (sr, sm) == (tr, tm):
raise ValueError("서로 다른 두 셀을 골라 주세요.")
expected_source, expected_target = store.validate_goal_text(source_body), store.validate_goal_text(target_body)
moved = store.validate_goal_text(body)
if not expected_source or not moved or store.goal_text_plain(moved).strip() != store.goal_text_plain(expected_source).strip():
raise ValueError("원본 내용과 이동할 내용이 일치하지 않습니다.")
with self._pool.connection() as conn:
with conn.transaction():
rows = conn.execute(
"SELECT r.id, r.area_id, a.year FROM goal_rows r JOIN goal_areas a ON a.id = r.area_id "
"WHERE r.id = ANY(%s)", ([sr, tr],),
).fetchall()
by_id = {int(r["id"]): r for r in rows}
if sr not in by_id or tr not in by_id:
raise KeyError(sr if sr not in by_id else tr)
if by_id[sr]["year"] != by_id[tr]["year"]:
raise ValueError("같은 연도의 셀로만 이동할 수 있습니다.")
areas = sorted({int(r["area_id"]) for r in rows})
# 교차 영역 이동도 같은 순서로 잠가 교착을 피하고, 행 삭제도 함께 차단한다.
conn.execute("SELECT id FROM goal_areas WHERE id = ANY(%s) ORDER BY id FOR UPDATE", (areas,)).fetchall()
locked = conn.execute(
"SELECT id, area_id FROM goal_rows WHERE id = ANY(%s) ORDER BY id FOR UPDATE", ([sr, tr],),
).fetchall()
if len(locked) != len(by_id):
raise KeyError("이동할 줄이 삭제되었습니다.")
halves = self._table_exists(conn, "goal_cell_merges")
if (sm > 12 or tm > 12) and not halves:
raise store.GoalMigration014Needed()
if (sm in store.GOAL_Q_NEW or tm in store.GOAL_Q_NEW) and not self._goal_quarters(conn):
raise store.GoalMigration017Needed()
geometry = {a: self._area_geometry(conn, a) for a in areas} if halves else {}
for rid, month in ((sr, sm), (tr, tm)):
if halves:
ids, merges, _ = geometry[int(by_id[rid]["area_id"])]
if rid not in ids or self._covered_by(merges, ids.index(rid), store.GOAL_COL_ORDER.index(month)):
raise store.GoalCellConflict("병합 배치가 바뀌었습니다. 새로고침한 뒤 다시 이동해 주세요.")
cells = conn.execute(
"SELECT row_id, month, body FROM goal_cells "
"WHERE (row_id = %s AND month = %s) OR (row_id = %s AND month = %s) FOR UPDATE",
(sr, sm, tr, tm),
).fetchall()
values = {(int(c["row_id"]), int(c["month"])): store.validate_goal_text(c["body"]) for c in cells}
source, target = values.get((sr, sm), ""), values.get((tr, tm), "")
if not source and target == moved:
return moved
if source != expected_source or target != expected_target:
raise store.GoalCellConflict("원본 또는 대상 내용이 바뀌었습니다. 새로고침한 뒤 다시 이동해 주세요.")
conn.execute(
"INSERT INTO goal_cells (row_id, month, body, updated_by) VALUES (%s,%s,%s,%s) "
"ON CONFLICT (row_id, month) DO UPDATE "
"SET body = EXCLUDED.body, updated_by = EXCLUDED.updated_by, updated_at = now()",
(tr, tm, moved, store.norm_str(updated_by, lower=True)),
)
conn.execute("DELETE FROM goal_cells WHERE row_id = %s AND month = %s", (sr, sm))
return moved
# ── 엑셀식 사각형 병합 ─────────────────────────────────────────
@staticmethod
def _column_exists(conn: Any, table: str, column: str) -> bool:
@@ -2392,9 +2468,9 @@ class ProjectStore:
"SELECT row_id, month, body FROM goal_cells WHERE row_id = ANY(%s) AND month = ANY(%s)",
(rows_in, cols_in),
).fetchall()}
text = store.validate_goal_text("\n".join(
text = store.merge_goal_texts([
bodies[(r, m)] for r in rows_in for m in cols_in if bodies.get((r, m))
))
])
conn.execute(
"DELETE FROM goal_cell_merges WHERE row_id = ANY(%s) AND start_month = ANY(%s)",
(rows_in, cols_in),
+21 -2
View File
@@ -2567,7 +2567,8 @@ def _goal_area_layout(rows: list[dict[str, Any]], this_month: int) -> None:
kind = "year" if m == store.GOAL_YEAR else "quarter" if m in store.GOAL_COL_QUARTER else "month"
h = 0 if kind == "year" else store.GOAL_COL_QUARTER[m] if kind == "quarter" else store.goal_quarter_of(m)
out.append({"m": m, "kind": kind, "h": h, "span": span, "rspan": rspan,
"now": kind == "month" and m <= this_month <= m + span - 1})
"now": kind == "month" and m <= this_month <= m + span - 1,
"html": store.goal_text_html(row.get("cells", {}).get(m, ""))})
row["layout"] = out
@@ -2597,6 +2598,8 @@ def _goal_call(fn: Any, *args: Any, **kwargs: Any) -> Any:
raise HTTPException(status_code=503, detail=_GOALS_016_MSG)
except store.GoalMigration017Needed:
raise HTTPException(status_code=503, detail=_GOALS_017_MSG)
except store.GoalCellConflict as exc:
raise HTTPException(status_code=409, detail=str(exc))
except UndefinedTable:
raise HTTPException(status_code=503, detail=_GOALS_MIGRATION_MSG)
except KeyError:
@@ -2806,6 +2809,22 @@ def api_set_goal_cell(
return JSONResponse({"ok": True})
@router.post("/api/goals/cells/move")
def api_move_goal_cell(request: Request, payload: dict[str, Any] = Body(...)) -> JSONResponse:
"""내용·글자 서식만 원자적으로 이동. 원본·대상의 예상값이 바뀌면 409, 병합 배치는 유지."""
user = _require_admin(request)
st = _db_or_503(request)
if any(not isinstance(payload.get(k), str) for k in ("source_body", "target_body", "body")):
raise HTTPException(status_code=400, detail="이동할 내용과 두 칸의 현재 내용을 보내 주세요.")
body = _goal_call(
st.move_goal_cell, source_row=payload.get("source_row"), source_month=payload.get("source_month"),
target_row=payload.get("target_row"), target_month=payload.get("target_month"),
source_body=payload["source_body"], target_body=payload["target_body"], body=payload["body"],
updated_by=user["email"],
)
return JSONResponse({"ok": True, "body": body})
@router.post("/api/goals/areas/{area_id}/merge")
def api_merge_goal_rect(request: Request, area_id: int, payload: dict[str, Any] = Body(...)) -> JSONResponse:
"""엑셀식 병합 {row_from, row_to(줄 id), col_from, col_to(칸 번호 0·1~12·13~16)} — 같은 영역 안 사각형,
@@ -3062,7 +3081,7 @@ def _month_plan(st: Any, year: int, month: int) -> list[dict[str, Any]] | None:
if not row.get("label_cont"):
label = row.get("label") or ""
cell = next((c for c in row["layout"] if c["kind"] == "month" and c["m"] <= month <= c["m"] + c["span"] - 1), None)
text = (row["cells"].get(cell["m"], "") if cell else "").strip()
text = store.goal_text_plain(row["cells"].get(cell["m"], "") if cell else "").strip()
if not text:
continue
rng = f"{cell['m']}~{cell['m'] + cell['span'] - 1}월" if cell["span"] > 1 else ""
+83
View File
@@ -6,8 +6,10 @@ DB 없이 단위 테스트 가능한 순수 함수만 둔다(malaysia.store 패
from __future__ import annotations
import json
import re
from datetime import date, timedelta
from html import escape
from html.parser import HTMLParser
from typing import Any
@@ -395,6 +397,10 @@ class GoalMigration017Needed(RuntimeError):
"""2·4분기 글 칸(15·16)은 마이그레이션 017(분기) 뒤에만 된다."""
class GoalCellConflict(RuntimeError):
"""셀 이동 전에 다른 창에서 원본 또는 대상 내용이 바뀜."""
GOAL_YEAR = 0 # 업무 영역 글 칸 — 연간
# 분기 글 칸(2026-10-01 상·하반기 → 1~4분기). 칸 번호는 예전 반기 칸을 그대로 이어 쓴다 — 데이터 옮기기 없이
# 예전 상반기 글(13)은 1분기, 하반기 글(14)은 3분기에 보인다. 2분기(15)·4분기(16)는 마이그레이션 017 뒤에 저장.
@@ -475,11 +481,88 @@ def validate_goal_color(color: Any) -> str:
def validate_goal_text(body: Any) -> str:
v = str(body or "").replace("\r\n", "\n").strip()
if v.startswith(GOAL_RICH_PREFIX):
runs = goal_text_runs(v, strict=True)
if not "".join(r["text"] for r in runs).strip():
return ""
return GOAL_RICH_PREFIX + json.dumps(runs, ensure_ascii=False, separators=(",", ":"))
if len(v) > GOAL_TEXT_MAX:
raise ValueError(f"칸 하나에 {GOAL_TEXT_MAX}자까지 쓸 수 있습니다.")
return v
# 기존 TEXT 칸에 버전이 있는 텍스트 조각을 저장한다. 예전 평문은 그대로 유지한다.
GOAL_RICH_PREFIX = "pj-rich:v1:"
def goal_text_runs(body: Any, *, strict: bool = False) -> list[dict[str, Any]]:
value = str(body or "")
if not value.startswith(GOAL_RICH_PREFIX):
return [{"text": value}]
try:
raw = json.loads(value[len(GOAL_RICH_PREFIX):])
if not isinstance(raw, list) or len(raw) > GOAL_TEXT_MAX:
raise ValueError("서식 데이터가 올바르지 않습니다.")
runs = []
for item in raw:
if not isinstance(item, dict) or not isinstance(item.get("text"), str):
raise ValueError("서식 데이터가 올바르지 않습니다.")
run: dict[str, Any] = {"text": item["text"]}
for key in ("bold", "italic", "underline"):
if isinstance(item.get(key), bool):
run[key] = item[key]
if re.fullmatch(r"#[0-9a-fA-F]{6}", str(item.get("color", ""))):
run["color"] = item["color"].lower()
size = item.get("size")
if isinstance(size, int) and not isinstance(size, bool) and 10 <= size <= 32:
run["size"] = size
if run["text"]:
runs.append(run)
if sum(len(r["text"]) for r in runs) > GOAL_TEXT_MAX:
raise ValueError(f"칸 하나에 {GOAL_TEXT_MAX}자까지 쓸 수 있습니다.")
return runs
except (ValueError, TypeError) as err:
if strict:
raise ValueError("칸의 서식 데이터가 올바르지 않습니다.") from err
return [{"text": value}]
def goal_text_plain(body: Any) -> str:
return "".join(r["text"] for r in goal_text_runs(body))
def goal_text_html(body: Any) -> str:
"""허용한 글자 서식만 HTML로 만든다. 사용자 텍스트는 항상 escape한다."""
out = []
for run in goal_text_runs(body):
style = []
if "bold" in run:
style.append("font-weight:" + ("700" if run["bold"] else "400"))
if "italic" in run:
style.append("font-style:" + ("italic" if run["italic"] else "normal"))
if "underline" in run:
style.append("text-decoration:" + ("underline" if run["underline"] else "none"))
if "color" in run:
style.append("color:" + run["color"])
if "size" in run:
style.append(f'font-size:{run["size"]}px')
text = escape(run["text"])
out.append(f'<span style="{";".join(style)}">{text}</span>' if style else text)
return "".join(out)
def merge_goal_texts(bodies: list[str]) -> str:
values = [v for v in bodies if goal_text_plain(v).strip()]
if not any(v.startswith(GOAL_RICH_PREFIX) for v in values):
return validate_goal_text("\n".join(values))
runs = []
for value in values:
if runs:
runs.append({"text": "\n"})
runs.extend(goal_text_runs(value))
return validate_goal_text(GOAL_RICH_PREFIX + json.dumps(runs, ensure_ascii=False))
# ── 엑셀식 사각형 병합(마이그레이션 015) ──────────────────────────────
class GoalMigration015Needed(RuntimeError):
"""세로 병합·주간 회의록은 마이그레이션 015 뒤에만 된다."""
@@ -34,3 +34,4 @@
title="프로젝트 관리 도움말" aria-label="프로젝트 관리 도움말">
<span class="material-symbols-outlined">help</span>
</a>
{% include "project/_options.html" %}
@@ -0,0 +1,31 @@
<button type="button" class="pj-help-btn" id="pj-options-btn" aria-label="Project 옵션" title="Project 옵션">
<span class="material-symbols-outlined">settings</span>
</button>
<dialog class="pj-options-dialog" id="pj-options-dialog" aria-labelledby="pj-options-title">
<form id="pj-options-form">
<h2 id="pj-options-title">Project 옵션</h2>
<label for="pj-options-font">폰트</label>
<select id="pj-options-font" name="font">
<option value="system">기본 시스템 폰트</option>
<option value="pretendard">프리텐다드</option>
<option value="nanum-square">나눔 스퀘어</option>
<option value="nanum-square-neo">나눔 스퀘어 네오</option>
<option value="nanum-square-round">나눔 스퀘어 라운드</option>
</select>
<div class="pj-options-preview" id="pj-options-preview">프로젝트와 목표를 한눈에<br><b>Project · 업무 이름 · 가나다 123</b></div>
<p>이 브라우저의 모든 Project 화면에 적용됩니다.</p>
<p class="pj-options-error" id="pj-options-error" role="alert" hidden></p>
<div class="pj-options-actions">
<button type="button" class="pj-btn" id="pj-options-cancel">취소</button>
<button type="submit" class="pj-btn pj-btn-primary" id="pj-options-save">저장</button>
</div>
</form>
</dialog>
<script>
try {
var pf = localStorage.getItem("pj_font") || "system";
if (["system", "pretendard", "nanum-square", "nanum-square-neo", "nanum-square-round"].indexOf(pf) >= 0)
document.documentElement.dataset.pjFont = pf;
} catch (_) {}
</script>
<script src="/static/project-options.js?v=20261002g" defer></script>
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261002b" />
<link rel="stylesheet" href="/static/project.css?v=20261003f" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -296,5 +296,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20261002b" defer></script>
<script src="/static/project.js?v=20261003h" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261002b" />
<link rel="stylesheet" href="/static/project.css?v=20261003f" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -37,6 +37,31 @@
{% endif %}
</div>
{% if is_admin and goals_enabled and board %}
<div class="pj-goal-format" id="pj-goal-format" role="toolbar" aria-label="선택한 글자 서식" hidden>
<div class="pj-goal-format-group pj-goal-color-picker">
<button type="button" class="pj-goal-format-btn pj-goal-color-toggle" data-goal-format="color" aria-label="글자 색상" title="글자 색상" aria-expanded="false" aria-controls="pj-goal-color-grid" disabled><span class="pj-goal-color-letter" aria-hidden="true">가<span class="pj-goal-color-preview"></span></span><svg class="pj-goal-format-chevron" viewBox="0 0 10 10" fill="none" stroke="currentColor" stroke-width="1.3" aria-hidden="true"><path d="m2 4 3 3 3-3"/></svg></button>
<div class="pj-goal-color-grid" id="pj-goal-color-grid" role="group" aria-label="글자 색상 선택" hidden>
{% for color in ('#000000', '#4B5563', '#9CA3AF', '#DC2626', '#EA580C', '#CA8A04', '#16A34A', '#0891B2', '#2563EB', '#7C3AED', '#DB2777', '#FFFFFF') %}
<button type="button" class="pj-goal-text-swatch" data-goal-color="{{ color }}" style="--swatch: {{ color }}" title="{{ color }}" aria-label="{{ color }}" aria-pressed="false" disabled></button>
{% endfor %}
</div>
</div>
<div class="pj-goal-format-group" role="group" aria-label="글자 크기">
<button type="button" class="pj-goal-format-btn" data-goal-format="size-up" aria-label="글자 크기 2px 키우기" title="글자 크기 2px 키우기" disabled><span class="pj-goal-font-letter" aria-hidden="true">가</span><svg class="pj-goal-font-arrow" viewBox="0 0 10 14" fill="none" stroke="currentColor" stroke-width="1.2" aria-hidden="true"><path d="M5 9V2M2 5l3-3 3 3"/></svg></button>
<button type="button" class="pj-goal-format-btn" data-goal-format="size-down" aria-label="글자 크기 2px 줄이기" title="글자 크기 2px 줄이기" disabled><span class="pj-goal-font-letter" aria-hidden="true">가</span><svg class="pj-goal-font-arrow" viewBox="0 0 10 14" fill="none" stroke="currentColor" stroke-width="1.2" aria-hidden="true"><path d="M5 2v7M2 6l3 3 3-3"/></svg></button>
<output class="pj-goal-size-value" data-goal-format="size" aria-label="선택한 글자 크기">14px</output>
</div>
<div class="pj-goal-format-group" role="group" aria-label="글자 모양">
{% for key, label in (('bold', '굵게'), ('italic', '기울임'), ('underline', '밑줄')) %}
<button type="button" class="pj-goal-format-btn" data-goal-format="{{ key }}" aria-label="{{ label }}" title="{{ label }}" aria-pressed="false" disabled><span class="pj-goal-font-letter" aria-hidden="true">가</span></button>
{% endfor %}
</div>
<div class="pj-goal-format-group" role="group" aria-label="서식 초기화">
<button type="button" class="pj-goal-format-btn" data-goal-format="reset" aria-label="서식 초기화" title="서식 초기화" disabled><svg class="pj-goal-reset-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m16 3 5 5a2 2 0 0 1 0 3L11 21H7l-4-4a2 2 0 0 1 0-3L13 3a2 2 0 0 1 3 0Z"/><path d="m8 9 7 7M11 21h10"/></svg></button>
</div>
</div>
{% endif %}
<div class="pj-view pj-goal-pane" id="pj-goal-pane">
{% if not goals_enabled %}
<div class="pj-empty">연간 목표가 아직 준비되지 않았습니다(DB 마이그레이션 013 필요).</div>
@@ -166,10 +191,11 @@
{% if c.kind in ('month', 'quarter') %}data-h="{{ c.h }}" {% endif %}data-month="{{ c.m }}" data-span="{{ c.span }}" data-rspan="{{ c.rspan }}"
{%- if c.span > 1 %} colspan="{{ c.span }}" style="--span: {{ c.span }}"{% endif %}{% if c.rspan > 1 %} rowspan="{{ c.rspan }}"{% endif %}>
{%- if editable -%}
<textarea class="pj-goal-text" rows="1" data-row="{{ row.id }}" data-month="{{ c.m }}"
placeholder="{{ '연간 목표' if c.m == 0 else ((c.h ~ '분기 목표') if c.kind == 'quarter' else '') }}">{{ row.cells.get(c.m, '') }}</textarea>
<div class="pj-goal-text" contenteditable="true" role="textbox" aria-multiline="true" aria-label="목표 내용"
data-row="{{ row.id }}" data-month="{{ c.m }}"
data-placeholder="{{ '연간 목표' if c.m == 0 else ((c.h ~ '분기 목표') if c.kind == 'quarter' else '') }}">{{ c.html|safe }}</div>
{%- else -%}
<div class="pj-goal-text-ro">{{ row.cells.get(c.m, '') }}</div>
<div class="pj-goal-text-ro">{{ c.html|safe }}</div>
{%- endif -%}
</td>
{% endfor %}
@@ -181,7 +207,8 @@
{% if is_admin %}
<div class="pj-goal-foot">
<button type="button" class="pj-btn" id="pj-goal-area-add">+ 업무 영역 추가</button>
<span class="pj-goal-note">칸을 고치면 바로 저장됩니다. 숫자 칸을 비우면 지워집니다. 구역·항목 칸을 우클릭하거나 칸의 ⋮ 버튼(키보드 Tab·Enter, 터치)을 누르면 색·순서·줄 추가·삭제 메뉴가 나옵니다.
<span class="pj-goal-note">칸을 고치면 바로 저장됩니다. 글자를 드래그해 선택하면 선택한 셀 상단에서 12색 견본·크기 2px 증감·굵게·기울임·밑줄·서식 초기화를 사용할 수 있습니다. 모든 행의 셀 오른쪽 경계를 끌어 열 너비를 조절하고, 더블클릭하면 그 열의 가장 긴 문단에 맞춥니다. 숫자 칸을 비우면 지워집니다. 구역·항목 칸을 우클릭하거나 칸의 ⋮ 버튼(키보드 Tab·Enter, 터치)을 누르면 색·순서·줄 추가·삭제 메뉴가 나옵니다.
셀 우클릭 → 현재 열·전체 열 너비 자동 맞춤(접힌 열 포함). 글 칸 하나를 클릭한 뒤 위·아래·왼쪽 테두리를 끌면 내용과 서식이 함께 이동합니다(대상에 글이 있으면 덮어쓰기 확인, Esc로 취소).
{%- if board.halves %} 칸을 마우스로 끌어 여러 칸을 고른 뒤 우클릭 → 셀 병합, 병합된 칸은 우클릭 → 병합 해제(글은 왼쪽 위 칸에 남음).{% endif %}
월 이름을 누르면 그 달 주간 회의록이 열립니다.</span>
</div>
@@ -196,5 +223,6 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20261002b" defer></script>
<script src="/static/project-goal-text.js?v=20261003c" defer></script>
<script src="/static/project.js?v=20261003h" defer></script>
{% endblock %}
+195 -52
View File
@@ -1,8 +1,8 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261002b" />
<link rel="stylesheet" href="/static/project-help.css?v=20260926v" />
<link rel="stylesheet" href="/static/project.css?v=20261003f" />
<link rel="stylesheet" href="/static/project-help.css?v=20261003a" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -11,7 +11,7 @@
{% block content %}
{# ── 프로젝트 관리 도움말 — 처음 쓰는 사람을 위한 기능 안내(정적 페이지, DB 불필요).
기능이 바뀌면 이 페이지도 같이 고친다(docs/PROJECT_MODULE.md 와 짝). ── #}
<div class="pjh">
<div class="pjh" id="top">
<nav class="pjh-toc" aria-label="도움말 목차">
<p class="pjh-toc-title">목차</p>
<ol>
@@ -34,13 +34,29 @@
<li><a href="#inbox">수신함과 알림</a></li>
<li><a href="#search">전체 검색과 공유 링크</a></li>
<li><a href="#trash">휴지통 (관리자)</a></li>
<li><a href="#goals">연간 목표</a></li>
<li><a href="#meetings">주간 회의록</a></li>
<li><a href="#tips">단축키와 자주 묻는 질문</a></li>
</ol>
</nav>
<div class="pjh-body">
<div class="pjh-search" id="pjh-search" hidden>
<form id="pjh-search-form" role="search" aria-label="도움말 검색">
<label for="pjh-query">도움말 검색</label>
<div class="pjh-search-field">
<input type="search" id="pjh-query" name="q" placeholder="예: 회의록, 셀 병합, 쇼핑몰 연결" autocomplete="off"
aria-describedby="pjh-search-hint pjh-search-status" aria-controls="pjh-results" />
<button type="submit">검색</button>
<button type="button" id="pjh-search-clear" hidden>지우기</button>
</div>
<p class="pjh-search-hint" id="pjh-search-hint">한 글자부터 제목·본문을 검색합니다. 결과를 누르면 해당 설명으로 바로 이동합니다. 여러 단어는 띄어 쓰세요.</p>
</form>
<p class="pjh-search-status" id="pjh-search-status" role="status" aria-live="polite" aria-atomic="true"></p>
<ol class="pjh-results" id="pjh-results" aria-label="도움말 검색 결과" hidden></ol>
</div>
<!-- 머리말 + 빠른 시작 -->
<header class="pjh-hero" id="top">
<header class="pjh-hero">
<h1>프로젝트 관리 도움말</h1>
<p>프로젝트 관리는 <b>아사나(Asana) 방식</b>으로 팀의 일을 정리하는 도구입니다.
프로젝트 안에 할 일(작업)을 만들고, 담당자와 마감일을 정하고, 댓글로 이야기하며 끝까지 챙깁니다.
@@ -52,6 +68,7 @@
<div class="pjh-quick-step"><b>4단계</b>카드를 눌러 설명을 쓰고, 댓글에 <kbd>@</kbd>로 동료를 부릅니다.</div>
<div class="pjh-quick-step"><b>5단계</b>일을 마치면 <span class="pjh-ui">✓ 완료로 표시</span>를 누릅니다.</div>
</div>
<p class="pjh-quick-links">계획과 회의를 준비한다면 <a href="#goals">연간 목표</a> · <a href="#meetings">주간 회의록</a> 설명부터 읽어 보세요.</p>
</header>
<!-- 1. 용어 -->
@@ -78,7 +95,7 @@
<section class="pjh-sec" id="layout">
<h2><span class="pjh-num">2</span>화면 구성</h2>
<div class="pjh-map" aria-hidden="true">
<div class="pjh-map-top"><span><b>위쪽 바</b>화면 이름</span><span>🔔 알림 · 내 이름 · 로그아웃 · <b style="display:inline">?</b> 도움말</span></div>
<div class="pjh-map-top"><span><b>위쪽 바</b>화면 이름</span><span>🔔 알림 · 내 이름 · 로그아웃 · <b style="display:inline">?</b> 도움말 · 옵션</span></div>
<div class="pjh-map-side"><b>왼쪽 사이드바</b>전체 검색<br>수신함 · 내 작업 · 휴지통 · 목표<br>프로젝트 목록<br>완료 프로젝트<br>전체 멤버</div>
<div class="pjh-map-main"><b>가운데 작업 영역</b>왼쪽 위: 프로젝트 제목 · 멤버<br>그 아래: 보기 탭(보드 · 목록 · 캘린더 · 타임라인 · 대시보드)<br>오른쪽 위: 범위(이 프로젝트 / 전체 프로젝트)<br>필터 바<br>작업들</div>
</div>
@@ -88,26 +105,9 @@
<li><b>수신함</b> — 나를 태그한 작업과 알림. 숫자 배지는 아직 확인하지 않은 @태그 수입니다. (<a href="#inbox">17장</a>)</li>
<li><b>내 작업</b> — 내가 담당자인 작업 모음. 숫자 배지는 아직 끝나지 않은 작업 수입니다. (<a href="#mytasks">15장</a>)</li>
<li><b>휴지통</b> — 지운 작업을 3개월 보관합니다. 관리자에게만 보입니다. (<a href="#trash">19장</a>)</li>
<li><b>목표</b> — 누르면 바로 아래에 연도가 펼쳐집니다. 연도를 누르면 오른쪽에 그해 전체 목표가 한 표로 나옵니다 —
맨 위에 <b>매출</b>(목표·실적·달성률)과 <b>로아스</b>(목표·실적, 단위 %)를 달마다, 그 아래에 <b>업무 영역</b>(상품·마케팅·컨텐츠·유통 등)별로
연간·분기·월별 계획을 적습니다. 3·6·9·12월 오른쪽에 <b>1~4분기</b> 칸이 있고, 매출의 <b>연간·분기</b> 칸은 월 합계,
<b>달성</b>은 실적÷목표(100% 이상 초록)로 저절로 계산됩니다. 분기 칸 머리의 <b>‹</b> 버튼을 누르면 그 분기의 월 칸 3개가
접히고, 다시 누르면 펼쳐집니다(접힌 상태는 내 브라우저에 기억). 월 이름을 누르면 그 달 <b>주간 회의록</b>이 열립니다.
<b>입력은 관리자만</b> 할 수 있고(칸을 고치면 바로 저장), 다른 직원은 보기만 합니다. 관리자는 <b>+ 연도 추가</b>로 새해 목표를
만들고(이전 연도의 업무 영역 구성을 그대로 가져옴), 영역·줄 이름은 <b>눌러서 그 자리에서 고치고</b>(Enter 저장, Esc 취소),
구역·항목 칸을 <b>우클릭</b>하거나 칸 오른쪽 위의 작은 <span class="pjh-ui">⋮</span> 버튼(마우스를 올리면 보임)을 눌러 색·순서·줄 추가·삭제를 합니다.
키보드로는 <kbd>Tab</kbd>으로 이름 칸·<span class="pjh-ui">⋮</span>로 가서 <kbd>Enter</kbd>(이름 칸 = 이름 고치기, ⋮ = 메뉴), 메뉴 안에서 <kbd>↑</kbd><kbd>↓</kbd>·<kbd>Enter</kbd>,
<kbd>Esc</kbd>로 닫습니다. 터치 화면에서는 ⋮ 버튼이 늘 옅게 보여 손가락으로 누르면 됩니다. 업무 영역 칸은 엑셀처럼 <b>병합</b>할 수 있습니다 — 칸을 마우스로
끌어 여러 칸을 고른 뒤 우클릭 → "셀 병합", 병합된 칸은 우클릭 → "병합 해제"(글은 왼쪽 위 칸에 남음).
가로 병합은 같은 분기의 월 칸끼리만(연간·분기 칸은 세로로만) 되고, 칸들의 글은 순서대로 첫 칸에 모입니다.
<br><b>저장이 안 되면</b>(네트워크 끊김 등) 칸 테두리가 빨갛게 되고 <b>쓴 글은 그대로 남습니다</b> — 다시 입력하거나 칸을 떠나면 다시 저장합니다.
저장 안 된 칸이 있으면 줄·영역 추가·병합은 하지 않고 알려 주며, 그 상태로 페이지를 떠나려 하면 브라우저가 한 번 묻습니다.
글은 내 브라우저에도 잠시 보관되어, 저장되지 못한 채 창이 닫혀도 다음에 열면 되살아납니다(그 사이 다른 사람이 같은 칸을 고쳤으면 되살리지 않음).</li>
<li><b>주간 회의록</b>(목표 표의 월 이름) — <b>지난주 리뷰</b>는 언제나 바로 앞 주(7일 전 월~일) 회의록만 보여 줍니다. 그 주 회의록이 없으면
"회의록 없음"으로 비워 두고, 몇 주 전 결과를 지난주처럼 보이지 않습니다. 회의록을 만드는 순서(다음 주를 먼저 만들어도)와 줄 이름 변경·순서 이동과
관계없이 같은 줄끼리 이어집니다. 실적 모듈에서 매출을 읽지 못하면 그 칸은 0원이 아니라 <b>⚠ 미확인</b>으로 보입니다(필요 매출·달성률도 미확인).
매출 자동 갱신은 평소엔 조용히 돌고, <b>실패하거나 일부 쇼핑몰만 실패</b>하면 숫자 아래에 작은 안내와 <span class="pjh-ui">다시 시도</span>가 나옵니다
(안내의 "마지막 갱신 성공" 시각은 실적 모듈이 기록한 시각). 실적 권한이 없으면 갱신하지 않고 저장된 실적으로 보여 줍니다.</li>
<li>왼쪽 메뉴의 오른쪽 경계를 끌면 너비를 최소 170px까지 줄일 수 있습니다. 경계에 키보드 포커스를 놓고 좌우 방향키로도 조절할 수 있으며 너비는 내 브라우저에 기억됩니다. 전체 멤버는 메뉴 너비에 맞춰 4열 또는 3열로 자동 배치됩니다.</li>
<li><b>목표</b> — 연도를 골라 매출·로아스와 업무 영역별 연간·분기·월 계획을 봅니다. (<a href="#goals">연간 목표 설명</a>)</li>
<li><b>주간 회의록</b> — 목표 표의 월 이름을 눌러 이번주 계획과 지난주 리뷰를 함께 봅니다. (<a href="#meetings">주간 회의록 설명</a>)</li>
<li><b>프로젝트</b> — 내가 멤버인 프로젝트 목록입니다. 누르면 그 프로젝트 화면으로 갑니다. 완료한 프로젝트는 아래 <b>완료 프로젝트</b>에 흐리게 모입니다.</li>
<li><b>전체 멤버</b> — 관리자에게만 보입니다. 사람 아이콘을 누르면 그 사람이 맡은 모든 작업을 한눈에 봅니다.</li>
</ul>
@@ -116,6 +116,8 @@
<li><span class="pjh-ui"><span class="material-symbols-outlined">notifications</span></span> 종 아이콘 — 읽지 않은 알림 수가 표시되고, 누르면 수신함으로 갑니다.</li>
<li><span class="pjh-ui"><span class="material-symbols-outlined">fit_screen</span></span> 화면 배율 — 누르면(파랗게 켜짐) 화면 전체를 75%로 줄입니다. 2880×1620 모니터를 Windows 배율 200%로 쓰면 화면이 꽉 차 보이는데, 이때 켜면 1920×1080 모니터와 같은 모습이 됩니다. 브라우저마다 기억합니다. 메뉴·말풍선 같은 작은 팝업은 원래 크기로 뜹니다.</li>
<li><span class="pjh-ui"><span class="material-symbols-outlined">help</span></span> 물음표 — 지금 보고 있는 이 도움말을 새 탭으로 엽니다.</li>
<li><span class="pjh-ui"><span class="material-symbols-outlined">settings</span></span> 도움말 오른쪽의 옵션 — 폰트를 고르고 미리 본 뒤 <span class="pjh-ui">저장</span>을 누르면 Project 화면에 적용되고 창이 닫힙니다.
기본 시스템 폰트·프리텐다드·나눔 스퀘어·나눔 스퀘어 네오·나눔 스퀘어 라운드 중 선택할 수 있습니다. 설정은 이 브라우저의 모든 Project 화면에서 기억합니다. <span class="pjh-ui">취소</span>는 변경을 적용하지 않고 닫습니다.</li>
</ul>
<h3>프로젝트 제목</h3>
<p>가운데 위 프로젝트 제목에 마우스를 올리면 테두리가 생깁니다. 누르면 그 자리에서 이름을 고칩니다 — <kbd>Enter</kbd>나 바깥을 누르면 저장, <kbd>Esc</kbd>는 취소. (그 프로젝트 멤버·관리자만)</p>
@@ -129,16 +131,17 @@
<p class="pjh-lead">프로젝트 관리 메뉴는 관리자 페이지에서 “프로젝트 관리” 권한을 받은 직원에게 보입니다.</p>
<table class="pjh-table">
<tr><th>할 수 있는 일</th><th>누가</th></tr>
<tr><td>프로젝트 보기</td><td>그 프로젝트의 <b>멤버</b>(또는 관리자). 멤버가 아니면 주소를 알아도 열리지 않습니다.</td></tr>
<tr><td>작업·하위 작업·댓글</td><td>그 프로젝트 멤버 누구나 만들고 고칠 수 있습니다.</td></tr>
<tr><td>프로젝트 보기</td><td>그 프로젝트의 <b>멤버·소유자</b>(또는 관리자). 멤버가 아니면 주소를 알아도 열리지 않습니다.</td></tr>
<tr><td>작업·하위 작업·댓글</td><td>그 프로젝트의 멤버·소유자·관리자가 만들고 고칠 수 있습니다.</td></tr>
<tr><td>작업·섹션·프로젝트 삭제</td><td><b>만든 사람만</b> 지울 수 있습니다(최고 관리자는 예외).</td></tr>
<tr><td>댓글 고치기·지우기</td><td>댓글을 쓴 사람(또는 관리자)만.</td></tr>
<tr><td>새 프로젝트, 프로젝트 수정·순서 바꾸기</td><td>관리자 (<span class="pjh-ui">+</span> · <span class="pjh-ui">✎</span> · <span class="pjh-ui">⣿</span> 버튼이 관리자에게만 보입니다)</td></tr>
<tr><td>새 프로젝트, 사이드바의 프로젝트 수정·순서 바꾸기</td><td>관리자 (<span class="pjh-ui">+</span> · <span class="pjh-ui">✎</span> · <span class="pjh-ui">⣿</span> 버튼이 관리자에게만 보입니다)</td></tr>
<tr><td>멤버 배정·제외, 프로젝트 소유자 바꾸기</td><td>관리자</td></tr>
<tr><td>다른 프로젝트에서 연결돼 온 작업</td><td>원래 프로젝트 멤버가 아니면 <b>읽기만</b> — 내용·댓글·첨부는 보이지만 고치거나 댓글을 달 수 없습니다(연결된 보드 안에서 섹션 옮기기는 됩니다).</td></tr>
<tr><td>멤버에서 빠졌을 때</td><td>그 프로젝트의 작업은 내 작업·수신함·알림·검색에서 사라지고, 예전 링크로도 열리지 않습니다. 새 알림도 오지 않습니다.</td></tr>
<tr><td>휴지통 보기·복구, 전체 멤버, 대시보드의 담당자별 차트</td><td>관리자</td></tr>
<tr><td>목표 보기</td><td>누구나 · <b>목표 입력·연도 추가·업무 영역 편집</b>은 관리자</td></tr>
<tr><td>목표·주간 회의록 보기</td><td>프로젝트 관리 권한이 있는 직원 누구나 · <b>입력·생성·삭제·구조 편집</b>은 관리자</td></tr>
<tr><td>프로젝트 제목 바로 고치기</td><td>그 프로젝트 멤버·소유자·관리자</td></tr>
</table>
</section>
@@ -215,6 +218,7 @@
<p class="pjh-lead">보드는 섹션(세로 칸)이 옆으로 늘어선 화면입니다. 섹션이 많으면 가로로 스크롤되고, 한 섹션에 카드가 많으면 그 섹션 안에서만 세로로 스크롤됩니다.</p>
<h3>섹션 다루기</h3>
<ul>
<li><b>그룹 축소</b> — 섹션 머리의 왼쪽 화살표를 누르면 카드가 숨겨지고 제목·작업 수가 세로로 표시됩니다. 반대 방향 화살표를 누르면 펼쳐집니다. 축소 상태는 내 브라우저에 기억됩니다.</li>
<li><b>섹션 추가</b> — 마지막 섹션 바로 오른쪽의 <span class="pjh-ui">+ 섹션 추가</span>.</li>
<li><b>이름 바꾸기</b> — 섹션 이름을 누르면 그 자리에서 고칩니다. <kbd>Enter</kbd> 저장, <kbd>Esc</kbd> 취소.</li>
<li><b>순서 바꾸기</b> — 섹션 머리(이름 줄)를 잡고 좌우로 끌어 놓습니다.</li>
@@ -232,8 +236,10 @@
<div><b>기본 담당자</b>를 정해 두면, 그 섹션에 담당자 없는 작업을 새로 만들거나 옮겨 올 때 그 사람이 자동으로 담당자가 됩니다. 예) “검토” 섹션의 기본 담당자 = 팀장.</div></div>
<h3>작업 카드 다루기</h3>
<ul>
<li><b>작업 추가</b> — 섹션 머리의 <span class="pjh-ui">+</span> 또는 섹션 맨 아래 <span class="pjh-ui">+ 작업 추가</span>. 오른쪽에 작업 편집 창이 열립니다.</li>
<li><b>상단 작업 추가</b> — 섹션 머리의 <span class="pjh-ui">+</span>는 오른쪽에서 작업 상세창을 엽니다. 제목·설명·담당자·우선순위·마감일을 설정할 수 있습니다.</li>
<li><b>하단 작업 추가</b> — 섹션 맨 아래 <span class="pjh-ui">+ 작업 추가</span>는 보드 안에 간단한 입력 카드를 엽니다. <b>작업 이름·담당자·마감일</b>을 정한 뒤 <kbd>Enter</kbd>를 누르거나 카드 밖을 클릭하면 저장됩니다. Enter로 저장하면 다음 작업을 계속 입력할 수 있고, <kbd>Esc</kbd>로 취소할 수 있습니다.</li>
<li><b>열기</b> — 카드를 누르면 오른쪽에 작업 편집 창이 열립니다. (<a href="#task">8장</a>)</li>
<li><b>완료 체크</b> — 카드 제목 왼쪽의 원형 체크 버튼을 누르면 완료됩니다. 완료된 작업은 <b>녹색 원 안 흰 체크</b>와 흐린 회색 제목으로 표시되며 취소선은 없습니다. 다시 누르면 완료를 취소합니다. 읽기 전용 작업은 상태만 표시합니다.</li>
<li><b>담당자·마감일 바로 바꾸기</b> — 카드의 사람 아이콘이나 날짜를 누르면 그 자리에서 바꿉니다. 비어 있으면 카드에 마우스를 올렸을 때 점선 원 아이콘이 나타납니다.</li>
<li><b>옮기기</b> — 카드를 끌어 다른 섹션에 놓으면 섹션이 바뀌고, 같은 섹션 안에서 위아래로 놓으면 순서가 바뀝니다.</li>
<li><b>우클릭 메뉴</b> — <span class="pjh-ui">열기 · 작업 링크 복사 · 완료로 표시 · 삭제</span></li>
@@ -257,6 +263,7 @@
<li><b>마감일·담당자</b> — 줄 오른쪽 날짜나 사람 아이콘을 누르면 그 자리에서 바꿉니다.</li>
<li><b>열기</b> — 줄을 누르면 그 하위 작업이 작업처럼 편집 창으로 열립니다.</li>
<li><b>우클릭</b> — <span class="pjh-ui">열기 · 상위 작업 열기 · 완료로 표시 · 하위 작업 삭제</span></li>
<li><b>순서 바꾸기</b> — 펼친 하위 작업 한 줄을 끌어 같은 카드 안의 원하는 위치에 놓습니다. 보라색 선이 삽입 위치를 보여 주며, 변경한 순서는 저장됩니다.</li>
<li><b>다른 작업으로 옮기기</b> — 하위 작업 한 줄을 끌어서 <b>다른 카드</b>에 놓으면 그 작업의 하위 작업이 됩니다(놓을 수 있는 카드는 보라색 테두리가 생깁니다). 같은 프로젝트 안에서만 옮길 수 있습니다.</li>
</ul>
<h3>+ 하위 작업 추가</h3>
@@ -316,7 +323,7 @@
<li>그 프로젝트에서 들어갈 섹션을 고릅니다.</li>
<li><span class="pjh-ui">다른 프로젝트에 추가</span>를 누릅니다. 빼려면 이름 옆 <span class="pjh-ui">×</span>(연결 해제).</li>
</ol>
<p>작업은 하나라서 어느 보드에서 고쳐도 모두 같이 바뀝니다.</p>
<p>작업은 하나라서 원래 프로젝트에서 고친 내용이 연결된 보드에도 반영됩니다. 원래 프로젝트의 멤버가 아니면 연결된 작업의 내용·댓글·첨부는 읽기만 할 수 있습니다. 연결된 보드 안에서 섹션을 옮기는 것은 가능합니다.</p>
<h3>댓글</h3>
<p>작업 창 맨 아래에 항상 고정된 댓글 칸에 쓰고 <kbd>Enter</kbd>(스크롤해도 그 자리에 있습니다). 칸 오른쪽 <span class="pjh-ui">☺</span>는 이모티콘, <span class="pjh-ui">@</span>는 멤버 태그입니다. 답글은 원 댓글 아래 들여 쓰여 <span class="pjh-ui">↳</span> 표시와 함께 보입니다. 내가 쓴 댓글은 <span class="pjh-ui">✎</span>로 고치고 <span class="pjh-ui">×</span>로 지웁니다. 댓글 속 웹 주소는 링크가 됩니다. 댓글에 붙인 파일은 그 댓글 아래에 보이고(파일만 보낸 댓글도), 첨부 파일 목록에는 <span class="pjh-ui">댓글</span> 표시가 붙습니다.</p>
<p>댓글 대화창에서 파일을 보낼 때 보낼 수 없는 파일(빈 파일, 20MB 초과)이 있으면 댓글을 만들지 않고 그 파일만 빨갛게 표시합니다 — 빼고 다시 보내세요. 인터넷이 끊겨도 쓴 내용과 파일은 그대로 남아 다시 보낼 수 있고, 같은 댓글이 두 번 올라가지 않습니다. @태그는 이 작업을 볼 수 있는 사람만 고를 수 있습니다. 한글을 입력하는 중(조합 중)의 <kbd>Enter</kbd>는 글자 확정만 하고 보내지 않습니다.</p>
@@ -424,7 +431,7 @@
<h3>댓글 대화창</h3>
<p>카드·목록·캘린더·내 작업에 보이는 <span class="pjh-ui">💬 N</span>을 <b>한 번 누르면</b> 메신저처럼 생긴 댓글 대화창이 열립니다.</p>
<ul>
<li>입력칸에 쓰고 <span class="pjh-ui">전송</span> 또는 <kbd>Enter</kbd>.</li>
<li>입력칸에 쓰고 <span class="pjh-ui">전송</span> 또는 <kbd>Enter</kbd>. <kbd>Shift</kbd>+<kbd>Enter</kbd>로 줄바꿈합니다. 입력칸은 높이 70px로 고정되며 긴 글은 칸 안에서 스크롤됩니다.</li>
<li><span class="pjh-ui"><span class="material-symbols-outlined">attach_file</span></span>로 파일을 붙이거나, 캡처한 이미지를 <kbd>Ctrl</kbd>+<kbd>V</kbd>로 붙여 넣습니다. 이미지는 작은 그림으로 보입니다.</li>
<li><span class="pjh-ui"><span class="material-symbols-outlined">add_reaction</span></span>를 누르면 이모티콘 창이 열립니다. 종류별 탭으로 넘기거나 <b>검색</b>(예: 축하, 감사, 완료)으로 찾고, 누르면 커서 자리에 들어갑니다. 자주 쓴 이모티콘은 맨 위에 모입니다. 작업 팝업 아래 댓글 입력칸에도 같은 버튼이 있습니다.</li>
<li>웹 주소를 붙여 넣으면 링크가 되고, 누르면 새 탭에서 열립니다.</li>
@@ -478,7 +485,7 @@
<ul>
<li>작업 편집 창의 <span class="pjh-ui">공유</span> 또는 우클릭 <span class="pjh-ui">작업 링크 복사</span>로 주소를 복사합니다.</li>
<li>받은 사람이 주소를 열면(로그인 전이면 로그인 후) 그 작업이 바로 열립니다. 하위 작업 링크는 하위 작업 자체가 열립니다.</li>
<li>그 프로젝트의 <b>멤버만</b> 열 수 있어 밖으로 새지 않습니다.</li>
<li>현재 그 작업을 볼 수 있는 멤버·소유자·관리자가 열 수 있습니다. 연결된 프로젝트 멤버는 읽기 전용으로 보며, 멤버에서 제외되면 예전 링크로도 열 수 없습니다.</li>
</ul>
</section>
@@ -495,13 +502,161 @@
<div>하위 작업만 따로 지웠는데 상위 작업도 지워진 상태라면, 상위 작업을 먼저 복구해야 합니다.</div></div>
</section>
<!-- 20. 단축키와 FAQ -->
<!-- 20. 연간 목표 -->
<section class="pjh-sec" id="goals">
<h2><span class="pjh-num">20</span>연간 목표</h2>
<p class="pjh-lead">한 해의 매출 목표·실적과 업무 계획을 한 표에서 관리합니다. 숫자는 위쪽 지표에, 실행 계획은 아래쪽 업무 영역에 적습니다. 프로젝트 관리 권한이 있는 직원은 볼 수 있고, 입력·구조 변경은 관리자만 할 수 있습니다.</p>
<h3 id="goals-start">목표 열기와 연도 만들기</h3>
<ol class="pjh-steps">
<li>왼쪽 사이드바 <span class="pjh-ui">목표</span>를 눌러 연도 목록을 펼친 뒤 원하는 연도를 누릅니다. 올해는 목표가 아직 없어도 목록에 보입니다.</li>
<li>관리자는 빈 연도 화면에서 <span class="pjh-ui">해당 연도 목표 만들기</span>, 또는 사이드바의 <span class="pjh-ui">+ 연도 추가</span>로 새 표를 만듭니다.</li>
<li>가장 가까운 이전 연도의 업무 영역·줄 구성을 가져옵니다. 이전 연도가 없으면 다음 연도의 구성을 사용하고, 처음이면 상품·마케팅·컨텐츠·유통으로 시작합니다. 이전 숫자와 계획 글은 복사하지 않습니다.</li>
<li>위쪽 <span class="pjh-ui">매출 단위</span>를 확인한 뒤 월별 숫자와 계획을 입력합니다.</li>
</ol>
<h3 id="goals-metrics">매출·로아스 입력과 달성률 계산</h3>
<table class="pjh-table">
<tr><th>칸</th><th>입력·계산 방법</th></tr>
<tr><td>매출 목표·실적</td><td>관리자가 월별 숫자를 직접 입력합니다. 목표 표의 실적은 회의록의 자동 매출과 별도로 관리하므로 실적 모듈에서 자동으로 채워지지 않습니다.</td></tr>
<tr><td>매출 단위</td><td>예를 들어 단위가 <b>백만원</b>이면 30은 30,000,000원입니다. 단위를 바꿔도 이미 적은 숫자는 자동 환산되지 않으므로 숫자와 단위를 함께 확인하세요.</td></tr>
<tr><td>연간·분기 매출</td><td>해당 기간에 입력한 월 숫자의 합계입니다. 합계 칸에 따로 입력하지 않습니다.</td></tr>
<tr><td>달성</td><td>실적 ÷ 목표 × 100입니다. 월별로 계산하며, 연간·분기는 <b>기간 전체 목표 합계</b> 대비 입력된 실적 합계로 계산합니다. 목표가 없거나 0이면 달성률을 표시하지 않습니다. 100% 이상은 초록으로 표시됩니다.</td></tr>
<tr><td>로아스(ROAS)</td><td>광고비 대비 매출 비율을 <b>% 단위</b>로 적습니다. 예: 300은 300%입니다. 연간·분기는 월 매출과 ROAS로 환산한 광고비를 합쳐 계산하고, 필요한 월 매출이 빠져 있으면 입력된 ROAS의 단순 평균을 사용합니다.</td></tr>
</table>
<p>숫자는 <kbd>Enter</kbd> 또는 칸을 떠날 때 저장됩니다. 숫자 칸을 비우면 값을 지우며, <kbd>Esc</kbd>를 누르면 마지막 저장값으로 돌아갑니다.</p>
<div class="pjh-tip"><span class="material-symbols-outlined">lightbulb</span><div>1~3월 목표가 각각 100이고 1월 실적만 50이면 1분기 달성은 50 ÷ 300 = 약 16.7%입니다. 아직 실적을 넣지 않은 달의 목표도 분기 목표 합계에 포함됩니다.</div></div>
<h3 id="goals-plan">업무 영역·항목·연간·분기·월 계획</h3>
<p>업무 영역은 상품·마케팅처럼 큰 분류, 항목은 그 안의 세부 주제입니다. 한 항목의 연간 칸에는 큰 방향, 분기 칸에는 중간 목표, 월 칸에는 구체적인 실행 계획을 적으면 주간 회의에서 확인하기 쉽습니다.</p>
<ul>
<li><span class="pjh-ui">+ 업무 영역 추가</span>를 누르면 새 영역이 생기고 이름을 바로 고칠 수 있습니다.</li>
<li>영역·항목 이름을 클릭해 고칩니다. <kbd>Enter</kbd>는 저장, <kbd>Esc</kbd>는 취소입니다.</li>
<li>이름 칸을 우클릭하거나 <span class="pjh-ui">⋮</span>를 누르면 영역 색·위아래 순서·줄 추가·삭제 메뉴가 나옵니다. 항목 메뉴에서는 해당 줄 위·아래에 줄을 추가할 수 있습니다. 영역의 마지막 줄은 지울 수 없습니다.</li>
<li>연간 글 칸에서 우클릭해 줄을 추가하면 같은 항목 이름 아래에 여러 줄로 나눠 계획을 적을 수 있습니다.</li>
<li>키보드는 <kbd>Tab</kbd>으로 이름이나 ⋮ 버튼에 이동해 <kbd>Enter</kbd>로 열고, 메뉴에서 <kbd>↑</kbd><kbd>↓</kbd>·<kbd>Enter</kbd>로 선택합니다. <kbd>Esc</kbd>로 닫습니다. 터치 화면에서는 ⋮를 누릅니다.</li>
</ul>
<h3 id="goals-format">글자 서식 바꾸기</h3>
<p>글 칸에서 글자를 드래그해 선택하면 해당 셀 상단에 서식 도구가 나타납니다. <b>선택한 글자에만</b> 12색 견본·크기·굵게·기울임·밑줄을 적용합니다. 크기 버튼은 2px씩 조절하며 범위는 10~32px입니다.</p>
<p>굵게·기울임·밑줄은 다시 누르면 해제됩니다. <span class="pjh-ui">서식 초기화</span>는 선택한 글자의 서식만 되돌리고 내용은 유지합니다. 글과 서식은 입력을 약 0.8초 멈추거나 칸을 떠날 때 자동 저장됩니다.</p>
<h3 id="goals-table">분기 접기·열 너비·행 높이</h3>
<ul>
<li>열은 연간 → 1~3월 → 1분기 → 4~6월 → 2분기 → 7~9월 → 3분기 → 10~12월 → 4분기 순서입니다. <b>분기 머리 칸</b>을 누르면 해당 월 3개가 접힙니다. 네모 안 <b>−</b>는 접기, <b>+</b>는 펼치기입니다.</li>
<li>어느 행에서든 셀의 <b>오른쪽 경계</b>를 끌어 열 너비를 조절합니다. 경계를 더블클릭하면 가장 긴 문단에 맞춥니다. 직접 넣은 줄바꿈·글자 크기·굵기도 반영합니다.</li>
<li>셀 우클릭의 <span class="pjh-ui">현재 열 너비 자동 맞춤</span>·<span class="pjh-ui">전체 열 너비 자동 맞춤</span>도 사용할 수 있습니다. 전체 맞춤은 접힌 월 열까지 포함합니다. 병합 칸은 다른 열을 유지하며 오른쪽 끝 열 너비를 조절합니다.</li>
<li>접힘·열 너비는 내 브라우저에 기억됩니다. 행 높이는 가장 높은 글 칸에 맞춰 늘고, 글이 줄면 함께 줄어듭니다. 글은 상단 정렬입니다.</li>
<li>가로 스크롤에서는 구분·항목·연간 칸이, 세로 스크롤에서는 머리와 매출·로아스 지표가 고정됩니다.</li>
<li><b>월 이름</b>을 누르면 그 달의 <a href="#meetings">주간 회의록</a>으로 이동합니다.</li>
</ul>
<h3 id="goals-merge">셀 병합·병합 해제·내용 이동</h3>
<ol class="pjh-steps">
<li>관리자는 업무 영역의 글 칸을 마우스로 끌어 여러 칸을 선택한 뒤 우클릭 → <span class="pjh-ui">셀 병합</span>을 누릅니다.</li>
<li>가로 병합은 <b>같은 분기의 월 칸끼리</b> 가능합니다. 연간·분기 칸은 세로로만 병합합니다. 선택한 칸들의 글은 순서대로 첫 칸에 모입니다.</li>
<li>병합된 칸을 우클릭 → <span class="pjh-ui">병합 해제</span>하면 다시 나뉩니다. 글은 왼쪽 위 칸에 남습니다.</li>
<li>글 칸 하나를 클릭한 뒤 <b>위·아래·왼쪽 테두리</b>를 잡아 다른 글 칸으로 끌면 내용과 글자 서식이 함께 이동합니다. 오른쪽 경계는 너비 조절용입니다. 대상에 글이 있으면 덮어쓰기를 확인하고, <kbd>Esc</kbd>로 이동을 취소합니다.</li>
</ol>
<h3 id="goals-save">저장 실패와 연도 삭제</h3>
<p>저장 성공 시 칸 테두리가 잠깐 초록으로 바뀝니다. 실패하면 빨간 테두리와 안내가 나오며 입력값은 유지됩니다. 다시 입력하거나 칸을 떠나면 재시도합니다. 저장 안 된 값이 있으면 영역·줄 추가, 병합, 내용 이동을 진행하기 전에 저장을 시도하고, 실패하면 해당 작업을 멈춥니다.</p>
<p>저장되지 않은 초안은 내 브라우저에도 잠시 보관합니다. 다음에 같은 화면을 열면 복원하지만, 그 사이 다른 사람이 같은 칸을 바꿨으면 자동으로 덮어쓰지 않습니다. 저장 안 된 상태로 페이지를 떠나려 하면 브라우저가 확인합니다.</p>
<p>관리자의 <span class="pjh-ui">연도 삭제</span>는 그 연도의 숫자·업무 영역·계획 글을 삭제합니다. 확인창에 연도를 직접 입력해야 진행되며 되돌릴 수 없습니다.</p>
</section>
<!-- 21. 주간 회의록 -->
<section class="pjh-sec" id="meetings">
<h2><span class="pjh-num">21</span>주간 회의록</h2>
<p class="pjh-lead">월 목표를 기준으로 지난주 결과를 리뷰하고 이번주 할 일과 금액 목표를 정하는 화면입니다. 연간 목표의 월 계획, 실적 모듈의 매출, 주별 결정 사항을 함께 확인합니다. 직원은 조회할 수 있고, 생성·입력·삭제는 관리자만 할 수 있습니다.</p>
<h3 id="meetings-week">회의록 열기와 주차 기준</h3>
<ol class="pjh-steps">
<li>왼쪽 <span class="pjh-ui">목표</span>에서 연도를 선택하고 표 머리의 <b>월 이름</b>을 누릅니다.</li>
<li>위쪽 주차 탭 또는 오른쪽 작은 달력의 주 한 줄을 눌러 주를 고릅니다. 점은 회의록이 있는 주, <span class="pjh-ui">이번 주</span>는 현재 주입니다. 이전·다음 달 버튼으로 달을 바꿉니다.</li>
<li>한 주는 <b>월요일~일요일</b>이고, 월요일이 속한 달의 회의록입니다. 1주차는 그 달 첫 월요일이 있는 주입니다. 예: 2026년 10월 1주차는 10/5~10/11이며, 9/28~10/4는 9월 회의록입니다.</li>
<li>작은 달력의 흐린 앞 달 주를 누르면 그 달 회의록으로 갑니다. <span class="pjh-ui">해당 연도 목표</span> 버튼은 연간 목표 표로 돌아갑니다.</li>
</ol>
<h3 id="meetings-create">회의록 만들기와 이어받는 항목</h3>
<p>선택한 주에 회의록이 없으면 관리자에게 <span class="pjh-ui">해당 주차 회의록 만들기</span>가 보입니다. 화면을 열기만 해서는 회의록이 만들어지지 않습니다.</p>
<ul>
<li>줄이 있는 가장 가까운 앞선 회의록에서 <b>구역·항목 이름·색·쇼핑몰 연결·순서</b>를 이어받습니다. 앞선 회의록이 없으면 가장 가까운 다음 회의록의 구성을 가져옵니다.</li>
<li>어느 쪽에도 회의록이 없으면 해당 연도 목표 표의 업무 영역과 기본 양식으로 시작합니다.</li>
<li>이번주 할 일·금액·메모는 새로 적습니다. 구성을 이어받는 것과 <b>지난주 리뷰</b>는 다릅니다. 리뷰에는 정확히 7일 전 주의 같은 항목만 표시됩니다.</li>
</ul>
<h3 id="meetings-month-plan">이 달 계획 확인</h3>
<p>제목 아래 <span class="pjh-ui">해당 월 계획</span>은 연간 목표 표에 적은 월 계획을 업무 영역별로 보여 줍니다. 빈 계획은 생략하고, 병합 칸은 해당 월을 포함하는 계획을 한 번 표시합니다. 여기서는 읽기만 하므로 수정하려면 연간 목표 표로 돌아갑니다.</p>
<h3 id="meetings-kpis">월 목표·누적·주당 필요 매출 읽기</h3>
<table class="pjh-table">
<tr><th>지표</th><th>뜻과 출처</th></tr>
<tr><td>월 목표 매출·목표 ROAS</td><td>연간 목표 표의 해당 월 숫자입니다. 매출 단위가 원·천원·만원·십만원·백만원·천만원·억원이면 원으로 환산합니다. 모르는 단위는 원 환산을 못 하므로 주당 필요 매출도 계산하지 못합니다.</td></tr>
<tr><td>월 누적 실적(지난주까지)</td><td>실적 모듈의 매출 집계 쇼핑몰 매출을 <b>그 달 1일부터 선택한 주의 직전 일요일까지</b> 합칩니다. 현재 날짜·월말을 넘기지 않습니다. 이번주 매출은 이 누적에 포함하지 않습니다.</td></tr>
<tr><td>주당 필요</td><td>(월 목표 매출 − 월 누적 실적) ÷ <b>이번주를 포함한 그 달 남은 주 수</b>입니다. 원 단위 정수로 계산하고, 이미 월 목표를 달성했다면 0원입니다.</td></tr>
<tr><td>전주 목표</td><td>정확히 7일 전 회의록에 적은 금주 목표입니다. 그 주 회의록이 없으면 비어 있습니다.</td></tr>
<tr><td>전주 결과·달성률</td><td>실적 모듈의 전주 월~일 매출과 그 값 ÷ 전주 목표 × 100입니다. 전주 결과는 매출 자료이므로 전주 회의록이 없어도 조회될 수 있습니다. 목표가 없거나 0이면 달성률은 없습니다.</td></tr>
<tr><td>금주 목표·현재 실적</td><td>금주 목표는 관리자가 정하는 원 단위 금액입니다. 현재 실적은 선택한 주 월요일부터 일요일 또는 오늘 중 이른 날까지의 매출입니다. 아직 시작하지 않은 미래 주의 실적은 비어 있습니다.</td></tr>
</table>
<div class="pjh-tip"><span class="material-symbols-outlined">lightbulb</span><div>월 목표가 1억원이고 지난주까지 누적이 4천만원, 남은 주가 이번주 포함 3주이면 주당 필요는 2천만원입니다. 이 숫자는 계획 참고값이며 금주 목표로 자동 저장되지는 않습니다.</div></div>
<p>월 목표·누적은 달의 1일~말일 기준이고, 주간 결과는 월요일~일요일 기준입니다. 달을 넘는 마지막 주의 주간 결과에는 다음 달 날짜가 포함될 수 있습니다.</p>
<h3 id="meetings-edit">이번주 할 일·정량 목표·참석자·메모 입력</h3>
<ol class="pjh-steps">
<li><b>금주 목표</b>에 전체 매출 목표를 적습니다. 줄별 <b>정량 목표</b>는 각 항목의 목표 금액이며, 현재는 원 단위입니다. 금주 목표와 줄별 목표 합계는 자동으로 맞춰지지 않습니다.</li>
<li>각 항목의 <b>이번주 할 일 · 행사</b>에 실행할 일과 일정을 적습니다.</li>
<li><span class="pjh-ui">참석자</span>를 눌러 프로젝트 관리 권한이 있는 등록 직원 중 선택합니다. 찾기·전원 선택·모두 해제를 사용할 수 있으며, 칩의 <span class="pjh-ui">×</span>로 참석자를 뺍니다.</li>
<li>아래 <b>결정 사항 · 메모</b>에 회의 결론과 다음주까지 확인할 일을 적습니다.</li>
</ol>
<p>금액은 <code>1,200,000</code>·<code>120만</code>·<code>1.5억</code>·<code>3천만</code>·<code>1억2천만</code>처럼 입력할 수 있습니다. <kbd>Enter</kbd> 또는 칸을 떠날 때 원 단위로 저장되고, 빈칸은 값을 지웁니다. 글·메모는 입력을 약 0.8초 멈추거나 칸을 떠날 때, 참석자·평가는 바꾸는 즉시 저장됩니다.</p>
<h3 id="meetings-review">지난주 리뷰·결과·평가</h3>
<p>지난주 할 일과 목표는 <b>정확히 7일 전 주의 같은 항목</b>에서 가져옵니다. 이름 변경·순서 이동·회의록 생성 순서와 관계없이 이어진 같은 줄을 찾습니다. 그 주 회의록이 없으면 “회의록 없음”, 회의록은 있지만 항목이 없으면 “지난주 회의록에 없는 줄”로 표시합니다. 몇 주 전 기록을 지난주로 대신 보여 주지 않습니다.</p>
<ul>
<li><b>결과</b> — 쇼핑몰 연결 항목은 해당 쇼핑몰의 전주 매출이 자동 표시됩니다. 연결하지 않은 항목은 관리자가 결과 금액을 직접 입력합니다.</li>
<li><b>달성률</b> — 결과 ÷ 지난주 정량 목표 × 100입니다. 목표가 없거나 0이면 계산하지 않으며, 100% 이상은 초록으로 표시됩니다.</li>
<li><b>평가</b> — <span class="pjh-ui">— · 완료 · 일부 · 미달</span> 중 선택합니다. 달성률과 별개로 회의에서 판단해 정합니다.</li>
<li><b>저장 위치</b> — 이번 화면에서 입력한 지난주 결과·평가는 <b>지난주 회의록의 줄</b>에 저장됩니다. 이번주 할 일·정량 목표는 이번주 회의록에 저장됩니다.</li>
<li><span class="pjh-ui">순서 바꾸기</span>는 이번주와 지난주 리뷰의 좌우 배치만 바꿉니다. 선택은 로그인한 사람별로 내 브라우저에 기억됩니다.</li>
</ul>
<h3 id="meetings-markets">쇼핑몰 연결·자동 실적·매출 갱신</h3>
<ol class="pjh-steps">
<li>항목을 우클릭하거나 <span class="pjh-ui">⋯</span> → <span class="pjh-ui">쇼핑몰 연결(결과 자동)…</span>에서 실적 모듈의 사용 중인 쇼핑몰을 고릅니다. 자동 결과를 쓰지 않으려면 <span class="pjh-ui">연결 안 함</span>을 선택합니다.</li>
<li>연결된 항목의 정량 목표 아래에 이번주 실적과 목표 대비 비율이 나옵니다. 지난주 리뷰의 자동 결과는 <b>지난주 항목의 쇼핑몰 연결</b>을 기준으로 계산합니다. 이번주 연결을 바꿔도 지난주 연결은 바뀌지 않습니다.</li>
<li>유통 구역은 항목 이름으로 일부 쇼핑몰을 추측해 연결하므로 생성 후 연결 배지를 확인하세요. 마케팅의 “네이버” 같은 광고 항목은 자동 연결하지 않습니다.</li>
</ol>
<p>실적 갱신 권한이 있으면 주차를 열 때 지난주부터 선택한 주의 오늘까지 매출을 자동 갱신합니다. 같은 주의 자동 갱신은 브라우저에서 10분 간격으로 제한하며, 성공 시에는 별도 큰 안내 없이 숫자가 바뀝니다. 실패·일부 쇼핑몰 실패 시 작은 안내와 <span class="pjh-ui">다시 시도</span>가 나옵니다. 마지막 갱신 성공 시각은 실적 모듈 기록이며 숫자에 마우스를 올려 확인할 수 있습니다.</p>
<table class="pjh-table">
<tr><th>표시·상태</th><th>확인할 내용</th></tr>
<tr><td>미확인</td><td>조회에 실패해 값을 알 수 없습니다. <b>0원과 다릅니다.</b> 이에 의존하는 달성률·주당 필요 매출도 계산하지 않습니다. 안내의 다시 시도를 사용하거나 실적 연결 상태를 확인하세요.</td></tr>
<tr><td>0원</td><td>매출 조회는 성공했지만 해당 기간에 저장된 실적이 없거나 합계가 0원입니다. 필요하면 실적 화면에서 매출 자료를 갱신하세요.</td></tr>
<tr><td>실적 미사용</td><td>연결 쇼핑몰이 사용 중이 아니거나 목록에 없습니다. 해당 항목의 결과는 직접 입력합니다.</td></tr>
<tr><td>실적 미연결·집계 대상 없음</td><td>자동 실적·누적이 비어 있습니다. 회의록 계획·메모는 계속 입력할 수 있습니다.</td></tr>
<tr><td>실적 갱신 권한 없음</td><td>새 매출을 요청하지 않고 저장된 실적을 보여 줍니다. 회의록 조회 권한과 매출 갱신 권한은 별개입니다.</td></tr>
</table>
<h3 id="meetings-rows">구역·줄 추가·순서·삭제</h3>
<ul>
<li>구역 이름 옆 <span class="pjh-ui">+</span>는 그 구역 끝에 줄을 추가합니다. 표 아래 <span class="pjh-ui">+ 구역 추가</span>로 새 구역을 만듭니다.</li>
<li>항목 이름을 클릭하면 그 자리에서 고칩니다. 우클릭 또는 ⋯ 메뉴에서 <span class="pjh-ui">위에 줄 추가 · 아래에 줄 추가 · 위로 · 아래로 · 줄 삭제</span>를 사용합니다. 순서 이동은 같은 구역 안에서 합니다.</li>
<li>줄을 삭제하면 이번주 할 일·정량 목표도 함께 삭제됩니다. 새 줄은 지난주에 이어진 항목이 없으면 지난주 리뷰가 비어 있습니다.</li>
</ul>
<h3 id="meetings-save">저장 확인·인쇄·회의록 삭제</h3>
<p>저장 실패 시 칸이 빨갛게 표시되며 입력값은 남습니다. 다시 입력하거나 칸을 떠나면 재시도합니다. 금주 목표를 저장하거나 자동 실적을 갱신해도 다른 칸의 작성 중인 글은 유지됩니다. 저장이 안 된 상태에서는 줄 추가·순서 이동·쇼핑몰 연결 같은 작업에 앞서 저장을 다시 시도합니다. 실패하면 구조 변경을 멈춥니다. 초안 복원과 페이지 떠남 보호는 <a href="#goals-save">목표의 저장 안내</a>와 같습니다.</p>
<p><span class="pjh-ui">인쇄</span>는 브라우저 인쇄창을 엽니다. 인쇄용 화면에서는 사이드바·작은 달력·편집 도구를 숨깁니다. 브라우저의 PDF 저장도 사용할 수 있습니다.</p>
<p>관리자의 <span class="pjh-ui">회의록 삭제</span>는 선택한 한 주의 회의록과 줄을 삭제합니다. 다음주 화면의 지난주 리뷰도 비게 됩니다. 같은 주를 다시 만들면 항목 구성은 이어질 수 있지만 삭제한 글과 금액은 복구되지 않습니다.</p>
</section>
<!-- 22. 단축키와 FAQ -->
<section class="pjh-sec" id="tips">
<h2><span class="pjh-num">20</span>단축키와 자주 묻는 질문</h2>
<h2><span class="pjh-num">22</span>단축키와 자주 묻는 질문</h2>
<h3>단축키</h3>
<table class="pjh-table">
<tr><th>키</th><th>하는 일</th></tr>
<tr><td><kbd>/</kbd></td><td>전체 검색창으로 이동(입력 중이 아닐 때)</td></tr>
<tr><td><kbd>/</kbd></td><td>작업 화면에서는 전체 검색창, 이 도움말에서는 도움말 검색창으로 이동(입력 중이 아닐 때)</td></tr>
<tr><td><kbd>Esc</kbd></td><td>작업 편집 창 · 날짜 창 · 메뉴 닫기, 입력 취소</td></tr>
<tr><td><kbd>Enter</kbd></td><td>하위 작업 추가, 섹션 이름 저장, 댓글 전송, 날짜 직접 입력 확정</td></tr>
<tr><td><kbd>Ctrl</kbd> + 휠</td><td>타임라인 확대·축소</td></tr>
@@ -515,26 +670,14 @@
<p><b>Q. 다른 사람이 바꾼 내용이 안 보여요.</b><br>보통 8초 안에 자동으로 반영됩니다. 오래 걸리면 새로고침(<kbd>F5</kbd>)하세요.</p>
<p><b>Q. 하위 작업을 다른 프로젝트 작업으로 옮길 수 있나요?</b><br>하위 작업은 같은 프로젝트 안의 작업으로만 옮길 수 있습니다.</p>
<p><b>Q. 작업을 두 프로젝트에 같이 두고 싶어요.</b><br>작업 편집 창의 “프로젝트” 칸에서 <span class="pjh-ui">다른 프로젝트에 추가</span>를 쓰세요. (<a href="#task">8장</a>)</p>
<p><b>Q. 목표 표의 실적과 회의록 매출이 달라요.</b><br>목표 표의 월 실적은 직접 입력한 숫자이고, 회의록 매출은 실적 모듈 자료입니다. 매출 단위와 집계 기간도 확인하세요. (<a href="#goals-metrics">숫자 지표</a> · <a href="#meetings-kpis">회의록 지표</a>)</p>
<p><b>Q. 지난주 회의록이 있는데 리뷰가 비어 있어요.</b><br>화면의 지난주 날짜와 항목을 확인하세요. 정확히 7일 전 회의록의 이어진 같은 항목만 표시합니다. 따로 추가한 줄은 이름이 같아도 다른 항목일 수 있습니다. (<a href="#meetings-review">지난주 리뷰</a>)</p>
<p><b>Q. 도움말에서 필요한 설명을 빠르게 찾고 싶어요.</b><br>이 페이지 위쪽 검색창에 단어를 입력하고 결과를 누르세요. 제목·본문의 일치 단어가 강조되고 해당 소제목으로 이동합니다. <kbd>Enter</kbd>는 첫 결과로 이동, <kbd>Esc</kbd>나 <span class="pjh-ui">지우기</span>는 검색을 초기화합니다.</p>
</section>
</div>
</div>
<a class="pjh-top" href="#top" title="맨 위로" aria-label="맨 위로"><span class="material-symbols-outlined">arrow_upward</span></a>
<script>
// 목차 — 지금 읽고 있는 장을 강조한다(스크롤 위치 기준).
(function () {
var links = Array.prototype.slice.call(document.querySelectorAll(".pjh-toc a"));
var secs = links.map(function (a) { return document.querySelector(a.getAttribute("href")); });
if (!("IntersectionObserver" in window)) return;
var io = new IntersectionObserver(function (entries) {
entries.forEach(function (en) {
if (!en.isIntersecting) return;
var i = secs.indexOf(en.target);
links.forEach(function (a, k) { a.classList.toggle("is-active", k === i); });
});
}, { rootMargin: "-10% 0px -75% 0px" });
secs.forEach(function (s) { if (s) io.observe(s); });
})();
</script>
<script src="/static/project-help.js?v=20261003a" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261002b" />
<link rel="stylesheet" href="/static/project.css?v=20261003f" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -104,5 +104,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20261002b" defer></script>
<script src="/static/project.js?v=20261003h" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261002b" />
<link rel="stylesheet" href="/static/project.css?v=20261003f" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -100,5 +100,5 @@
"today": {{ today | tojson }}
}
</script>
<script src="/static/project.js?v=20261002b" defer></script>
<script src="/static/project.js?v=20261003h" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261002b" />
<link rel="stylesheet" href="/static/project.css?v=20261003f" />
<!-- 구글 머티리얼 심볼(담당자 아이콘 등) — self-host -->
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
<!-- 타임라인 vis-timeline — self-host -->
@@ -496,5 +496,5 @@
</script>
<script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script>
<script src="/static/project.js?v=20261002b" defer></script>
<script src="/static/project.js?v=20261003h" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261002b" />
<link rel="stylesheet" href="/static/project.css?v=20261003f" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -70,5 +70,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20261002b" defer></script>
<script src="/static/project.js?v=20261003h" defer></script>
{% endblock %}
+10
View File
@@ -0,0 +1,10 @@
@font-face { font-family: "Pretendard Variable"; src: url("vendor/project-fonts/PretendardVariable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "NanumSquare"; src: url("vendor/project-fonts/NanumSquareR.woff") format("woff"); font-weight: 100 599; font-style: normal; font-display: swap; }
@font-face { font-family: "NanumSquare"; src: url("vendor/project-fonts/NanumSquareB.woff") format("woff"); font-weight: 600 749; font-style: normal; font-display: swap; }
@font-face { font-family: "NanumSquare"; src: url("vendor/project-fonts/NanumSquareEB.woff") format("woff"); font-weight: 750 900; font-style: normal; font-display: swap; }
@font-face { font-family: "NanumSquareNeo"; src: url("vendor/project-fonts/NanumSquareNeoR.woff") format("woff"); font-weight: 100 599; font-style: normal; font-display: swap; }
@font-face { font-family: "NanumSquareNeo"; src: url("vendor/project-fonts/NanumSquareNeoB.woff") format("woff"); font-weight: 600 749; font-style: normal; font-display: swap; }
@font-face { font-family: "NanumSquareNeo"; src: url("vendor/project-fonts/NanumSquareNeoEB.woff") format("woff"); font-weight: 750 900; font-style: normal; font-display: swap; }
@font-face { font-family: "NanumSquareRound"; src: url("vendor/project-fonts/NanumSquareRoundR.woff2") format("woff2"); font-weight: 100 599; font-style: normal; font-display: swap; }
@font-face { font-family: "NanumSquareRound"; src: url("vendor/project-fonts/NanumSquareRoundB.woff2") format("woff2"); font-weight: 600 749; font-style: normal; font-display: swap; }
@font-face { font-family: "NanumSquareRound"; src: url("vendor/project-fonts/NanumSquareRoundEB.woff2") format("woff2"); font-weight: 750 900; font-style: normal; font-display: swap; }
+242
View File
@@ -0,0 +1,242 @@
/* 목표 셀의 선택한 글자 서식. 서버와 같은 버전 있는 텍스트 조각을 사용한다. */
(function () {
"use strict";
const PREFIX = "pj-rich:v1:";
const STYLE_KEYS = ["bold", "italic", "underline", "color", "size"];
const TOGGLES = ["bold", "italic", "underline"];
function styles(node, inherited) {
const s = Object.assign({}, inherited);
if (node.nodeType !== 1) return s;
const css = node.style;
if (node.tagName === "B" || node.tagName === "STRONG") s.bold = true;
if (css.fontWeight) s.bold = css.fontWeight === "bold" || Number(css.fontWeight) >= 600;
if (node.tagName === "I" || node.tagName === "EM") s.italic = true;
if (css.fontStyle) s.italic = css.fontStyle === "italic" || css.fontStyle === "oblique";
if (node.tagName === "U") s.underline = true;
const decoration = css.textDecorationLine || css.textDecoration;
if (decoration) s.underline = decoration.includes("underline");
const size = parseInt(css.fontSize, 10);
if (size >= 10 && size <= 32) s.size = size;
if (css.color) {
const rgb = css.color.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
const hex = rgb ? "#" + rgb.slice(1).map(function (v) { return Number(v).toString(16).padStart(2, "0"); }).join("") : css.color;
if (/^#[\da-f]{6}$/i.test(hex)) s.color = hex.toLowerCase();
}
return s;
}
function readRuns(editor) {
const runs = [];
function add(text, style) { if (text) runs.push(Object.assign({ text: text }, style)); }
function walk(node, inherited) {
if (node.nodeType === 3) { add(node.nodeValue, inherited); return; }
if (node.nodeType !== 1) return;
if (node.tagName === "BR") { add("\n", inherited); return; }
if (/^(SCRIPT|STYLE|IMG|IFRAME)$/.test(node.tagName)) return;
const style = styles(node, inherited);
const block = /^(DIV|P)$/.test(node.tagName);
if (block && runs.length && !runs[runs.length - 1].text.endsWith("\n")) add("\n", inherited);
Array.from(node.childNodes).forEach(function (child) { walk(child, style); });
}
Array.from(editor.childNodes).forEach(function (child) { walk(child, {}); });
return compact(runs);
}
function compact(runs) {
const out = [];
runs.forEach(function (run) {
if (!run.text) return;
const prev = out[out.length - 1];
if (prev && STYLE_KEYS.every(function (key) { return prev[key] === run[key]; })) prev.text += run.text;
else out.push(Object.assign({}, run));
});
return out;
}
function encode(runs) {
runs = compact(runs);
return runs.some(function (r) { return Object.keys(r).length > 1; }) ? PREFIX + JSON.stringify(runs) : runs.map(function (r) { return r.text; }).join("");
}
function decode(value) {
if (value.startsWith(PREFIX)) {
try { const runs = JSON.parse(value.slice(PREFIX.length)); if (Array.isArray(runs)) return runs; } catch (_) {}
}
return [{ text: value }];
}
function paint(editor, runs) {
editor.replaceChildren();
runs.forEach(function (r) {
if (typeof r.text !== "string") return;
const span = document.createElement("span");
span.textContent = r.text;
if (typeof r.bold === "boolean") span.style.fontWeight = r.bold ? "700" : "400";
if (typeof r.italic === "boolean") span.style.fontStyle = r.italic ? "italic" : "normal";
if (typeof r.underline === "boolean") span.style.textDecoration = r.underline ? "underline" : "none";
if (/^#[\da-f]{6}$/i.test(r.color || "")) span.style.color = r.color;
if (Number.isInteger(r.size) && r.size >= 10 && r.size <= 32) span.style.fontSize = r.size + "px";
editor.appendChild(span.style.cssText ? span : document.createTextNode(r.text));
});
}
function restore(editor, start, end) {
const walker = document.createTreeWalker(editor, NodeFilter.SHOW_TEXT);
const points = [], range = document.createRange();
let node, offset = 0;
while ((node = walker.nextNode())) {
points.push({ node: node, start: offset, end: offset + node.length }); offset += node.length;
}
function point(n) { return points.find(function (p) { return n <= p.end; }) || points[points.length - 1]; }
const a = point(start), b = point(end);
if (!a || !b) { range.selectNodeContents(editor); range.collapse(false); }
else { range.setStart(a.node, Math.max(0, start - a.start)); range.setEnd(b.node, Math.max(0, end - b.start)); }
const selection = window.getSelection(); selection.removeAllRanges(); selection.addRange(range);
return range;
}
function attach(editor) {
// 기존 자동 저장·병합·초안 복구와 같은 value 인터페이스를 제공한다.
Object.defineProperty(editor, "value", { configurable: true,
get: function () { return encode(readRuns(editor)); },
set: function (v) { paint(editor, decode(String(v || ""))); },
});
editor.addEventListener("keydown", function (e) {
if (e.isComposing || e.keyCode === 229) return;
if (e.key === "Enter") { e.preventDefault(); insert(editor, "\n"); }
});
editor.addEventListener("paste", function (e) {
e.preventDefault(); insert(editor, e.clipboardData.getData("text/plain"));
});
}
function insert(editor, text) {
const sel = window.getSelection();
if (!sel.rangeCount || !editor.contains(sel.getRangeAt(0).commonAncestorContainer)) return;
const range = sel.getRangeAt(0); range.deleteContents();
const node = document.createTextNode(text); range.insertNode(node);
range.setStartAfter(node); range.collapse(true); sel.removeAllRanges(); sel.addRange(range);
editor.dispatchEvent(new Event("input", { bubbles: true }));
}
function init(table, toolbar) {
if (!toolbar) return;
let saved = null;
// body 에 두어 표 스크롤과 화면 zoom 에 잘리지 않는 선택 셀 위 팝업으로 표시한다.
document.body.appendChild(toolbar);
const colorButton = toolbar.querySelector("[data-goal-format='color']");
const colorGrid = toolbar.querySelector(".pj-goal-color-grid");
function closeColors() { colorGrid.hidden = true; colorButton.setAttribute("aria-expanded", "false"); }
function showColor(value) {
colorButton.querySelector(".pj-goal-color-preview").style.backgroundColor = value;
colorGrid.querySelectorAll("[data-goal-color]").forEach(function (btn) {
btn.setAttribute("aria-pressed", String(btn.dataset.goalColor.toLowerCase() === value.toLowerCase()));
});
}
function place() {
if (!saved || !saved.editor.isConnected) { clear(); return; }
const sel = window.getSelection();
if (!sel.rangeCount || sel.isCollapsed || !saved.editor.contains(sel.getRangeAt(0).commonAncestorContainer)) return;
const cell = saved.editor.closest("td");
if (!cell) { clear(); return; }
// 같은 셀의 어느 줄을 선택해도 셀 상단·가운데를 기준으로 같은 위치에 둔다.
const rect = cell.getBoundingClientRect();
const paneRect = table.parentElement.getBoundingClientRect();
if (rect.bottom < paneRect.top || rect.top > paneRect.bottom || rect.right < paneRect.left || rect.left > paneRect.right) {
toolbar.hidden = true; closeColors(); return;
}
toolbar.hidden = false;
const w = toolbar.offsetWidth, h = toolbar.offsetHeight;
toolbar.style.left = Math.max(8, Math.min(rect.left + rect.width / 2 - w / 2, window.innerWidth - w - 8)) + "px";
toolbar.style.top = Math.max(8, rect.top - h - 8) + "px";
colorGrid.classList.toggle("is-below", rect.top - h - 88 < 8);
}
function clear() {
saved = null;
toolbar.hidden = true; closeColors();
toolbar.querySelectorAll("button, input, select").forEach(function (el) { el.disabled = true; });
}
function capture() {
// 서식 도구에 포커스를 옮길 때는 직전 글자 선택을 유지한다.
if (toolbar.contains(document.activeElement)) return;
const sel = window.getSelection();
if (!sel.rangeCount || sel.isCollapsed) { clear(); return; }
const range = sel.getRangeAt(0);
const root = range.startContainer.nodeType === 1 ? range.startContainer : range.startContainer.parentElement;
const editor = root.closest(".pj-goal-text[contenteditable='true']");
if (!editor || !table.contains(editor) || !editor.contains(range.endContainer)) { clear(); return; }
const pre = document.createRange(); pre.selectNodeContents(editor); pre.setEnd(range.startContainer, range.startOffset);
saved = { editor: editor, start: pre.toString().length, end: pre.toString().length + range.toString().length };
toolbar.querySelectorAll("button, input, select").forEach(function (el) { el.disabled = false; });
let pos = 0;
const chosen = readRuns(editor).filter(function (run) {
const end = pos + run.text.length, intersects = end > saved.start && pos < saved.end;
pos = end; return intersects;
});
function uniform(key, fallback) {
const value = chosen[0] && chosen[0][key];
return chosen.every(function (r) { return r[key] === value; }) && value !== undefined ? value : fallback;
}
TOGGLES.forEach(function (key) {
const all = chosen.every(function (r) { return r[key] === true; });
const some = chosen.some(function (r) { return r[key] === true; });
toolbar.querySelector("[data-goal-format='" + key + "']").setAttribute("aria-pressed", all ? "true" : some ? "mixed" : "false");
});
showColor(uniform("color", "#000000"));
const sizes = chosen.map(function (r) { return r.size || 14; });
toolbar.querySelector("[data-goal-format='size']").textContent = sizes.every(function (n) { return n === sizes[0]; }) ? sizes[0] + "px" : "혼합";
toolbar.querySelector("[data-goal-format='size-up']").disabled = sizes.every(function (n) { return n >= 32; });
toolbar.querySelector("[data-goal-format='size-down']").disabled = sizes.every(function (n) { return n <= 10; });
toolbar.hidden = false;
place();
}
document.addEventListener("selectionchange", capture);
table.addEventListener("mouseup", capture);
table.addEventListener("keyup", capture);
toolbar.addEventListener("mousedown", function (e) { if (e.target.closest("button")) e.preventDefault(); });
function apply(key, value) {
if (!saved || !saved.editor.isConnected) return;
const editor = saved.editor, out = []; let pos = 0;
readRuns(editor).forEach(function (run) {
const end = pos + run.text.length;
const a = Math.max(pos, saved.start), b = Math.min(end, saved.end);
if (b <= a) out.push(run);
else {
if (a > pos) out.push(Object.assign({}, run, { text: run.text.slice(0, a - pos) }));
const middle = Object.assign({}, run, { text: run.text.slice(a - pos, b - pos) });
if (key === "reset") STYLE_KEYS.forEach(function (style) { delete middle[style]; });
else if (key === "size-delta") middle.size = Math.max(10, Math.min(32, (middle.size || 14) + value));
else middle[key] = value;
out.push(middle);
if (b < end) out.push(Object.assign({}, run, { text: run.text.slice(b - pos) }));
}
pos = end;
});
paint(editor, compact(out)); editor.focus(); restore(editor, saved.start, saved.end);
editor.dispatchEvent(new Event("input", { bubbles: true }));
capture();
}
colorButton.addEventListener("click", function () {
colorGrid.hidden = !colorGrid.hidden;
colorButton.setAttribute("aria-expanded", String(!colorGrid.hidden));
});
colorGrid.addEventListener("click", function (e) {
const btn = e.target.closest("[data-goal-color]");
if (!btn) return;
apply("color", btn.dataset.goalColor.toLowerCase()); closeColors();
});
TOGGLES.forEach(function (key) {
const btn = toolbar.querySelector("[data-goal-format='" + key + "']");
btn.addEventListener("click", function () { apply(key, btn.getAttribute("aria-pressed") !== "true"); });
});
toolbar.querySelector("[data-goal-format='size-up']").addEventListener("click", function () { apply("size-delta", 2); });
toolbar.querySelector("[data-goal-format='size-down']").addEventListener("click", function () { apply("size-delta", -2); });
toolbar.querySelector("[data-goal-format='reset']").addEventListener("click", function () { apply("reset"); });
document.addEventListener("mousedown", function (e) {
if (toolbar.contains(e.target) || (saved && saved.editor.contains(e.target))) return;
clear();
}, true);
toolbar.addEventListener("keydown", function (e) {
if (e.key !== "Escape") return;
e.preventDefault(); e.stopPropagation();
if (!colorGrid.hidden) { closeColors(); colorButton.focus(); }
else { if (saved) saved.editor.focus(); clear(); }
});
window.addEventListener("resize", place);
window.addEventListener("scroll", function (e) { if (!toolbar.contains(e.target)) place(); }, true);
new MutationObserver(function () { if (saved && !saved.editor.isConnected) clear(); }).observe(table, { childList: true, subtree: true });
clear();
}
window.PJGoalText = { attach: attach, init: init, readRuns: readRuns, paint: paint, encode: encode };
})();
+59 -15
View File
@@ -2,11 +2,11 @@
왼쪽 목차(스크롤을 따라 현재 위치 강조) + 오른쪽 본문 카드. 처음 쓰는 사람이
읽기 쉽게 — 단계는 번호 동그라미, 화면의 버튼·메뉴 이름은 .pjh-ui 칩으로 표시. */
.pjh {
--pjh-ink: #1e1f21; --pjh-soft: #6d6e6f; --pjh-line: #e8eaee;
--pjh-ink: var(--pj-ink); --pjh-soft: var(--pj-ink-soft); --pjh-line: #e8eaee;
--pjh-accent: var(--pj-accent, #7b68ee); --pjh-tint: var(--pj-accent-tint, #f1eeff);
display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 28px;
max-width: 1180px; margin: 0 auto; padding: 4px 0 60px; color: var(--pjh-ink);
font-size: 14.5px; line-height: 1.7;
font-size: var(--pj-text-size); line-height: var(--pj-text-leading);
}
@media (max-width: 1000px) {
.pjh { grid-template-columns: minmax(0, 1fr); }
@@ -15,26 +15,26 @@
/* 목차 */
.pjh-toc { position: sticky; top: 12px; align-self: start; max-height: calc(100vh - 110px); overflow-y: auto; }
.pjh-toc-title { font-size: 12px; font-weight: 800; color: var(--pjh-soft); letter-spacing: .04em; margin: 0 0 8px 10px; }
.pjh-toc-title { font-size: 12px; font-weight: 500; color: var(--pjh-soft); letter-spacing: normal; margin: 0 0 8px 10px; }
.pjh-toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.pjh-toc li { counter-increment: toc; }
.pjh-toc a {
display: flex; gap: 8px; padding: 5px 10px; border-radius: 8px; color: #3d4046;
text-decoration: none; font-size: 13.5px; line-height: 1.45;
text-decoration: none; font-size: var(--pj-text-size); line-height: var(--pj-text-leading);
}
.pjh-toc a::before { content: counter(toc) "."; color: #9aa1a9; min-width: 18px; }
.pjh-toc a:hover { background: #f1f2f4; }
.pjh-toc a.is-active { background: var(--pjh-tint); color: var(--pjh-accent); font-weight: 700; }
.pjh-toc a.is-active { background: var(--pjh-tint); color: var(--pjh-accent); font-weight: 500; }
/* 머리말 */
.pjh-hero {
background: linear-gradient(135deg, #f4f1ff 0%, #eef5ff 100%); border: 1px solid #e4defd;
border-radius: 16px; padding: 26px 30px; margin-bottom: 18px;
}
.pjh-hero h1 { margin: 0 0 6px; font-size: 24px; font-weight: 800; }
.pjh-hero h1 { margin: 0 0 6px; font-size: var(--pj-title-size); line-height: var(--pj-title-leading); font-weight: 500; }
.pjh-hero p { margin: 0; color: #3d4046; }
.pjh-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-top: 18px; }
.pjh-quick-step { background: #fff; border: 1px solid #e4defd; border-radius: 12px; padding: 12px 14px; font-size: 13.5px; line-height: 1.5; }
.pjh-quick-step { background: #fff; border: 1px solid #e4defd; border-radius: 12px; padding: 12px 14px; font-size: var(--pj-text-size); line-height: var(--pj-text-leading); }
.pjh-quick-step b { display: block; color: var(--pjh-accent); font-size: 12px; margin-bottom: 2px; }
/* 본문 카드 */
@@ -42,12 +42,12 @@
background: #fff; border: 1px solid var(--pjh-line); border-radius: 14px;
padding: 24px 30px; margin-bottom: 18px; scroll-margin-top: 16px;
}
.pjh-sec h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 20px; font-weight: 800; }
.pjh-sec h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: var(--pj-heading-size); line-height: var(--pj-heading-leading); font-weight: 500; }
.pjh-sec h2 .pjh-num {
display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
border-radius: 9px; background: var(--pjh-tint); color: var(--pjh-accent); font-size: 15px; flex: none;
}
.pjh-sec h3 { margin: 22px 0 6px; font-size: 16px; font-weight: 800; }
.pjh-sec h3 { margin: 22px 0 6px; font-size: var(--pj-section-size); line-height: var(--pj-section-leading); font-weight: 500; }
.pjh-sec h3:first-of-type { margin-top: 8px; }
.pjh-sec p { margin: 6px 0; }
.pjh-sec ul { margin: 6px 0; padding-left: 20px; }
@@ -59,14 +59,14 @@
.pjh-steps li { counter-increment: step; position: relative; padding: 2px 0 6px 36px; margin: 0; }
.pjh-steps li::before {
content: counter(step); position: absolute; left: 0; top: 3px; width: 24px; height: 24px;
border-radius: 50%; background: var(--pjh-accent); color: #fff; font-size: 12.5px; font-weight: 800;
border-radius: 50%; background: var(--pjh-accent); color: #fff; font-size: 12.5px; font-weight: 500;
display: flex; align-items: center; justify-content: center;
}
/* 화면 요소 이름(버튼·메뉴) 칩, 키보드 키 */
.pjh-ui {
display: inline-flex; align-items: center; gap: 3px; padding: 0 7px; border-radius: 6px;
background: #f1f2f4; border: 1px solid #e2e4e8; font-size: 13px; font-weight: 700; line-height: 22px;
background: #f1f2f4; border: 1px solid #e2e4e8; font-size: 13px; font-weight: 500; line-height: 22px;
white-space: nowrap; vertical-align: 1px;
}
.pjh-ui .material-symbols-outlined { font-size: 16px; }
@@ -79,7 +79,7 @@
/* 팁·주의 */
.pjh-tip, .pjh-note, .pjh-warn {
display: flex; gap: 10px; border-radius: 10px; padding: 10px 14px; margin: 10px 0; font-size: 13.5px; line-height: 1.6;
display: flex; gap: 10px; border-radius: 10px; padding: 10px 14px; margin: 10px 0; font-size: var(--pj-text-size); line-height: var(--pj-text-leading);
}
.pjh-tip { background: #f2faf5; border: 1px solid #cfe9da; }
.pjh-note { background: #f3f6ff; border: 1px solid #d6e0fb; }
@@ -91,10 +91,10 @@
.pjh-warn > .material-symbols-outlined { font-size: 20px; flex: none; margin-top: 1px; }
/* 표 */
.pjh-table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 13.5px; line-height: 1.55; }
.pjh-table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: var(--pj-text-size); line-height: var(--pj-text-leading); }
.pjh-table th, .pjh-table td { border-bottom: 1px solid var(--pjh-line); padding: 8px 10px; text-align: left; vertical-align: top; }
.pjh-table th { background: #f7f8fa; font-weight: 800; color: #3d4046; white-space: nowrap; }
.pjh-table td:first-child { font-weight: 700; white-space: nowrap; }
.pjh-table th { background: #f7f8fa; font-weight: 500; color: #3d4046; white-space: nowrap; }
.pjh-table td:first-child { font-weight: 500; white-space: nowrap; }
/* 화면 구성 그림(아주 단순한 모형) */
.pjh-map {
@@ -114,3 +114,47 @@
background: var(--pjh-accent); color: #fff; box-shadow: 0 6px 18px rgba(123, 104, 238, .35);
}
.pjh-top:hover { filter: brightness(1.08); }
/* 검색 — 결과는 소제목 단위로 이동하며 본문은 계속 읽을 수 있다. */
.erp-page:has(> .pjh) { box-sizing: border-box; }
.pjh-body { min-width: 0; }
.pjh [hidden] { display: none !important; }
.pjh-search { background: #fff; border: 1px solid var(--pjh-line); border-radius: 14px; padding: 18px 22px; margin-bottom: 18px; }
.pjh-search label { display: block; font-weight: 600; margin-bottom: 8px; }
.pjh-search-field { display: flex; gap: 8px; }
.pjh-search-field input { flex: 1; min-width: 0; border: 1px solid #cfd3d9; border-radius: 8px; padding: 10px 12px; font: inherit; }
.pjh-search-field button { border: 1px solid #d7d0f7; border-radius: 8px; background: var(--pjh-tint); color: #493790; padding: 8px 12px; font: inherit; cursor: pointer; }
.pjh-search-field button:hover { background: #e8e1ff; }
.pjh-search-hint, .pjh-search-status { font-size: 13px; margin: 8px 0 0; color: var(--pjh-soft); }
.pjh-search-status:empty { display: none; }
.pjh-results { list-style: none; margin: 12px 0 0; padding: 0; max-height: 340px; overflow-y: auto; }
.pjh-results li + li { border-top: 1px solid var(--pjh-line); }
.pjh-results a { display: block; padding: 10px; color: var(--pjh-ink); text-decoration: none; border-radius: 8px; }
.pjh-results a:hover { background: #f7f5ff; }
.pjh-results strong, .pjh-results span { display: block; overflow-wrap: anywhere; }
.pjh-results strong { color: #493790; font-weight: 600; }
.pjh-results span { margin-top: 4px; font-size: 13px; }
.pjh mark.pjh-match { background: #fff0a6; color: #423309; border-radius: 2px; padding: 0; }
.pjh-quick-links { margin-top: 16px !important; }
.pjh-sec h3 { scroll-margin-top: 20px; }
.pjh :focus-visible { outline: 2px solid var(--pjh-accent); outline-offset: 3px; }
.pjh-sec { overflow-wrap: anywhere; }
@media (max-width: 600px) {
.erp-app:has(.pjh) .erp-topbar { flex-wrap: wrap; height: auto; padding: 8px 12px; gap: 8px; }
.erp-app:has(.pjh) .erp-topbar-left { flex-basis: 100%; }
.erp-app:has(.pjh) .erp-topbar-right { width: 100%; gap: 6px; }
.erp-app:has(.pjh) .erp-user-chip { margin-right: auto; }
.erp-app:has(.pjh) .erp-user-email { display: none; }
.pjh { gap: 12px; }
.pjh-hero, .pjh-sec { padding: 18px 16px; }
.pjh-search { padding: 16px; }
.pjh-search-field { flex-wrap: wrap; }
.pjh-search-field input { flex-basis: 100%; }
.pjh-table td:first-child, .pjh-table th { white-space: normal; }
.pjh-table th, .pjh-table td { padding: 7px 5px; }
.pjh-map { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; }
.pjh-map-top { flex-wrap: wrap; gap: 6px; }
.pjh-map-side, .pjh-map-main { grid-row: auto; }
.pjh-top { right: 12px; bottom: 12px; }
}
+205
View File
@@ -0,0 +1,205 @@
/* 도움말의 제목·본문에서 검색하고 해당 소제목으로 이동한다. DB/API 불필요. */
(function () {
"use strict";
const root = document.querySelector(".pjh");
if (!root) return;
const input = document.getElementById("pjh-query");
const form = document.getElementById("pjh-search-form");
const results = document.getElementById("pjh-results");
const status = document.getElementById("pjh-search-status");
const clear = document.getElementById("pjh-search-clear");
const chapters = Array.from(root.querySelectorAll(".pjh-sec"));
const index = [];
let composing = false;
function plain(node) {
const copy = node.cloneNode(true);
copy.querySelectorAll(".pjh-num, .material-symbols-outlined").forEach(function (n) { n.remove(); });
return copy.textContent.replace(/\s+/g, " ").trim();
}
// 본문 자체에서 색인을 만든다. 도움말을 고치면 검색 결과도 함께 바뀐다.
chapters.forEach(function (chapter) {
const title = plain(chapter.querySelector("h2"));
let block = { chapter: chapter, title: title, heading: chapter.querySelector("h2"), nodes: [], order: index.length };
block.heading.id = block.heading.id || chapter.id + "-intro";
let ordinal = 0;
function finish() {
block.text = block.nodes.map(plain).join(" ");
block.search = (block.title + " " + block.text).toLowerCase();
index.push(block);
}
Array.from(chapter.children).forEach(function (node) {
if (node.tagName === "H2") return;
if (node.tagName === "H3") {
finish();
ordinal++;
node.id = node.id || chapter.id + "-" + ordinal;
block = { chapter: chapter, title: title + " › " + plain(node), heading: node, nodes: [], order: index.length };
} else block.nodes.push(node);
});
finish();
});
function words(query) {
return Array.from(new Set(query.trim().toLowerCase().split(/\s+/).filter(Boolean)));
}
// 검색어는 HTML이나 정규식으로 해석하지 않는다.
function marked(text, terms) {
const fragment = document.createDocumentFragment();
const lower = text.toLowerCase();
let pos = 0;
while (pos < text.length) {
let start = -1, length = 0;
terms.forEach(function (term) {
const found = lower.indexOf(term, pos);
if (found !== -1 && (start === -1 || found < start || (found === start && term.length > length))) {
start = found; length = term.length;
}
});
if (start === -1) { fragment.appendChild(document.createTextNode(text.slice(pos))); break; }
fragment.appendChild(document.createTextNode(text.slice(pos, start)));
const mark = document.createElement("mark");
mark.className = "pjh-match";
mark.textContent = text.slice(start, start + length);
fragment.appendChild(mark);
pos = start + length;
}
return fragment;
}
function highlight(terms) {
chapters.forEach(function (chapter) {
chapter.querySelectorAll("mark.pjh-match").forEach(function (mark) {
mark.replaceWith(document.createTextNode(mark.textContent));
});
chapter.normalize();
if (!terms.length) return;
const walker = document.createTreeWalker(chapter, NodeFilter.SHOW_TEXT);
const nodes = [];
let node;
while ((node = walker.nextNode())) {
if (!node.parentElement.closest(".material-symbols-outlined, .pjh-num") &&
terms.some(function (term) { return node.nodeValue.toLowerCase().includes(term); })) nodes.push(node);
}
nodes.forEach(function (n) { n.replaceWith(marked(n.nodeValue, terms)); });
});
}
function snippet(text, terms) {
const lower = text.toLowerCase();
const hits = terms.map(function (term) { return lower.indexOf(term); }).filter(function (n) { return n >= 0; });
const start = hits.length ? Math.max(0, Math.min.apply(null, hits) - 35) : 0;
return (start ? "…" : "") + text.slice(start, start + 155) + (text.length > start + 155 ? "…" : "");
}
function saveQuery(query) {
const url = new URL(window.location.href);
if (query.trim()) url.searchParams.set("q", query.trim());
else url.searchParams.delete("q");
window.history.replaceState(null, "", url);
}
function search(updateUrl) {
const query = input.value.slice(0, 160);
const terms = words(query);
results.replaceChildren();
clear.hidden = !query;
results.hidden = !terms.length;
highlight(terms);
if (updateUrl) saveQuery(query);
if (!terms.length) { status.textContent = ""; return; }
const matches = index.filter(function (entry) {
return terms.every(function (term) { return entry.search.includes(term); });
});
// 제목에 모든 단어가 있으면 먼저, 나머지는 문서 순서대로.
matches.sort(function (a, b) {
function score(entry) { return terms.every(function (term) { return entry.title.toLowerCase().includes(term); }) ? 1 : 0; }
return score(b) - score(a) || a.order - b.order;
});
status.textContent = matches.length
? "검색 결과 " + matches.length + "개 · 결과를 누르거나 Enter로 첫 설명에 이동하세요."
: "검색 결과가 없습니다. 다른 단어를 쓰거나 검색어를 줄여 보세요.";
matches.forEach(function (entry) {
const li = document.createElement("li");
const link = document.createElement("a");
link.href = "#" + entry.heading.id;
const title = document.createElement("strong");
title.appendChild(marked(entry.title, terms));
const preview = document.createElement("span");
preview.appendChild(marked(snippet(entry.text, terms), terms));
link.append(title, preview);
li.appendChild(link);
results.appendChild(li);
});
}
const tocLinks = Array.from(root.querySelectorAll(".pjh-toc a"));
function activate(chapter) {
tocLinks.forEach(function (link) {
const active = link.getAttribute("href") === "#" + chapter.id;
link.classList.toggle("is-active", active);
if (active) link.setAttribute("aria-current", "location");
else link.removeAttribute("aria-current");
});
}
function jump(id) {
const target = document.getElementById(id);
if (!target || !root.contains(target)) return;
target.setAttribute("tabindex", "-1");
target.focus({ preventScroll: true });
target.scrollIntoView({ block: "start" });
const chapter = target.closest(".pjh-sec");
if (chapter) activate(chapter);
}
root.addEventListener("click", function (event) {
const link = event.target.closest('a[href^="#"]');
if (!link || event.button !== 0 || event.ctrlKey || event.metaKey || event.shiftKey || event.altKey) return;
const id = link.getAttribute("href").slice(1);
if (!document.getElementById(id)) return;
event.preventDefault();
if (window.location.hash !== "#" + id) window.history.pushState(null, "", "#" + id);
jump(id);
});
input.maxLength = 160;
input.addEventListener("compositionstart", function () { composing = true; });
input.addEventListener("compositionend", function () { composing = false; search(true); });
input.addEventListener("input", function () { if (!composing) search(true); });
form.addEventListener("submit", function (event) {
event.preventDefault();
if (composing) return;
search(true);
const first = results.querySelector("a");
if (first) first.click();
});
function reset() { input.value = ""; search(true); input.focus(); }
clear.addEventListener("click", reset);
input.addEventListener("keydown", function (event) {
if (composing || event.isComposing || event.keyCode === 229) return;
if (event.key === "Escape") { event.preventDefault(); reset(); }
});
document.addEventListener("keydown", function (event) {
if (event.key !== "/" || event.isComposing || event.ctrlKey || event.metaKey || event.altKey ||
event.target.closest("input, textarea, select, [contenteditable='true']")) return;
event.preventDefault();
input.focus();
input.scrollIntoView({ block: "center" });
});
function restore() {
input.value = (new URL(window.location.href).searchParams.get("q") || "").slice(0, 160);
search(false);
if (window.location.hash) jump(window.location.hash.slice(1));
}
window.addEventListener("popstate", restore);
window.addEventListener("hashchange", function () { if (window.location.hash) jump(window.location.hash.slice(1)); });
document.getElementById("pjh-search").hidden = false;
restore();
if ("IntersectionObserver" in window) {
const observer = new IntersectionObserver(function (entries) {
entries.forEach(function (entry) { if (entry.isIntersecting) activate(entry.target); });
}, { rootMargin: "-10% 0px -75% 0px" });
chapters.forEach(function (chapter) { observer.observe(chapter); });
}
})();
+40
View File
@@ -0,0 +1,40 @@
(function () {
"use strict";
const button = document.getElementById("pj-options-btn"), dialog = document.getElementById("pj-options-dialog");
if (!button || !dialog || button.dataset.bound) return;
button.dataset.bound = "1";
const names = { system: null, pretendard: "Pretendard Variable", "nanum-square": "NanumSquare",
"nanum-square-neo": "NanumSquareNeo", "nanum-square-round": "NanumSquareRound" };
const select = document.getElementById("pj-options-font"), preview = document.getElementById("pj-options-preview");
const error = document.getElementById("pj-options-error"), save = document.getElementById("pj-options-save");
const cancel = document.getElementById("pj-options-cancel");
function current() { const v = document.documentElement.dataset.pjFont; return Object.hasOwn(names, v) ? v : "system"; }
function paint() {
const font = names[select.value];
preview.style.fontFamily = font ? '"' + font + '", sans-serif' : "var(--pj-system-font)";
}
button.addEventListener("click", function () {
select.value = current(); error.hidden = true; paint(); dialog.showModal(); select.focus();
});
select.addEventListener("change", paint);
cancel.addEventListener("click", function () { if (!save.disabled) dialog.close(); });
dialog.addEventListener("cancel", function (e) { if (save.disabled) e.preventDefault(); });
dialog.addEventListener("close", function () { button.focus(); });
document.getElementById("pj-options-form").addEventListener("submit", async function (e) {
e.preventDefault(); if (save.disabled) return;
const value = select.value, font = names[value];
if (!Object.hasOwn(names, value)) return;
save.disabled = select.disabled = cancel.disabled = true; error.hidden = true;
try {
if (font && document.fonts) {
const loaded = await Promise.all([document.fonts.load('400 14px "' + font + '"', "가나다 Project"), document.fonts.load('700 14px "' + font + '"', "가나다 Project")]);
if (loaded.some(function (list) { return !list.length; })) throw new Error("폰트를 불러오지 못했습니다. 다시 시도해 주세요.");
}
localStorage.setItem("pj_font", value);
document.documentElement.dataset.pjFont = value;
window.dispatchEvent(new Event("resize"));
dialog.close();
} catch (err) { error.textContent = "설정을 저장하지 못했습니다. " + err.message; error.hidden = false; }
finally { save.disabled = select.disabled = cancel.disabled = false; }
});
})();
+270 -119
View File
@@ -1,3 +1,5 @@
@import url("project-fonts.css?v=20261002g");
/* 프로젝트 관리(아사나식) 모듈 스타일.
* 기존 erp.css 토큰(폰트 등) 위에 아사나 느낌의 색·카드·그림자를 별도 변수로
* 얹는다 — 다른 모듈(erp.css)은 그대로 두고 이 모듈(.pj- 클래스)에만 적용. */
@@ -6,21 +8,48 @@
--pj-accent: #7b68ee; /* 아사나 특유의 보라 포인트 컬러 */
--pj-accent-dark: #6453d6;
--pj-accent-tint: #f1eeff; /* 선택/호버 배경(연한 보라) */
--pj-ink: #151b26; /* 본문 텍스트(진한 남색 계열, 순검정 대신) */
--pj-ink-soft: #6b6f76; /* 보조 텍스트 */
--pj-ink: #050505; /* 아사나 본문 텍스트 */
--pj-ink-soft: #636363; /* 보조 텍스트 */
/* 완료된 하위 작업: 녹색 원 + 흰색 체크(아이콘 폰트의 투명한 체크 구멍 대신). */
--pj-completed-check-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' fill='%2358a182'/%3E%3Cpath d='m7.5 12 3 3 6-6' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
--pj-border: #e4e4e7;
--pj-card-radius: 12px;
--pj-card-shadow: 0 1px 2px rgba(16,24,40,.04), 0 2px 6px rgba(16,24,40,.06);
--pj-card-shadow-hover: 0 6px 16px rgba(16,24,40,.10), 0 2px 4px rgba(16,24,40,.06);
/* 아사나 웹앱 기본 시스템 폰트 + 한글 대체(Apple SD Gothic Neo·Malgun Gothic).
project.css 는 Project 화면에서만 불러오므로 공통 토큰 --font-geist 를 여기서
덮으면 본문·상단바·공용 대화상자(erp-dialog.css)까지 이 화면에서만 바뀐다. */
--pj-system-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
"Helvetica Neue", Helvetica, Arial,
"Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
--pj-font: var(--pj-system-font);
--font-geist: var(--pj-font);
/* 실제 아사나 웹앱에서 측정한 본문/보조/섹션/제목 타이포그래피.
공통 ERP 파일은 유지하고 Project가 불러오는 토큰만 재정의한다. */
--pj-text-size: 14px;
--pj-text-leading: 22px;
--pj-small-size: 12px;
--pj-small-leading: 18px;
--pj-section-size: 16px;
--pj-section-leading: 20px;
--pj-heading-size: 20px;
--pj-heading-leading: 28px;
--pj-title-size: 24px;
--pj-title-leading: 32px;
--leading-body: 1.5714285714; /* 14px 본문의 22px 줄 높이 */
}
.pj-wrap { padding: 4px 2px 40px; color: var(--pj-ink); }
/* 입력창·버튼은 브라우저 기본 폼 폰트 대신 본문 폰트를 따른다. :where() 라 특이성 0 —
아이콘 폰트(.material-symbols-*)·이모지 등 기존 font-family 지정이 항상 이긴다. */
:where(button, input, select, textarea, optgroup) { font-family: inherit; }
.pj-wrap { padding: 4px 2px 40px; color: var(--pj-ink); font-size: var(--pj-text-size); line-height: var(--pj-text-leading); font-weight: 400; }
/* ── 버튼 ── */
.pj-btn {
border: 1px solid #d8dce2; background: #fff; color: var(--pj-ink);
padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 600;
cursor: pointer; transition: background .12s, border-color .12s;
padding: 7px 14px; border-radius: 8px; font-size: var(--pj-text-size); font-weight: 500;
cursor: pointer; transition: background .12s, border-color .12s; line-height: var(--pj-text-leading);
}
.pj-btn:hover { background: #f6f7f8; }
.pj-btn-primary { background: var(--pj-accent); color: #fff; border-color: var(--pj-accent); }
@@ -36,8 +65,8 @@
.pj-section-head { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 14px; }
.pj-section-head-done { margin-top: 22px; }
.pj-section-head-done h2 { font-size: 14px; color: #6b7280; }
.pj-section-head h2 { font-size: 16px; font-weight: 700; margin: 0; }
.pj-section-head-done h2 { font-size: var(--pj-text-size); color: #6b7280; line-height: 20px; }
.pj-section-head h2 { font-size: var(--pj-section-size); font-weight: 500; margin: 0; line-height: var(--pj-section-leading); }
.pj-empty { padding: 28px; text-align: center; color: #6b7280; background: #f7f8f9; border-radius: 12px; }
.pj-empty-sm { padding: 10px 2px; color: #9aa1a9; font-size: 13px; }
@@ -66,7 +95,8 @@
뷰포트보다 48px 넓어진다. 그러면 우측 "내 업무" 패널의 오른쪽 끝(=스크롤
막대 자리)이 화면 밖으로 밀려나 막대가 절대 안 보인다(헤드리스 크롬 좌표
덤프로 확인: 패널 right=1917 > viewport 1911). */
.erp-page:has(> .pj-wrap) { max-width: none; box-sizing: border-box; }
.erp-page:has(> .pj-wrap) { max-width: none; box-sizing: border-box; padding-left: 8px; padding-right: 8px; }
.erp-page > .pj-wrap { padding-left: 0; padding-right: 0; }
.pj-project-view { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.pj-project-view .pj-layout { flex: 1 1 auto; min-height: 0; }
/* grid-template-rows: minmax(0,1fr) 이 없으면 암시적 행이 "auto"(내용 크기)로
@@ -77,10 +107,13 @@
/* 우측에 항상 떠 있던 "내 업무" 칸은 없앴다 — 좌측 사이드바의 접이식
"내 업무" 메뉴(.pj-mytasks-panel)가 그 역할을 대신한다. 그래서 2열. */
.pj-layout {
display: grid; grid-template-columns: 250px 1fr; grid-template-rows: minmax(0, 1fr);
gap: 22px; height: 100%; min-height: 0; align-items: stretch;
position: relative; display: grid; grid-template-columns: var(--pj-side-w, 250px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr);
gap: 8px; height: 100%; min-height: 0; align-items: stretch;
}
.pj-side { min-width: 0; min-height: 0; height: 100%; overflow-y: auto; padding-right: 14px; }
.pj-side-resizer { position: absolute; top: 0; bottom: 0; left: var(--pj-side-w, 250px); width: 8px; padding: 0; border: 0; background: transparent; cursor: col-resize; z-index: 12; }
.pj-side-resizer:hover, .pj-side-resizer:focus-visible, .pj-side-resizer.is-dragging { background: var(--pj-accent-tint); outline: none; }
html.pj-side-resizing, html.pj-side-resizing * { cursor: col-resize !important; user-select: none !important; }
.pj-side { min-width: 0; min-height: 0; height: 100%; overflow-y: auto; padding-right: 14px; container: pj-side / inline-size; }
.pj-main { min-width: 0; min-height: 0; height: 100%; display: flex; flex-direction: column; }
/* ── 자체 스크롤 패널(내 업무/좌측 목록/홈 프로젝트 목록/보드)의 스크롤 막대 ──
@@ -102,17 +135,19 @@
.pj-vbar-thumb:hover, .pj-vbar-thumb.is-dragging { background: #8f949e; }
.pj-vbar-thumb.is-dragging { cursor: grabbing; }
@media (max-width: 1280px) {
.pj-layout { grid-template-columns: 220px 1fr; }
.pj-layout { grid-template-columns: var(--pj-side-w, 220px) minmax(0, 1fr); }
.pj-side-resizer { left: var(--pj-side-w, 220px); }
}
@media (max-width: 900px) {
.erp-page:has(> .pj-wrap) { max-width: 1550px; }
.erp-page > .pj-wrap.pj-project-view { display: block; }
.pj-layout { display: block; height: auto; }
.pj-side-resizer { display: none; }
.pj-side, .pj-main { height: auto; overflow: visible; }
}
.pj-side-block { margin-bottom: 22px; }
.pj-side-head { display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 800; color: #6b7280; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.pj-side-head { display: flex; align-items: center; justify-content: space-between; font-size: var(--pj-small-size); font-weight: 500; color: #6b7280; text-transform: uppercase; letter-spacing: normal; margin-bottom: 8px; line-height: var(--pj-small-leading); }
.pj-side-head-done { margin-top: 14px; }
#pj-tree-root-done .pj-tree-avatar,
#pj-tree-root-done .pj-tree-name { opacity: .6; }
@@ -125,7 +160,7 @@
.pj-tree-row { display: flex; align-items: center; gap: 2px; border-radius: 8px; padding-right: 2px; position: relative; }
.pj-tree-row:hover { background: #f1f2f4; }
.pj-tree-row.is-active { background: var(--pj-accent-tint); }
.pj-tree-row.is-active .pj-tree-name { font-weight: 700; color: var(--pj-accent-dark); }
.pj-tree-row.is-active .pj-tree-name { font-weight: 500; color: var(--pj-accent-dark); }
.pj-tree-link { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0;
text-decoration: none; color: inherit; padding: 6px 4px; }
/* 프로젝트 색 + 첫 글자 — 아사나의 색 아이콘 자리를 대신한다 */
@@ -136,7 +171,7 @@
}
.pj-tree-avatar .pj-proj-ic { font-size: 16px; color: #fff; }
.pj-tree-avatar.is-light, .pj-tree-avatar.is-light .pj-proj-ic { color: #1e1f21; }
.pj-tree-name { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-tree-name { font-size: var(--pj-text-size); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: var(--pj-text-leading); font-weight: 400; }
.pj-tree-acts { display: none; gap: 0; flex: 0 0 auto; }
.pj-tree-row:hover .pj-tree-acts { display: inline-flex; }
.pj-tree-acts .pj-icon-btn { width: 22px; height: 22px; font-size: 14px; }
@@ -160,7 +195,7 @@
/* 아사나식 머리 — 왼쪽 위에 두 줄: ① 아이콘·제목 + 멤버, ② 뷰 탭 */
.pj-head-left { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.pj-title-wrap { max-width: 100%; min-width: 0; display: flex; align-items: center; gap: 10px; }
.pj-project-title { min-width: 0; margin: 0; }
.pj-project-title { min-width: 0; margin: 0; font-size: var(--pj-heading-size); line-height: var(--pj-heading-leading); font-weight: 500; }
/* 전체 프로젝트 스코프 — 제목을 "전체 프로젝트"로, 이 프로젝트 멤버는 숨긴다 */
.pj-title-wrap .pj-all-title { display: none; }
.pj-title-wrap.is-all-scope .pj-all-title { display: block; }
@@ -185,9 +220,9 @@
/* 제목 — 프로젝트 색 사각형 하나에 아이콘 + 이름(글자는 흰색, 밝은 색이면 진한 색) */
.pj-project-title-pill, .pj-project-title-all {
display: inline-flex; align-items: center; gap: 8px; max-width: 100%; vertical-align: middle;
font-size: 21px; font-weight: 700; color: #fff; line-height: 1.2;
font-size: var(--pj-heading-size); font-weight: 500; color: #fff; line-height: var(--pj-heading-leading);
background: var(--pj-color, var(--pj-accent)); border-radius: 10px;
padding: 6px 12px 6px 10px; white-space: nowrap;
padding: 6px 12px 6px 10px; white-space: nowrap; letter-spacing: normal;
}
.pj-project-title-pill.is-light { color: #1e1f21; }
.pj-project-title-all { background: #5f6368; }
@@ -212,7 +247,7 @@
.pj-view[hidden] { display: none; }
.pj-view[data-view="board"]:not([hidden]) { display: flex; flex-direction: column; overflow: hidden; }
.pj-view-tabs { display: inline-flex; position: relative; flex: 0 0 auto; background: #eef0f2; border-radius: 10px; padding: 3px; gap: 2px; }
.pj-tab { position: relative; z-index: 1; border: none; background: transparent; padding: 7px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; color: #525860; cursor: pointer; white-space: nowrap; }
.pj-tab { position: relative; z-index: 1; border: none; background: transparent; padding: 7px 16px; border-radius: 8px; font-size: var(--pj-text-size); font-weight: 500; color: #525860; cursor: pointer; white-space: nowrap; line-height: var(--pj-text-leading); }
.pj-tab.is-active { background: transparent; color: #fff; }
/* 뷰 탭이 바뀔 때 배경이 새 탭 위치로 미끄러지는 하이라이트 — is-active 의
단순 배경색 대신 이 절대배치 요소 하나가 실제로 움직인다. */
@@ -224,9 +259,9 @@
.pj-tab-highlight.pj-no-anim { transition: none; }
/* 뷰 탭(보드/목록/…) — 아사나처럼 제목 아래 글자 탭 줄, 고른 탭만 옅은 배경 */
.pj-view-tabs-line { background: transparent; padding: 0; gap: 2px; margin-left: -4px; }
.pj-view-tabs-line .pj-tab { padding: 5px 10px; font-size: 14px; font-weight: 500; color: #525860; border-radius: 6px; }
.pj-view-tabs-line .pj-tab { padding: 5px 10px; font-size: var(--pj-text-size); font-weight: 500; color: #525860; border-radius: 6px; line-height: var(--pj-text-leading); }
.pj-view-tabs-line .pj-tab:hover { color: #1e1f21; }
.pj-view-tabs-line .pj-tab.is-active { color: #1e1f21; font-weight: 600; }
.pj-view-tabs-line .pj-tab.is-active { color: #1e1f21; font-weight: 500; }
.pj-view-tabs-line .pj-tab-highlight { top: 0; background: #ebe8fd; border-radius: 6px; box-shadow: none; }
/* 알림 벨 흔들림(미읽음 있을 때) */
@@ -264,9 +299,10 @@
너비는 고정(300px), 높이는 내용만큼 — 보드 높이를 넘으면 그 컬럼 안에서
세로 스크롤(.pj-col-body). */
.pj-col {
--pj-card-radius: 6px;
flex: 0 0 300px; width: 300px; max-height: 100%;
display: flex; flex-direction: column; min-height: 0;
background: #eef0f4; border: 1px solid #e2e4ea; border-radius: 14px;
background: #ececec; border: 1px solid #e2e4ea; border-radius: 6px;
/* 좌우 여백은 작게(6px) — 카드가 컬럼 폭을 더 쓴다 */
padding: 12px 6px; box-sizing: border-box;
}
@@ -278,8 +314,8 @@
padding: 2px 6px 12px; margin-bottom: 4px; color: var(--pj-ink);
border-bottom: 1px solid #e2e4ea;
}
/* 세션 제목 — 업무 카드 제목(pj-card-title 13.5px/600)보다 뚜렷하게 크고 굵게 */
.pj-col-name { font-size: 15.5px; font-weight: 800; }
/* 세션 제목 — 아사나 보드의 16px/20px, 굵기 500 */
.pj-col-name { font-size: var(--pj-section-size); font-weight: 500; line-height: var(--pj-section-leading); }
/* 세션 기본 담당자 아이콘 — 이름 옆에 작게 */
.pj-col-assignee { display: inline-flex; align-items: center; flex: 0 0 auto; }
.pj-col-assignee .pj-avatar { width: 20px; height: 20px; box-shadow: 0 0 0 1.5px #fff; }
@@ -295,15 +331,15 @@
.pj-col-name.pj-col-name-editable:hover { background: rgba(0,0,0,.06); }
.pj-col-head-colored .pj-col-name.pj-col-name-editable:hover { background: rgba(255,255,255,.22); }
.pj-col-name-input {
font: inherit; font-size: 15.5px; font-weight: 800; color: var(--pj-ink);
font: inherit; font-size: var(--pj-section-size); font-weight: 500; color: var(--pj-ink);
min-width: 0; flex: 1 1 auto; max-width: 70%; padding: 2px 6px;
border: 1px solid var(--pj-accent); border-radius: 6px; background: #fff; outline: none;
border: 1px solid var(--pj-accent); border-radius: 6px; background: #fff; outline: none; line-height: var(--pj-section-leading);
}
/* 세션 색상 지정 시 — 점 대신 헤더(윗부분) 전체를 그 색으로 칠한다.
.pj-col 의 padding(위 12px·좌우 6px)만큼 밀어내 컬럼 테두리에 딱 맞춘다. */
.pj-col-head.pj-col-head-colored {
margin: -12px -6px 4px; padding: 10px 14px; border-bottom: none;
border-radius: 13px 13px 0 0;
border-radius: 5px 5px 0 0;
}
.pj-col-head.pj-col-head-colored .pj-col-name { color: #fff; }
.pj-col-head.pj-col-head-colored .pj-col-count { color: rgba(255,255,255,.85); }
@@ -330,6 +366,19 @@
.pj-col-actions .pj-icon-btn { width: 28px; height: 28px; color: var(--pj-ink-soft); }
.pj-col-actions .pj-icon-btn .material-symbols-outlined { font-size: 20px; }
.pj-col-actions .pj-icon-btn:hover { color: var(--pj-ink); background: rgba(0,0,0,.06); }
.pj-col-collapse svg { width: 18px; height: 18px; }
.pj-col.is-collapsed { flex-basis: 48px; width: 48px; padding: 0; }
.pj-col.is-collapsed .pj-col-head { flex-direction: column; gap: 10px; padding: 10px 8px; margin: 0; border: 0; border-radius: 5px; }
.pj-col.is-collapsed .pj-col-name { writing-mode: vertical-rl; text-orientation: mixed; overflow-wrap: anywhere; max-height: 240px; }
.pj-col.is-collapsed .pj-col-count { writing-mode: vertical-rl; }
.pj-col.is-collapsed .pj-col-body,
.pj-col.is-collapsed .pj-col-addtask,
.pj-col.is-collapsed .pj-col-assignee,
.pj-col.is-collapsed .pj-chip,
.pj-col.is-collapsed .pj-col-actions > :not(.pj-col-collapse) { display: none; }
.pj-col.is-collapsed .pj-col-head.pj-col-head-colored { margin: 0; }
.pj-col.is-collapsed .pj-col-actions { order: -1; margin: 0; }
.pj-col.is-collapsed .pj-col-collapse svg { transform: rotate(180deg); }
/* 컬럼 안의 카드가 많아지면 보드 전체가 아니라 이 컬럼만 세로로 스크롤한다
— 그래야 가로로 늘어난 다른 세션들이 화면 밖으로 밀려나지 않는다. */
.pj-col-body {
@@ -365,16 +414,39 @@
}
.pj-card:hover { box-shadow: var(--pj-card-shadow-hover); transform: translateY(-1px); }
.pj-card.is-dragging { opacity: .5; }
.pj-card.pj-tasknew {
flex: none; min-height: 106px; box-sizing: border-box; border-color: #8b8c8d; cursor: default;
}
.pj-card.pj-tasknew:hover { transform: none; }
.pj-tasknew-name { display: flex; align-items: center; gap: 6px; }
.pj-tasknew-check { display: inline-flex; color: #8b8c8d; font-size: 19px; }
.pj-tasknew-title {
flex: 1; min-width: 0; padding: 0; border: 0; outline: none; box-shadow: none;
background: transparent; color: var(--pj-ink); font: inherit;
font-size: var(--pj-text-size); line-height: var(--pj-text-leading);
}
.pj-tasknew-title::placeholder { color: #6d6e6f; }
.pj-tasknew-meta { display: flex; align-items: center; gap: 10px; margin-top: 20px; }
.pj-tasknew-meta button {
display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px;
padding: 0; border: 0; border-radius: 4px; background: transparent; color: #6d6e6f;
font: inherit; font-size: var(--pj-small-size); cursor: pointer;
}
.pj-tasknew-meta button:hover { background: #f1f2f4; }
.pj-tasknew-meta .pj-avatar { width: 20px; height: 20px; }
.pj-tasknew[aria-busy="true"] { opacity: .65; }
/* 하위 업무 한 줄 드래그 — 끄는 줄은 흐리게, 놓을 수 있는 카드는 보라 테두리 */
.pj-card-sub[draggable="true"] .pj-card-sub-title { cursor: grab; }
.pj-card-sub.is-dragging { opacity: .4; }
.pj-card-sub.pj-sub-drop-before { box-shadow: inset 0 2px var(--pj-accent); }
.pj-card-sub.pj-sub-drop-after { box-shadow: inset 0 -2px var(--pj-accent); }
.pj-card.is-sub-drop { outline: 2px solid var(--pj-accent); outline-offset: -2px; background: var(--pj-accent-tint); }
.pj-card.is-done .pj-card-title { text-decoration: line-through; color: #9aa1a9; }
.pj-card-title { font-size: 13.5px; font-weight: 600; color: var(--pj-ink); line-height: 1.4; }
.pj-card.is-done .pj-card-title { color: #9aa1a9; }
.pj-card-title { font-size: var(--pj-text-size); font-weight: 400; color: var(--pj-ink); line-height: var(--pj-text-leading); }
.pj-card-meta { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.pj-card-due { margin-left: auto; font-size: 12.1px; color: var(--pj-ink-soft); font-weight: 600; } /* 11px +10% */
/* 보드 카드 담당자 — 글자·아바타 10% 크게(12→13.2px, 18→20px) */
.pj-card-meta .pj-card-assignee { font-size: 13.2px; }
.pj-card-due { margin-left: auto; font-size: var(--pj-small-size); color: var(--pj-ink-soft); font-weight: 400; line-height: var(--pj-small-leading); }
/* 보드 카드 담당자 — 보조 텍스트 12px/18px, 아바타 크기는 유지 */
.pj-card-meta .pj-card-assignee { font-size: var(--pj-small-size); line-height: var(--pj-small-leading); font-weight: 400; }
.pj-card-meta .pj-card-assignee .pj-avatar.pj-gicon-sm { width: 20px; height: 20px; }
.pj-card-meta .pj-card-assignee .pj-gicon-sm { font-size: 22px; }
/* 카드 높이 100px 고정(표지 이미지·펼친 하위 작업은 그 위·아래에 더해짐) — 머리 = 100 − 아래 여백 12 − 테두리 2.
@@ -385,6 +457,17 @@
.pj-card-head .pj-card-title {
display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; flex: none;
}
.pj-card-title-row { display: flex; align-items: flex-start; gap: 6px; flex: none; }
.pj-card-title-row .pj-card-title { flex: 1; min-width: 0; }
.pj-card-check {
display: inline-flex; align-items: center; justify-content: center; flex: 0 0 18px; width: 18px; height: 22px;
padding: 0; border: none; background: transparent; border-radius: 50%; color: #6d6e6f; cursor: pointer;
}
.pj-card-check .material-symbols-outlined { font-size: 18px; }
.pj-card-check:hover:not(:disabled) { color: #58a182; }
.pj-card-check:focus-visible { outline: 2px solid var(--pj-accent); outline-offset: 2px; }
.pj-card-check:disabled { cursor: default; }
.pj-card-check[aria-busy="true"] { opacity: .5; }
.pj-card-head:has(.pj-card-proj) .pj-card-title { -webkit-line-clamp: 1; }
.pj-card:has(.pj-card-subs-wrap.is-open) .pj-card-head { height: 96px; } /* 펼침 때 아래 10px 여백(음수 margin)만큼 */
.pj-card-head .pj-card-meta { margin-top: auto; padding-top: 6px; flex: none; }
@@ -401,8 +484,8 @@
.pj-pri-low { background: #e6eef0; color: #4a6066; }
/* ── 리스트 ── */
.pj-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.pj-table th { text-align: left; padding: 9px 10px; border-bottom: 2px solid #eef0f2; color: #1e1f21; font-size: 14px; font-weight: 700; position: relative; }
.pj-table { width: 100%; border-collapse: collapse; font-size: var(--pj-text-size); line-height: var(--pj-text-leading); }
.pj-table th { text-align: left; padding: 9px 10px; border-bottom: 2px solid #eef0f2; color: #1e1f21; font-size: var(--pj-small-size); font-weight: 500; position: relative; line-height: var(--pj-small-leading); }
.pj-table td { padding: 10px; border-bottom: 1px solid #f1f2f4; }
.pj-table tr.is-done td { color: #9aa1a9; text-decoration: line-through; }
.pj-table-fixed { table-layout: fixed; }
@@ -412,8 +495,8 @@
.pj-list-group-row { background: #fafafd; }
.pj-list-group-head {
display: flex; align-items: center; gap: 6px; padding: 10px 6px !important;
font-size: 13px; font-weight: 700; color: var(--pj-ink); cursor: pointer;
border-bottom: 1px solid var(--pj-border) !important; white-space: nowrap;
font-size: var(--pj-section-size); font-weight: 500; color: var(--pj-ink); cursor: pointer;
border-bottom: 1px solid var(--pj-border) !important; white-space: nowrap; line-height: var(--pj-section-leading);
}
.pj-list-group-caret { font-size: 18px; color: var(--pj-ink-soft); }
.pj-list-group-count {
@@ -682,16 +765,15 @@ html.pj-ui-scale #pj-timeline { zoom: calc(1 / var(--pj-z)); --tz: var(--pj-z);
.pj-task-modal-card { width: 100vw; max-width: 100vw; min-width: 0; }
.pj-side-2col { display: block; }
}
.pj-modal-card h3 { margin: 0 0 16px; font-size: 17px; }
.pj-modal-card h3 { margin: 0 0 16px; font-size: var(--pj-heading-size); line-height: var(--pj-heading-leading); font-weight: 500; letter-spacing: normal; }
.pj-modal-hint { margin: -6px 0 14px; font-size: 12px; color: #6b7280; }
/* 업무 편집 팝업 — 아사나식 레이아웃. 버튼 줄 바로 아래 큰 무테 제목
입력칸 하나뿐(작은 안내줄은 없앰). height+line-height 를 맞춰 그 줄
안에서 글자가 세로 가운데에 오도록 한다(한 줄짜리 input 표준 기법). */
.pj-t-title-input {
display: block; width: 100%; border: none !important; background: transparent !important;
min-height: 40px; line-height: 1.4; font-size: 19px !important; font-weight: 700;
padding: 7px 4px !important; margin: 4px 0 8px !important;
입력칸 하나뿐(작은 안내줄은 없앰). 제목은 아사나의 24px/32px, 굵기 500을 따른다. */
.pj-modal-card .pj-t-title-input {
display: block; width: calc(100% + 12px); border: none !important; background: transparent !important;
min-height: 46px; line-height: var(--pj-title-leading); font-size: var(--pj-title-size) !important; font-weight: 500;
padding: 6px 12px !important; margin: 4px 0 8px -12px !important;
color: var(--pj-ink); box-sizing: border-box;
/* textarea — 긴 제목은 다음 줄로(높이는 JS fitTitleHeight 가 맞춘다) */
resize: none; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere;
@@ -714,15 +796,15 @@ html.pj-ui-scale #pj-timeline { zoom: calc(1 / var(--pj-z)); --tz: var(--pj-z);
display: flex; align-items: center; min-height: 40px;
border-bottom: 1px solid #f1f2f4; gap: 12px;
}
.pj-meta-label2 { flex: 0 0 92px; font-size: 13px; font-weight: 600; color: var(--pj-ink-soft); }
.pj-meta-label2 { flex: 0 0 92px; font-size: var(--pj-small-size); font-weight: 400; color: var(--pj-ink); line-height: var(--pj-small-leading); }
.pj-meta-value2 { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.pj-meta-ic { font-size: 18px; color: #9aa1a9; flex: none; }
.pj-meta-value2 select, .pj-meta-value2 input,
.pj-meta-cell select, .pj-meta-cell input {
display: block; width: auto; max-width: 100%; margin: 0 !important; padding: 6px 8px !important;
border: 1px solid transparent !important; border-radius: 6px !important; background: transparent !important;
font-size: 13.5px !important; font-weight: 600; font-family: inherit; color: var(--pj-ink);
box-sizing: border-box; cursor: pointer;
font-size: var(--pj-text-size) !important; font-weight: 400; font-family: inherit; color: var(--pj-ink);
box-sizing: border-box; cursor: pointer; line-height: var(--pj-text-leading);
}
.pj-meta-value2 select:hover, .pj-meta-value2 input:hover,
.pj-meta-value2 select:focus, .pj-meta-value2 input:focus,
@@ -738,7 +820,7 @@ html.pj-ui-scale #pj-timeline { zoom: calc(1 / var(--pj-z)); --tz: var(--pj-z);
.pj-meta-cell-stage { flex: 1 1 0; }
.pj-meta-cell-assignee { flex: 0 1 auto; }
.pj-meta-cell-priority, .pj-meta-cell-due { flex: 0 0 auto; }
.pj-meta-cell-label { font-size: 13px; font-weight: 600; color: var(--pj-ink-soft); white-space: nowrap; flex: none; }
.pj-meta-cell-label { font-size: var(--pj-small-size); font-weight: 400; color: var(--pj-ink); white-space: nowrap; flex: none; line-height: var(--pj-small-leading); }
.pj-meta-cell select { flex: 1 1 auto; min-width: 0; width: 100%; text-overflow: ellipsis; }
.pj-meta-cell-priority select { width: auto; }
.pj-meta-cell-assignee select { width: auto; max-width: 150px; }
@@ -748,7 +830,7 @@ html.pj-ui-scale #pj-timeline { zoom: calc(1 / var(--pj-z)); --tz: var(--pj-z);
.pj-due-btn {
display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 6px;
border: 1px solid transparent; border-radius: 6px; background: transparent; cursor: pointer;
color: #6b6f76; font-size: 13.5px; font-weight: 600; font-family: inherit; white-space: nowrap;
color: var(--pj-ink-soft); font-size: var(--pj-text-size); font-weight: 400; font-family: inherit; white-space: nowrap; line-height: var(--pj-text-leading);
}
.pj-due-btn .material-symbols-outlined { font-size: 20px; }
.pj-due-btn:hover { border-color: var(--pj-border); background: #f6f7f8; color: var(--pj-ink); }
@@ -759,7 +841,7 @@ html.pj-ui-scale #pj-timeline { zoom: calc(1 / var(--pj-z)); --tz: var(--pj-z);
.pj-date-btn {
display: inline-flex; align-items: center; gap: 6px; margin-top: 5px; height: 36px; padding: 0 12px;
border: 1px solid #d8dce2; border-radius: 8px; background: #fff; cursor: pointer;
font-size: 13.5px; font-family: inherit; font-weight: 500; color: var(--pj-ink); white-space: nowrap;
font-size: var(--pj-text-size); font-family: inherit; font-weight: 500; color: var(--pj-ink); white-space: nowrap; line-height: var(--pj-text-leading);
}
.pj-date-btn .material-symbols-outlined { font-size: 19px; color: #6d6e6f; }
.pj-date-btn:hover { background: #f6f7f8; border-color: #c4c9d0; }
@@ -787,10 +869,10 @@ html.pj-ui-scale #pj-timeline { zoom: calc(1 / var(--pj-z)); --tz: var(--pj-z);
.pj-meta-row-multi { display: grid; grid-template-columns: 1fr 1fr; }
.pj-meta-cell:nth-child(3) { border-left: none; padding-left: 0; margin-left: 0; }
}
.pj-extra-label { font-size: 12.5px; font-weight: 700; color: var(--pj-ink-soft); margin-right: auto; }
.pj-modal-card label { display: block; font-size: 12.5px; font-weight: 600; color: #525860; margin-bottom: 12px; }
.pj-extra-label { font-size: var(--pj-text-size); font-weight: 500; color: var(--pj-ink); margin-right: auto; line-height: 20px; }
.pj-modal-card label { display: block; font-size: var(--pj-small-size); font-weight: 400; color: var(--pj-ink); margin-bottom: 12px; line-height: var(--pj-small-leading); }
.pj-modal-card input[type=text], .pj-modal-card input[type=date], .pj-modal-card textarea, .pj-modal-card select {
display: block; width: 100%; margin-top: 5px; padding: 8px 10px; border: 1px solid #d8dce2; border-radius: 8px; font-size: 13.5px; font-family: inherit; box-sizing: border-box;
display: block; width: 100%; margin-top: 5px; padding: 8px 10px; border: 1px solid #d8dce2; border-radius: 8px; font-size: var(--pj-text-size); font-family: inherit; box-sizing: border-box; line-height: var(--pj-text-leading);
}
.pj-form-row { display: flex; gap: 12px; }
.pj-form-row label { flex: 1; }
@@ -814,8 +896,8 @@ html.pj-ui-scale #pj-timeline { zoom: calc(1 / var(--pj-z)); --tz: var(--pj-z);
background: #fff; border-bottom: 1px solid #eef0f2;
flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden;
}
.pj-modal-actions-top .pj-btn { flex: none; padding: 3px 8px; font-size: 11px; }
.pj-btn-complete { background: #e9f7ef; color: #1e8e5a; border: 1px solid #bfe8d2; font-weight: 700; }
.pj-modal-actions-top .pj-btn { flex: none; padding: 3px 8px; font-size: var(--pj-small-size); line-height: var(--pj-small-leading); font-weight: 500; }
.pj-btn-complete { background: #e9f7ef; color: #1e8e5a; border: 1px solid #bfe8d2; font-weight: 500; }
.pj-btn-complete:hover { background: #d9f2e4; }
.pj-btn-complete.is-done { background: #f2f2f4; color: #6b6f76; border-color: var(--pj-border); }
@@ -854,8 +936,8 @@ html.pj-ui-scale #pj-timeline { zoom: calc(1 / var(--pj-z)); --tz: var(--pj-z);
/* ── 업무 모달 댓글/첨부 ── */
.pj-task-extra { border-top: 1px solid #eef0f2; margin-top: 14px; padding-top: 12px; }
.pj-extra-head { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: #525860; margin-bottom: 8px; }
.pj-upload-btn { margin-left: auto; font-size: 12px; font-weight: 600; color: #4573d2; cursor: pointer; padding: 3px 8px; border: 1px solid #cdd9f0; border-radius: 7px; }
.pj-extra-head { display: flex; align-items: center; gap: 6px; font-size: var(--pj-text-size); font-weight: 500; color: var(--pj-ink); margin-bottom: 8px; line-height: 20px; }
.pj-upload-btn { margin-left: auto; font-size: var(--pj-small-size); font-weight: 500; color: #4573d2; cursor: pointer; padding: 3px 8px; border: 1px solid #cdd9f0; border-radius: 7px; line-height: var(--pj-small-leading); }
.pj-upload-btn:hover { background: #eef3fc; }
.pj-attach-list, .pj-comment-list { list-style: none; margin: 0 0 6px; padding: 0; max-height: 160px; overflow-y: auto; }
@@ -866,23 +948,23 @@ html.pj-ui-scale #pj-timeline { zoom: calc(1 / var(--pj-z)); --tz: var(--pj-z);
.pj-comment-item { display: flex; align-items: flex-start; gap: 8px; padding: 7px 2px; }
.pj-comment-main { flex: 1; }
.pj-comment-head { font-size: 12.5px; font-weight: 700; color: #1e1f21; }
.pj-comment-time { font-weight: 400; color: #9aa1a9; font-size: 11px; margin-left: 6px; }
.pj-comment-body { font-size: 13px; color: #333; margin-top: 1px; white-space: pre-wrap; }
.pj-comment-head { font-size: var(--pj-text-size); font-weight: 500; color: #1e1f21; line-height: 20px; }
.pj-comment-time { font-weight: 400; color: #9aa1a9; font-size: var(--pj-small-size); margin-left: 6px; line-height: var(--pj-small-leading); }
.pj-comment-body { font-size: var(--pj-text-size); color: var(--pj-ink); margin-top: 1px; white-space: pre-wrap; line-height: var(--pj-text-leading); font-weight: 400; }
/* 댓글 속 웹페이지 주소 — 누르면 새 탭(linkifyToHtml). 긴 주소는 줄바꿈 */
.pj-comment-body a, .pj-chat-bubble a { color: #1a5fd0; text-decoration: underline; word-break: break-all; }
.pj-comment-body a:hover, .pj-chat-bubble a:hover { color: #0b3f99; }
.pj-comment-form { display: flex; align-items: center; gap: 6px; }
.pj-comment-form input { flex: 1; padding: 7px 10px; border: 1px solid #d8dce2; border-radius: 8px; font-size: 13px; font-family: inherit; box-sizing: border-box; }
/* 댓글·답글 여러 줄 입력칸 — Enter 등록 · Shift+Enter 줄바꿈, 글 줄 수만큼 늘어남(project.js fitComposer, 최대 160px) */
.pj-comment-form input { flex: 1; padding: 7px 10px; border: 1px solid #d8dce2; border-radius: 8px; font-size: var(--pj-text-size); font-family: inherit; box-sizing: border-box; line-height: var(--pj-text-leading); font-weight: 400; }
/* 댓글·답글 입력칸은 70px 고정, 긴 글은 칸 안에서 스크롤한다. */
.pj-comment-form textarea.pj-composer-ta {
flex: 1; min-width: 0; padding: 7px 10px; border: 1px solid #d8dce2; border-radius: 8px; font-size: 13px; font-family: inherit;
line-height: 1.45; box-sizing: border-box; resize: none; overflow-y: hidden; max-height: 160px; align-self: center;
flex: 1; min-width: 0; padding: 7px 10px; border: 1px solid #d8dce2; border-radius: 8px; font-size: var(--pj-text-size); font-family: inherit;
line-height: var(--pj-text-leading); box-sizing: border-box; resize: none; overflow-y: auto; height: 70px; min-height: 70px; max-height: 70px; align-self: center; font-weight: 400;
}
.pj-comment-form textarea.pj-composer-ta:focus { outline: none; border-color: #a9aeb6; }
.pj-comment-acts { display: inline-flex; gap: 1px; flex: 0 0 auto; }
.pj-comment-edit-box { margin-top: 5px; }
.pj-comment-edit-box textarea { width: 100%; box-sizing: border-box; padding: 7px 9px; border: 1px solid #d8dce2; border-radius: 8px; font-size: 13px; font-family: inherit; resize: vertical; }
.pj-comment-edit-box textarea { width: 100%; box-sizing: border-box; padding: 7px 9px; border: 1px solid #d8dce2; border-radius: 8px; font-size: var(--pj-text-size); font-family: inherit; resize: vertical; line-height: var(--pj-text-leading); font-weight: 400; }
.pj-comment-edit-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 6px; }
.pj-comment-edit-actions .pj-btn { padding: 4px 12px; font-size: 12px; }
@@ -908,7 +990,7 @@ html.pj-ui-scale #pj-timeline { zoom: calc(1 / var(--pj-z)); --tz: var(--pj-z);
.pj-cmt-badge.is-unread .pj-cmt-n { color: #e8384f; font-weight: 800; }
/* ── 새 프로젝트 모달 — 멤버 선택 ── */
.pj-modal-card .pj-field-label { display: block; font-size: 12.5px; font-weight: 600; color: #525860; margin-bottom: 12px; }
.pj-modal-card .pj-field-label { display: block; font-size: var(--pj-small-size); font-weight: 400; color: var(--pj-ink); margin-bottom: 12px; line-height: var(--pj-small-leading); }
.pj-member-picker { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 5px; max-height: 140px; overflow-y: auto; padding: 6px 2px; border: 1px solid #eef0f2; border-radius: 8px; }
.pj-member-pick { display: inline-flex !important; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 500 !important; color: #333; width: auto !important; margin: 0 !important; }
.pj-member-pick input { width: auto !important; margin: 0 !important; }
@@ -925,13 +1007,16 @@ html.pj-ui-scale #pj-timeline { zoom: calc(1 / var(--pj-z)); --tz: var(--pj-z);
.pj-member-pick-avatar img.pj-member-pick-icon { width: 36px; height: 36px; }
.pj-member-pick-stacked .pj-member-pick-name { font-size: 12.5px; }
/* ── 좌측 사이드바 "전체 멤버" — 4열 그리드, 아이콘 아래 이름(새 프로젝트
/* ── 좌측 사이드바 "전체 멤버" — 메뉴의 실제 내부 폭에 따라 4열↔3열, 아이콘 아래 이름(새 프로젝트
모달의 pj-member-pick-stacked 와 같은 아이콘 크기 재사용). ── */
.pj-allmembers-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 4px; }
.pj-allmembers-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 4px; }
@container pj-side (max-width: 207px) {
.pj-allmembers-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.pj-allmember-item {
display: flex; flex-direction: column; align-items: center; gap: 4px;
padding: 6px 2px; border: none; background: none; border-radius: 8px; cursor: pointer;
font: inherit; width: 100%;
font: inherit; width: 100%; min-width: 0; box-sizing: border-box;
}
.pj-allmember-item:hover { background: #f5f6f8; }
.pj-allmember-item .pj-member-pick-icon.material-symbols-outlined { font-size: 40px; }
@@ -986,8 +1071,8 @@ html.pj-ui-scale #pj-timeline { zoom: calc(1 / var(--pj-z)); --tz: var(--pj-z);
.pj-chat-msg.other .pj-chat-name { font-size: 12px; font-weight: 600; color: #4b5563; }
.pj-chat-bubble {
background: #fff; border-radius: 14px 14px 14px 4px; padding: 8px 12px;
font-size: 13.5px; color: #1e1f21; white-space: pre-wrap; word-break: break-word;
box-shadow: 0 1px 2px rgba(0,0,0,.06);
font-size: var(--pj-text-size); color: #1e1f21; white-space: pre-wrap; word-break: break-word;
box-shadow: 0 1px 2px rgba(0,0,0,.06); line-height: var(--pj-text-leading); font-weight: 400;
}
.pj-chat-msg.mine .pj-chat-bubble { background: #fee500; border-radius: 14px 14px 4px 14px; }
.pj-chat-meta { display: flex; align-items: center; gap: 3px; margin-top: 3px; padding: 0 2px; }
@@ -1053,7 +1138,7 @@ html.pj-ui-scale #pj-timeline { zoom: calc(1 / var(--pj-z)); --tz: var(--pj-z);
/* ── 보드 단계 컨트롤 ── */
.pj-col-head { position: relative; }
.pj-col-name { font-weight: 700; }
.pj-col-name { font-weight: 500; font-size: var(--pj-section-size); line-height: var(--pj-section-leading); }
.pj-icon-btn[disabled] { opacity: .3; cursor: default; }
.pj-add-stage { width: 100%; padding: 10px; border: 1px dashed #c9cdd3; border-radius: 12px; background: #fff; color: #6b7280; font-size: 13px; font-weight: 600; cursor: pointer; }
.pj-add-stage:hover { border-color: #1e1f21; color: #1e1f21; }
@@ -1122,7 +1207,6 @@ html.pj-ui-scale #pj-timeline { zoom: calc(1 / var(--pj-z)); --tz: var(--pj-z);
.pj-card-sub-check .material-symbols-outlined { font-size: 19px; }
.pj-card-sub-check:hover { color: #58a182; }
.pj-card-sub.is-done .pj-card-sub-check { color: #58a182; }
.pj-card-sub.is-done .pj-card-sub-check .material-symbols-outlined { font-variation-settings: "FILL" 1; }
.pj-card-sub-title { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-card-sub.is-done .pj-card-sub-title { color: #9aa1a9; }
/* 하위 작업에 또 하위 작업이 있으면 제목 옆에 "N ⑂"(아사나) — 보드 카드 펼침·작업 창 하위 작업 줄 공용 */
@@ -1226,13 +1310,13 @@ label.pj-desc-fmtbtn {
}
.pj-desc-fmtsep { width: 1px; height: 16px; background: #e2e4ea; margin: 0 4px; }
/* 설명 — 아사나처럼 테두리·고정 높이 없이 내용만큼 아래로 계속 늘어난다(스크롤은 작업 창 전체가 한다).
글자는 다른 칸과 같은 왼쪽 끝에 맞추고(음수 여백), 마우스를 올리거나 입력 중일 때만 옅은 바탕으로
글자는 다른 칸과 같은 왼쪽 끝에 맞추고, 마우스를 올리거나 입력 중일 때만 옅은 바탕으로
입력 영역임을 알려준다. */
.pj-desc-editor {
min-height: 60px; padding: 6px 8px; margin: 0 -8px 12px;
border: none; border-radius: 8px; font-size: 13.5px; font-family: inherit;
line-height: 1.6; background: transparent; outline: none;
transition: background .12s;
min-height: 60px; padding: 0; margin: 0 0 12px;
border: none; border-radius: 8px; font-size: var(--pj-text-size); font-family: inherit;
line-height: var(--pj-text-leading); background: transparent; outline: none;
transition: background .12s; font-weight: 400; color: var(--pj-ink);
}
.pj-desc-editor:hover { background: #f7f8fa; }
.pj-desc-editor:focus { background: #f5f6f8; }
@@ -1265,8 +1349,8 @@ label.pj-desc-fmtbtn {
.pj-subtask-list { list-style: none; margin: 0 0 8px; padding: 0; }
/* 하위 작업 한 줄(아사나식): ⠿ · ✓ · 제목(글자 폭만큼) · 빈 곳(누르면 열기) · 마감일 · 담당자 · › */
.pj-subtask-row {
display: flex; align-items: center; gap: 4px; padding: 3px 2px; min-height: 36px;
border-bottom: 1px solid #eef0f2; cursor: pointer; border-radius: 4px;
display: flex; align-items: center; gap: 4px; padding: 0 2px; min-height: 34px;
border-bottom: 1px solid #eef0f2; cursor: pointer; border-radius: 4px; box-sizing: border-box;
}
.pj-subtask-row:hover { background: #f6f7f8; }
.pj-subtask-row.is-dragging { opacity: .4; }
@@ -1286,13 +1370,18 @@ label.pj-desc-fmtbtn {
.pj-subtask-check .material-symbols-outlined { font-size: 21px; }
.pj-subtask-check:hover { color: #3f8f6b; }
.pj-subtask-row.is-done .pj-subtask-check { color: #3f8f6b; }
.pj-subtask-row.is-done .pj-subtask-check .material-symbols-outlined { font-variation-settings: "FILL" 1; }
.pj-card.is-done .pj-card-check .material-symbols-outlined,
.pj-card-sub.is-done .pj-card-sub-check .material-symbols-outlined,
.pj-subtask-row.is-done .pj-subtask-check .material-symbols-outlined {
display: inline-block; width: 1em; height: 1em; color: transparent;
background: var(--pj-completed-check-icon) center / contain no-repeat;
}
.pj-subtask-title {
/* 폭은 JS(fitTitle)가 글자 길이만큼 인라인으로 준다. 공용 input[type=text]
규칙의 width:100% 는 인라인 폭이 이긴다. */
flex: 0 1 auto; min-width: 40px; max-width: 100%; cursor: text;
border: 1px solid transparent !important; background: transparent;
padding: 3px 6px !important; font-size: 14px !important; margin: 0 !important;
padding: 0 4px !important; font-size: var(--pj-text-size) !important; margin: 0 !important; line-height: var(--pj-text-leading); font-weight: 400; color: var(--pj-ink);
}
.pj-subtask-title:hover, .pj-subtask-title:focus { border-color: #d8dce2 !important; background: #fff; }
.pj-subtask-fill { flex: 1 1 0; align-self: stretch; min-width: 8px; }
@@ -1327,7 +1416,7 @@ label.pj-desc-fmtbtn {
.pj-subtask-form { display: flex; gap: 6px; flex-wrap: wrap; }
.pj-subtask-form input[type="text"] {
flex: 1 1 120px; width: auto !important; min-width: 90px; margin: 0 !important;
padding: 7px 10px !important; border: 1px solid #d8dce2 !important; border-radius: 8px; font-size: 13px !important; font-family: inherit;
padding: 7px 10px !important; border: 1px solid #d8dce2 !important; border-radius: 8px; font-size: var(--pj-text-size) !important; font-family: inherit; line-height: var(--pj-text-leading);
}
#pj-subtask-add-assignee {
flex: 0 0 auto; width: 96px !important; margin: 0 !important;
@@ -1362,10 +1451,10 @@ label.pj-desc-fmtbtn {
.pj-inbox-item.is-unread { background: #f4f8ff; border-color: #d6e2fb; }
.pj-inbox-icon { color: #4573d2; font-size: 22px; flex: 0 0 auto; }
.pj-inbox-body { flex: 1; }
.pj-inbox-title { font-size: 14px; font-weight: 600; }
.pj-inbox-title { font-size: var(--pj-text-size); font-weight: 400; line-height: var(--pj-text-leading); }
.pj-inbox-item.is-unread .pj-inbox-title::before { content: "●"; color: #4573d2; font-size: 9px; vertical-align: middle; margin-right: 6px; }
.pj-inbox-sub { font-size: 12.5px; color: #525860; margin-top: 2px; }
.pj-inbox-meta { font-size: 11px; color: #9aa1a9; margin-top: 4px; }
.pj-inbox-sub { font-size: var(--pj-text-size); color: #525860; margin-top: 2px; line-height: var(--pj-text-leading); font-weight: 400; }
.pj-inbox-meta { font-size: var(--pj-small-size); color: #9aa1a9; margin-top: 4px; line-height: var(--pj-small-leading); font-weight: 400; }
.pj-inbox-go { align-self: center; padding: 4px 12px; font-size: 12px; }
/* ── 우클릭 컨텍스트 메뉴 — 클릭 좌표 기준 고정 위치(.pj-daypop 은 앵커
@@ -1408,12 +1497,12 @@ img.pj-person-ic { width: 22px; height: 22px; }
.pj-assignee-btn {
display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%;
margin: 0; padding: 4px 8px; border: 1px solid transparent; border-radius: 6px;
background: transparent; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--pj-ink);
cursor: pointer; text-align: left;
background: transparent; font: inherit; font-size: var(--pj-text-size); font-weight: 400; color: var(--pj-ink);
cursor: pointer; text-align: left; line-height: var(--pj-text-leading);
}
.pj-assignee-btn:hover, .pj-assignee-btn:focus-visible { border-color: var(--pj-border); background: #f6f7f8; outline: none; }
.pj-assignee-btn:disabled { cursor: default; opacity: .6; }
.pj-assignee-btn.is-empty { color: var(--pj-ink-soft); font-weight: 500; }
.pj-assignee-btn.is-empty { color: var(--pj-ink-soft); font-weight: 400; }
.pj-assignee-btn-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-meta-cell-assignee .pj-assignee-btn { max-width: 150px; }
/* 하위 업무 줄/추가 폼 — 폭 고정, 글자 작게 */
@@ -1511,12 +1600,13 @@ img.pj-person-ic { width: 22px; height: 22px; }
.pj-side-navlink {
display: flex; align-items: center; gap: 9px; width: 100%;
padding: 7px 8px; border: none; background: transparent; border-radius: 8px;
color: var(--pj-ink); font-size: 13.5px; font-weight: 700; text-decoration: none;
cursor: pointer; text-align: left;
color: var(--pj-ink); font-size: var(--pj-text-size); font-weight: 400; text-decoration: none;
cursor: pointer; text-align: left; line-height: var(--pj-text-leading);
}
.pj-side-navlink:hover { background: #f1f2f4; }
.pj-side-navic { font-size: 20px; color: #5f6368; flex: 0 0 auto; }
.pj-side-navtext { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-side-navtext { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-side-navlink { box-sizing: border-box; }
.pj-side-navbadge {
flex: 0 0 auto; min-width: 18px; padding: 1px 6px; border-radius: 999px;
background: #fbe3df; color: #c22b10; font-size: 11px; font-weight: 700; text-align: center;
@@ -1828,7 +1918,8 @@ html.pj-embed .pj-btn-goto-project { display: inline-flex; align-items: center;
/* ── 수신함 섹션 (알림 / 나를 태그한 업무) ── */
.pj-inbox-section { margin-bottom: 26px; }
.pj-inbox-h3 { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; color: #6b7280; margin: 0 0 10px; }
.pj-inbox-view .pj-main > .pj-section-head h2 { font-size: var(--pj-heading-size); line-height: var(--pj-heading-leading); font-weight: 500; }
.pj-inbox-h3 { display: flex; align-items: center; gap: 8px; font-size: var(--pj-section-size); font-weight: 500; color: #6b7280; margin: 0 0 10px; line-height: var(--pj-section-leading); }
.pj-inbox-count { padding: 1px 7px; border-radius: 999px; background: #fbe3df; color: #c22b10; font-size: 11px; font-weight: 700; }
.pj-inbox-count[hidden] { display: none; }
.pj-inbox-title.is-done { text-decoration: line-through; color: #9aa1a9; }
@@ -1855,7 +1946,7 @@ html.pj-embed .pj-btn-goto-project { display: inline-flex; align-items: center;
.pj-mytasks-table td { vertical-align: middle; }
.pj-mtk-check { width: 34px; text-align: center; }
.pj-mtk-check input[type="checkbox"] { width: auto; margin: 0; cursor: pointer; }
.pj-mtk-name { font-weight: 600; }
.pj-mtk-name { font-weight: 400; }
.pj-mtk-proj, .pj-mtk-stage { width: 160px; color: var(--pj-ink-soft); font-size: 12.5px; }
.pj-mtk-pri { width: 88px; }
.pj-mtk-date { width: 108px; font-size: 12.5px; color: var(--pj-ink-soft); }
@@ -1870,7 +1961,7 @@ html.pj-embed .pj-btn-goto-project { display: inline-flex; align-items: center;
.pj-mtk-row.pj-mtk-subrow td { background: #fafbfc; }
.pj-mtk-row.pj-mtk-subrow:hover td { background: #f1f2f4; }
.pj-mtk-row.pj-mtk-subrow .pj-mtk-title { display: flex; align-items: center; }
.pj-mtk-row.pj-mtk-subrow .pj-mtk-name { font-weight: 500; }
.pj-mtk-row.pj-mtk-subrow .pj-mtk-name { font-weight: 400; }
.pj-mtk-tree-branch {
position: relative; display: inline-block; flex: 0 0 20px; width: 20px;
align-self: stretch; margin-right: 2px;
@@ -1914,7 +2005,7 @@ html.pj-embed .pj-btn-goto-project { display: inline-flex; align-items: center;
.pj-side-search input {
width: 100%; box-sizing: border-box; height: 34px; padding: 0 10px 0 32px;
border: 1px solid var(--pj-border); border-radius: 8px; background: #f7f8f9;
font-size: 13px; font-family: inherit; color: var(--pj-ink);
font-size: var(--pj-text-size); font-family: inherit; color: var(--pj-ink); line-height: var(--pj-text-leading); font-weight: 400;
}
.pj-side-search input:focus { outline: none; background: #fff; border-color: var(--pj-accent); box-shadow: 0 0 0 3px var(--pj-accent-tint); }
.pj-search-results {
@@ -1942,7 +2033,7 @@ html.pj-embed .pj-btn-goto-project { display: inline-flex; align-items: center;
border: 1px solid var(--pj-border); border-radius: 8px; background: #fff; flex: 0 1 280px; min-width: 180px;
}
.pj-fb-search .material-symbols-outlined { font-size: 18px; color: #8a9099; }
.pj-fb-search input { border: none; outline: none; background: transparent; font-size: 13px; font-family: inherit; width: 100%; color: var(--pj-ink); }
.pj-fb-search input { border: none; outline: none; background: transparent; font-size: var(--pj-text-size); font-family: inherit; width: 100%; color: var(--pj-ink); line-height: var(--pj-text-leading); font-weight: 400; }
.pj-fb-search.is-set { border-color: var(--pj-accent); background: var(--pj-accent-tint); }
.pj-fb-search:focus-within { border-color: var(--pj-accent); }
.pj-fb-select {
@@ -1988,7 +2079,7 @@ html.pj-embed .pj-btn-goto-project { display: inline-flex; align-items: center;
.pj-trash-note { font-size: 12.5px; color: var(--pj-ink-soft); }
.pj-trash-table { width: 100%; }
.pj-trash-table th, .pj-trash-table td { white-space: nowrap; }
.pj-trash-table td.pj-trash-title { white-space: normal; font-weight: 600; color: var(--pj-ink); min-width: 220px; }
.pj-trash-table td.pj-trash-title { white-space: normal; font-weight: 400; color: var(--pj-ink); min-width: 220px; }
.pj-trash-meta { color: var(--pj-ink-soft); font-size: 12.5px; }
.pj-trash-act { text-align: right; }
.pj-trash-table tr.is-restored td { opacity: .55; }
@@ -2026,8 +2117,8 @@ html.pj-ui-scale .pj-modal-chat { max-height: calc(92vh / var(--pj-z)); }
.pj-side-goal-years { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 4px 37px; }
.pj-side-goal-years[hidden] { display: none; }
.pj-side-goal-year {
display: block; padding: 5px 8px; border-radius: 6px; font-size: 13px; font-weight: 600;
color: var(--pj-ink); text-decoration: none;
display: block; padding: 5px 8px; border-radius: 6px; font-size: var(--pj-text-size); font-weight: 400;
color: var(--pj-ink); text-decoration: none; line-height: var(--pj-text-leading);
}
.pj-side-goal-year:hover { background: #f1f2f4; }
.pj-side-goal-year.is-active { background: var(--pj-accent-tint); color: var(--pj-accent-dark); }
@@ -2037,8 +2128,8 @@ html.pj-ui-scale .pj-modal-chat { max-height: calc(92vh / var(--pj-z)); }
}
.pj-side-goal-add:hover { background: #f1f2f4; color: var(--pj-ink); }
/* 목표·회의록 제목 — 크게(32px)·굵게 */
.pj-goal-view h2.pj-goal-title { font-size: 32px; font-weight: 800; letter-spacing: -.6px; line-height: 1.2; }
/* 목표·회의록 제목 — 아사나 프로젝트 제목과 같은 20px/28px, 굵기 500 */
.pj-goal-view h2.pj-goal-title { font-size: var(--pj-heading-size); font-weight: 500; letter-spacing: normal; line-height: var(--pj-heading-leading); }
/* 표는 화면 폭 전체 — 내 작업·수신함의 읽기 폭 제한(1180px)을 푼다 */
.pj-goal-view .pj-main { max-width: none; }
.pj-goal-head-acts { display: flex; align-items: center; gap: 10px; }
@@ -2057,8 +2148,8 @@ html.pj-ui-scale .pj-modal-chat { max-height: calc(92vh / var(--pj-z)); }
/* width: 1px — table-layout: fixed 는 표 너비가 auto 가 아닐 때만 먹는다. 표는 칸 너비 합만큼 늘어나고,
칸 너비가 머리 칸 width 로만 정해져야 분기 접기 애니메이션이 양방향으로 부드럽다(auto 면 펼 때 한 번에 튄다). */
.pj-goal-table {
width: 1px; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 12.5px;
color: var(--pj-ink); background: #fff; border: 1px solid #dfe2e6; border-radius: 10px;
width: 1px; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: var(--pj-text-size);
color: var(--pj-ink); background: #fff; border: 1px solid #dfe2e6; border-radius: 10px; line-height: var(--pj-text-leading);
}
/* 칸 너비는 여백·테두리 포함(border-box) — 안 그러면 padding 만큼 넓어진다 */
.pj-goal-table th, .pj-goal-table td {
@@ -2076,7 +2167,7 @@ html.pj-ui-scale .pj-modal-chat { max-height: calc(92vh / var(--pj-z)); }
.pj-goal-table thead th.is-now { color: var(--pj-accent-dark); box-shadow: inset 0 -2px 0 var(--pj-accent); }
/* 왼쪽 고정 두 칸(구분·항목) — 너비는 머리 칸 오른쪽 끝을 끌어 조절(initGoals, localStorage
pj_goal_col_w). --goal-c1-w 가 c2 의 left 도 같이 정한다. */
.pj-goal-table { --goal-c1-w: 72px; --goal-c2-w: 72px; }
.pj-goal-table { --goal-c1-w: 72px; --goal-c2-w: 72px; font-size: var(--pj-text-size); line-height: var(--pj-text-leading); }
.pj-goal-c1, .pj-goal-c2 {
position: sticky; z-index: 2; background: #fff; text-align: center; font-weight: 700;
}
@@ -2095,8 +2186,9 @@ html.pj-ui-scale .pj-modal-chat { max-height: calc(92vh / var(--pj-z)); }
}
.pj-goal-colresize:hover::after, .pj-goal-colresize.is-dragging::after { background: var(--pj-accent); }
/* 월 칸은 overflow: hidden(접기 애니메이션)이라 칸 밖으로 나간 손잡이가 잘린다 — 칸 안쪽 오른쪽 끝에 둔다 */
.pj-goal-table thead th.pj-goal-m .pj-goal-colresize { right: 0; width: 7px; }
.pj-goal-table thead th.pj-goal-m .pj-goal-colresize::after { left: auto; right: 1px; }
:where(.pj-goal-table th, .pj-goal-table td) { position: relative; }
.pj-goal-table :is(th, td).pj-goal-m .pj-goal-colresize { right: 0; width: 7px; }
.pj-goal-table :is(th, td).pj-goal-m .pj-goal-colresize::after { left: auto; right: 1px; }
html.pj-goal-resizing, html.pj-goal-resizing * { cursor: col-resize !important; user-select: none !important; }
.pj-goal-table tbody th { padding: 7px 8px; vertical-align: middle; } /* 왼쪽 이름은 세로 가운데 */
@@ -2122,8 +2214,9 @@ input.pj-goal-num:focus { outline: 2px solid var(--pj-accent); outline-offset: -
/* 업무 영역 — 영역 색(--goal-bg)이 줄 전체 배경(스프레드시트처럼) */
.pj-goal-area > tr > th, .pj-goal-area > tr > td { background: var(--goal-bg, #fff); border-color: rgba(0, 0, 0, .07); }
.pj-goal-area > tr > th { padding: 6px 8px; vertical-align: top; }
.pj-goal-area > tr:first-child > * { border-top: 1px solid rgba(0, 0, 0, .12); }
.pj-goal-area-name { font-size: 13px; font-weight: 800 !important; }
.pj-goal-area-name { font-size: var(--pj-text-size); font-weight: 500 !important; }
.pj-goal-area-text, .pj-goal-row-text { display: block; word-break: keep-all; overflow-wrap: anywhere; }
/* 구역·항목 칸 메뉴(색·순서·줄 추가·삭제)는 우클릭(project.js areaMenuItems·rowMenuItems) — 마우스 오버 도구 막대는 2026-10-01 요청으로 뺐다.
대신 칸 오른쪽 위 작은 ⋮ 버튼(.pj-goal-menu-btn, 관리자만) — 자리를 차지하지 않게 absolute, 평소 투명·칸에 마우스/포커스가 오면 보임.
@@ -2143,18 +2236,23 @@ th.pj-goal-area-name:focus-within .pj-goal-menu-btn, th.pj-goal-row-label:focus-
.pj-goal-area-text[tabindex]:focus-visible, .pj-goal-row-text[tabindex]:focus-visible { outline: 2px solid var(--pj-accent); outline-offset: 1px; border-radius: 4px; }
html.pj-goal-selecting .pj-goal-menu-btn { pointer-events: none; }
@media print { .pj-goal-menu-btn { display: none !important; } }
textarea.pj-goal-text {
display: block; width: 100%; box-sizing: border-box; min-height: 46px; padding: 6px; border: none;
background: transparent; font: inherit; line-height: 1.5; color: inherit; resize: none; overflow: hidden;
.pj-goal-text {
display: block; width: 100%; box-sizing: border-box; min-height: calc(var(--pj-text-leading) + 12px); padding: 6px; border: none;
white-space: pre-wrap; overflow-wrap: anywhere;
background: transparent; font: inherit; line-height: var(--pj-text-leading); color: inherit; resize: none; overflow: hidden;
}
/* 입력 중인 칸 — 테두리·밝은 배경은 입력칸(글 높이만큼)이 아니라 칸 전체(td)에 */
textarea.pj-goal-text:focus { outline: none; }
.pj-goal-text:focus { outline: none; }
.pj-goal-table td.pj-goal-texttd:focus-within {
box-shadow: inset 0 0 0 2px var(--pj-accent);
background-image: linear-gradient(rgba(255, 255, 255, .75), rgba(255, 255, 255, .75));
}
textarea.pj-goal-text::placeholder { color: rgba(0, 0, 0, .3); }
.pj-goal-text-ro { min-height: 46px; padding: 6px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.pj-goal-text:empty::before {
content: attr(data-placeholder); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
pointer-events: none; color: rgba(0, 0, 0, .3);
}
.pj-goal-text-ro { box-sizing: border-box; min-height: calc(var(--pj-text-leading) + 12px); padding: 6px; line-height: var(--pj-text-leading); white-space: pre-wrap; overflow-wrap: anywhere; }
.pj-goal-text span, .pj-goal-text-ro span { line-height: normal; }
.pj-goal-area td.is-now { box-shadow: inset 2px 0 0 rgba(123, 104, 238, .35), inset -2px 0 0 rgba(123, 104, 238, .35); }
.pj-goal-texttd.pj-goal-year-col { font-weight: 600; }
/* 가로 스크롤 때 3열(구분·항목·연간)까지 고정 — 연간 열 left = 1열 + 2열 너비, 오른쪽에 경계 그림자.
@@ -2251,6 +2349,17 @@ textarea.pj-goal-text::placeholder { color: rgba(0, 0, 0, .3); }
box-shadow: inset 0 0 0 2px var(--pj-accent);
background-image: linear-gradient(rgba(123, 104, 238, .12), rgba(123, 104, 238, .12));
}
.pj-goal-table td.pj-goal-texttd.is-goal-active { box-shadow: inset 0 0 0 2px var(--pj-accent); }
.pj-goal-move-edge { display: none; position: absolute; z-index: 4; cursor: grab; }
.is-goal-active > .pj-goal-move-edge { display: block; }
.pj-goal-move-edge[data-edge="top"] { top: 0; left: 0; right: 0; height: 4px; }
.pj-goal-move-edge[data-edge="bottom"] { bottom: 0; left: 0; right: 0; height: 4px; }
.pj-goal-move-edge[data-edge="left"] { top: 4px; bottom: 4px; left: 0; width: 4px; }
.pj-goal-move-edge[data-edge="right"] { top: 4px; bottom: 4px; right: 0; width: 4px; }
.pj-goal-table td.is-goal-moving { opacity: .55; }
.pj-goal-table td.is-goal-move-target { box-shadow: inset 0 0 0 3px var(--pj-accent); background-image: linear-gradient(var(--pj-accent-tint), var(--pj-accent-tint)); }
.pj-goal-table td.is-goal-move-saving { pointer-events: none; opacity: .65; }
html.pj-goal-moving, html.pj-goal-moving * { cursor: grabbing !important; user-select: none !important; }
.pj-goal-foot { display: flex; align-items: center; gap: 12px; margin: 12px 0 4px; }
@@ -2281,7 +2390,7 @@ html.pj-goal-selecting, html.pj-goal-selecting * { user-select: none !important;
════════════════════════════════════════════════════════════ */
.pj-meet-pane { flex: 1 1 auto; min-height: 0; overflow: auto; }
.pj-meet-title { display: flex; align-items: center; gap: 8px; }
.pj-meet-title h2 { margin: 0 6px 0 0; }
.pj-meet-title h2 { margin: 0 6px 0 0; font-size: var(--pj-heading-size); line-height: var(--pj-heading-leading); font-weight: 500; letter-spacing: normal; }
/* 연간 목표로 가는 큰 버튼(회의록 제목 왼쪽) */
.pj-meet-goalbtn {
display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px 7px 10px; margin-right: 6px; border-radius: 12px;
@@ -2398,7 +2507,7 @@ html.pj-goal-selecting, html.pj-goal-selecting * { user-select: none !important;
/* 이 달 계획 — 연간 목표 표의 그 달 열(업무 영역별 작은 카드) */
.pj-meet-plan { margin: 0 0 10px; padding: 8px 10px; border: 1px solid var(--pj-border); border-radius: 10px; background: #fff; }
.pj-meet-plan-head { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; margin-bottom: 6px; }
.pj-meet-plan-head { display: flex; align-items: center; gap: 6px; font-size: var(--pj-text-size); font-weight: 500; margin-bottom: 6px; line-height: 20px; color: var(--pj-ink); }
.pj-meet-plan-head .material-symbols-outlined { font-size: 18px; color: var(--pj-accent); }
.pj-meet-plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.pj-meet-plan-area { padding: 6px 8px; border-radius: 8px; background: var(--goal-bg, #f4f5f7); font-size: 12px; line-height: 1.45; min-width: 0; }
@@ -2450,8 +2559,8 @@ html.pj-goal-selecting, html.pj-goal-selecting * { user-select: none !important;
.pj-meet-pick-empty { margin: 10px 4px; color: var(--pj-ink-soft); font-size: 12.5px; }
.pj-meet-table {
width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 12.5px;
background: #fff; border: 1px solid #dfe2e6; border-radius: 10px; color: var(--pj-ink);
width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: var(--pj-text-size);
background: #fff; border: 1px solid #dfe2e6; border-radius: 10px; color: var(--pj-ink); line-height: var(--pj-text-leading);
}
.pj-meet-table th, .pj-meet-table td {
box-sizing: border-box; border-right: 1px solid #e6e8eb; border-bottom: 1px solid #e6e8eb; padding: 0; vertical-align: top;
@@ -2505,7 +2614,7 @@ th.pj-meet-c-label { position: relative; font-weight: 600; color: #3b4048; text-
th.pj-meet-c-label:hover .pj-meet-more, .pj-meet-more:focus { opacity: 1; }
textarea.pj-meet-text, .pj-meet-notes textarea {
display: block; width: 100%; box-sizing: border-box; min-height: 38px; padding: 6px; border: none; background: transparent;
font: inherit; line-height: 1.5; color: inherit; resize: none; overflow: hidden;
font: inherit; line-height: var(--pj-text-leading); color: inherit; resize: none; overflow: hidden;
}
textarea.pj-meet-text:focus { outline: none; }
.pj-meet-notes textarea:focus { outline: 2px solid var(--pj-accent); outline-offset: -2px; background: rgba(255, 255, 255, .8); }
@@ -2514,7 +2623,7 @@ textarea.pj-meet-text:focus { outline: none; }
box-shadow: inset 0 0 0 2px var(--pj-accent);
background-image: linear-gradient(rgba(255, 255, 255, .8), rgba(255, 255, 255, .8));
}
.pj-meet-ro { min-height: 38px; padding: 6px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.pj-meet-ro { min-height: 38px; padding: 6px; line-height: var(--pj-text-leading); white-space: pre-wrap; overflow-wrap: anywhere; }
.pj-meet-table td.pj-meet-c-amt { text-align: right; vertical-align: middle; padding: 0 6px; font-variant-numeric: tabular-nums; }
input.pj-meet-amount {
display: block; width: 100%; box-sizing: border-box; height: 34px; padding: 0 4px; border: none; background: transparent;
@@ -2614,3 +2723,45 @@ select.pj-meet-eval[data-v="miss"], .pj-meet-eval-ro[data-v="miss"] { color: #c2
}
/* 댓글 대화창 — 보낼 수 없었던 파일(빈 파일·20MB 초과) */
.pj-chat-pending-chip.is-failed { border-color: #e5484d; background: #fdecea; color: #a1261b; }
html[data-pj-font="pretendard"] { --pj-font: "Pretendard Variable", var(--pj-system-font); }
html[data-pj-font="nanum-square"] { --pj-font: "NanumSquare", var(--pj-system-font); }
html[data-pj-font="nanum-square-neo"] { --pj-font: "NanumSquareNeo", var(--pj-system-font); }
html[data-pj-font="nanum-square-round"] { --pj-font: "NanumSquareRound", var(--pj-system-font); }
.pj-options-dialog { width: min(440px, calc(100vw - 40px)); box-sizing: border-box; padding: 24px; border: 1px solid #d8dce2; border-radius: 12px; color: var(--pj-ink); font-family: var(--pj-font); box-shadow: 0 12px 40px #0003; }
.pj-options-dialog::backdrop { background: #0005; }
.pj-options-dialog h2 { margin: 0 0 22px; font-size: 20px; font-weight: 500; }
.pj-options-dialog label { display: block; margin-bottom: 8px; }
.pj-options-dialog select { width: 100%; padding: 9px; border: 1px solid #d8dce2; border-radius: 6px; font: inherit; }
.pj-options-preview { padding: 18px 12px; margin-top: 16px; border: 1px solid #e5e6e8; border-radius: 6px; font-size: 16px; line-height: 1.7; }
.pj-options-dialog p { font-size: 12px; color: var(--pj-ink-soft); }
.pj-options-dialog .pj-options-error { color: #c22b10; }
.pj-options-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.pj-goal-format { position: fixed; z-index: 1200; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 4px 6px; max-width: calc(100vw - 16px); box-sizing: border-box; border: 1px solid var(--pj-border); border-radius: 8px; box-shadow: 0 4px 16px #0002; background: #fff; color: var(--pj-ink); font-family: var(--pj-font); font-size: 12px; }
.pj-goal-format[hidden], .pj-goal-color-grid[hidden] { display: none; }
.pj-goal-format-group { display: inline-flex; align-items: center; gap: 2px; }
.pj-goal-format-group + .pj-goal-format-group { border-left: 1px solid var(--pj-border); padding-left: 6px; }
.pj-goal-format .pj-goal-format-btn { display: inline-flex; align-items: center; justify-content: center; height: 24px; min-width: 24px; box-sizing: border-box; border: 1px solid transparent; border-radius: 4px; padding: 0 5px; background: #fff; color: inherit; font: inherit; line-height: 1; cursor: pointer; }
.pj-goal-format .pj-goal-format-btn:hover, .pj-goal-format [data-goal-format="reset"]:hover { background: #f3f4f6; }
.pj-goal-format .pj-goal-format-btn[aria-pressed="true"] { border-color: #b5b9c0; background: #e8eaed; }
.pj-goal-format .pj-goal-format-btn[aria-pressed="mixed"] { background: #f3f4f6; box-shadow: inset 0 -2px #9ca3af; }
.pj-goal-format .pj-goal-format-btn:focus-visible { outline: 2px solid var(--pj-accent); outline-offset: 1px; }
.pj-goal-reset-icon { width: 14.4px; height: 14.4px; }
.pj-goal-color-picker { position: relative; display: flex; align-items: center; }
.pj-goal-color-toggle { gap: 5px; }
/* 아이콘은 처음 크기의 80%, 버튼은 24px 높이로 맞춘다. */
.pj-goal-color-letter { display: flex; flex-direction: column; align-items: stretch; font-size: 13.6px; line-height: 14.4px; }
.pj-goal-color-preview { display: block; width: 14.4px; height: 2.4px; background: #000; box-shadow: inset 0 0 0 1px #0002; }
.pj-goal-format-chevron { width: 6.4px; height: 6.4px; }
.pj-goal-font-letter { font-size: 12.8px; }
.pj-goal-font-arrow { width: 8px; height: 11.2px; align-self: flex-start; margin-top: 3.2px; color: #2563eb; }
.pj-goal-size-value { min-width: 36px; text-align: center; color: var(--pj-ink-soft); font-variant-numeric: tabular-nums; }
.pj-goal-format [data-goal-format="bold"] .pj-goal-font-letter { font-weight: 700; }
.pj-goal-format [data-goal-format="italic"] .pj-goal-font-letter { font-style: italic; }
.pj-goal-format [data-goal-format="underline"] .pj-goal-font-letter { text-decoration: underline; text-underline-offset: 2.4px; }
.pj-goal-color-grid { position: absolute; bottom: calc(100% + 8px); left: 0; display: grid; grid-template-columns: repeat(6, 26px); gap: 6px; padding: 8px; background: #fff; border: 1px solid var(--pj-border); border-radius: 6px; box-shadow: 0 4px 12px #0002; }
.pj-goal-color-grid.is-below { bottom: auto; top: calc(100% + 8px); }
.pj-goal-text-swatch { width: 26px; height: 26px; border: 1px solid #0003; border-radius: 3px; background: var(--swatch); cursor: pointer; padding: 0; }
.pj-goal-text-swatch[aria-pressed="true"] { outline: 2px solid var(--pj-accent); outline-offset: 2px; }
.pj-goal-text-swatch:focus-visible { outline: 2px solid var(--pj-accent); outline-offset: 2px; }
.pj-goal-format :disabled { opacity: .45; cursor: default; }
+607 -40
View File
@@ -352,6 +352,13 @@
prune: prune, onBeforeUnload: onBeforeUnload,
savedOf: function (f) { const s = states.get(f); return s ? s.saved : undefined; },
failedOf: function (f) { const s = states.get(f); return !!(s && s.failed); },
acceptSaved: function (f, value) {
const s = states.get(f);
if (!s) return;
clearTimeout(s.timer); s.timer = null; s.saved = value; s.failed = false;
writeDraft(f, s);
if (cfg.onClear) cfg.onClear(f);
},
};
}
// 저장 실패 표시 — 칸 빨간 테두리 + 안내(입력한 내용은 지우지 않는다)
@@ -2109,7 +2116,7 @@
};
const html = '<!doctype html><html lang="ko"><head><meta charset="utf-8"><title>이미지</title>' +
'<meta name="viewport" content="width=device-width, initial-scale=1"><style>' +
'html,body{margin:0;height:100%;overflow:hidden;background:#202226;color:#fff;font-family:"Malgun Gothic","Apple SD Gothic Neo",system-ui,sans-serif}' +
'html,body{margin:0;height:100%;overflow:hidden;background:#202226;color:#fff;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Helvetica,Arial,"Apple SD Gothic Neo","Malgun Gothic",sans-serif}' +
'#stage{position:fixed;inset:0;cursor:grab;touch-action:none}#stage.drag{cursor:grabbing}' +
'#img{position:absolute;left:0;top:0;transform-origin:0 0;user-select:none;-webkit-user-drag:none;box-shadow:0 6px 28px rgba(0,0,0,.45);background:#fff;max-width:none}' +
'#bar{position:fixed;left:50%;bottom:14px;transform:translateX(-50%);display:flex;align-items:center;gap:2px;padding:4px;' +
@@ -2152,16 +2159,17 @@
win.document.open();
win.document.write(html);
win.document.close();
const fontCSS = win.document.createElement("link"); fontCSS.rel = "stylesheet";
fontCSS.href = new URL("/static/project-fonts.css?v=20261002g", location.href).href; win.document.head.appendChild(fontCSS);
win.document.body.style.fontFamily = getComputedStyle(document.body).fontFamily;
try { win.focus(); } catch (_) {}
}
// ── 댓글·답글 입력칸(textarea.pj-composer-ta) — 글 줄 수만큼 높이를 늘린다(최대 160px, 넘으면 칸 안 스크롤).
// Enter = 등록, Shift+Enter = 줄바꿈(각 입력칸 keydown). 코드로 비운 뒤엔 fitComposer 를 불러 한 줄로 되돌린다.
// ── 댓글·답글 입력칸 — 전송·붙여넣기 뒤에도 70px 고정, 긴 글은 내부 스크롤.
function fitComposer(ta) {
if (!ta || ta.tagName !== "TEXTAREA") return;
ta.style.height = "auto";
ta.style.height = Math.min(ta.scrollHeight, 160) + "px";
ta.style.overflowY = ta.scrollHeight > 160 ? "auto" : "hidden";
ta.style.height = "70px";
ta.style.overflowY = "auto";
}
document.addEventListener("input", function (e) {
if (e.target && e.target.classList && e.target.classList.contains("pj-composer-ta")) fitComposer(e.target);
@@ -4159,6 +4167,43 @@
boardAddStageBtn.addEventListener("click", function () { openStageModal(null); });
}
// 섹션별 빠른 작업 입력 초안 — 보드를 다시 그려도 입력값/저장 중 상태를 유지한다.
const boardTaskDrafts = {};
const boardTaskOutsideDown = {};
const BOARD_FOLD_KEY = "pj_board_fold:" + projectId;
let boardFold = {};
try { boardFold = JSON.parse(localStorage.getItem(BOARD_FOLD_KEY) || "{}") || {}; } catch (_) {}
function wireBoardCollapse(col) {
const head = col.querySelector(".pj-col-head");
let actions = head.querySelector(".pj-col-actions");
if (!actions) {
actions = document.createElement("span"); actions.className = "pj-col-actions"; head.appendChild(actions);
}
const btn = document.createElement("button");
btn.type = "button"; btn.className = "pj-icon-btn pj-col-collapse";
// 아사나의 왼쪽 화살표 + 세로 경계선 모양.
btn.innerHTML = '<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 3v14M8 6l-4 4 4 4M4 10h12"/></svg>';
actions.prepend(btn);
const key = colKey(col);
function update() {
const folded = boardFold[key] === true;
col.classList.toggle("is-collapsed", folded);
btn.setAttribute("aria-expanded", String(!folded));
btn.setAttribute("aria-label", (folded ? "그룹 펼치기: " : "그룹 축소: ") + head.querySelector(".pj-col-name").textContent);
btn.title = folded ? "그룹 펼치기" : "그룹 축소";
btn.dataset.tip = btn.title;
col.querySelector(".pj-col-body").inert = folded;
}
btn.addEventListener("mousedown", function (e) { e.stopPropagation(); });
btn.addEventListener("dragstart", function (e) { e.preventDefault(); e.stopPropagation(); });
btn.addEventListener("click", function (e) {
e.stopPropagation();
boardFold[key] = !boardFold[key];
try { localStorage.setItem(BOARD_FOLD_KEY, JSON.stringify(boardFold)); } catch (_) {}
update(); syncBoardHBar();
});
update();
}
function renderBoard() {
// pj-board(바깥)는 가로 스크롤 뷰포트, pj-board-canvas(안쪽)는 세션을
// 가로로 늘어놓는 flex 컨테이너(width:max-content) — 세션이 아무리
@@ -4173,6 +4218,10 @@
const b = col.querySelector(".pj-col-body");
if (b && b.scrollTop) colScroll[colKey(col)] = b.scrollTop;
});
Object.keys(boardTaskOutsideDown).forEach(function (id) {
document.removeEventListener("pointerdown", boardTaskOutsideDown[id], true);
delete boardTaskOutsideDown[id];
});
canvas.innerHTML = "";
const vis = visibleTasks();
if (viewScope === "project") renderBoardByStage(canvas, vis);
@@ -4183,6 +4232,7 @@
canvas.appendChild(boardAddStageBtn);
}
canvas.querySelectorAll(".pj-col").forEach(function (col) {
wireBoardCollapse(col);
const top = colScroll[colKey(col)];
const b = col.querySelector(".pj-col-body");
if (top && b) b.scrollTop = top;
@@ -4318,12 +4368,13 @@
col.querySelector(".pj-col-count").textContent = colTasks.length;
colTasks.forEach(function (t) { body.appendChild(taskCard(t)); });
if (canManage) {
renderBoardTaskDraft(body, s);
enableDropByStageId(body, s.id);
wireColumnControls(col, s);
wireColumnDrag(col, s);
wireStageAddTask(body, s);
col.querySelector(".pj-col-addtask").addEventListener("click", function () {
openTaskModal(null, s.id);
openBoardTaskDraft(s);
});
}
board.appendChild(col);
@@ -4399,7 +4450,7 @@
// 세션 … 메뉴(버튼 클릭)와 머리 우클릭이 같은 항목을 쓴다.
function stageMenuItems() {
return [
{ label: "작업 추가", onClick: function () { openTaskModal(null, s.id); } },
{ label: "작업 추가", onClick: function () { openBoardTaskDraft(s); } },
{ label: "이름 변경", onClick: startRename },
{ label: "섹션 편집 (색상·기본 담당자)", onClick: editStage },
null,
@@ -4482,11 +4533,141 @@
if (e.target.closest(".pj-card")) return;
e.preventDefault();
showContextMenu(e.clientX, e.clientY, [
{ label: "작업 추가", onClick: function () { openTaskModal(null, s.id); } },
{ label: "작업 추가", onClick: function () { openBoardTaskDraft(s); } },
]);
});
}
// 아사나식 빠른 추가 카드: 이름 + 담당자 + 마감일만. Enter는 계속 입력,
// 바깥 클릭은 저장 후 닫기, Esc/이름 없이 바깥 클릭은 취소.
function openBoardTaskDraft(stage) {
if (!canManage || accessLost) return;
if (!boardTaskDrafts[stage.id]) {
boardTaskDrafts[stage.id] = {
title: "", assignee: stage.default_assignee_email || "", due: null, focused: true, saving: false,
};
} else boardTaskDrafts[stage.id].focused = true;
renderBoard();
}
function renderBoardTaskDraft(body, stage) {
const draft = boardTaskDrafts[stage.id];
if (!draft) return;
const card = document.createElement("div");
card.className = "pj-card pj-tasknew";
card.setAttribute("aria-label", "새 작업");
card.setAttribute("aria-busy", String(draft.saving));
card.innerHTML =
'<div class="pj-tasknew-name"><span class="material-symbols-outlined pj-tasknew-check">check_circle</span>' +
'<input type="text" class="pj-tasknew-title" placeholder="작업 이름 입력" aria-label="작업 이름" autocomplete="off"></div>' +
'<div class="pj-tasknew-meta"><button type="button" class="pj-tasknew-assignee" aria-label="담당자 지정"></button>' +
'<button type="button" class="pj-tasknew-due" aria-label="마감일 지정"></button></div>';
body.appendChild(card);
const inp = card.querySelector(".pj-tasknew-title");
const av = card.querySelector(".pj-tasknew-assignee");
const due = card.querySelector(".pj-tasknew-due");
inp.value = draft.title;
inp.disabled = av.disabled = due.disabled = draft.saving;
function current() { return boardTaskDrafts[stage.id] === draft && !accessLost; }
function refocus() { if (current() && inp.isConnected && !draft.saving) inp.focus(); }
function paintAv() {
av.innerHTML = draft.assignee ? avatarHtml(draft.assignee, "pj-gicon-sm") : ASSIGN_EMPTY_ICON_SVG;
av.title = draft.assignee ? idOf(draft.assignee) : "담당자 지정";
}
function paintDue() {
const di = dueInfo(draft.due, false);
due.innerHTML = di ? escapeHtml(di.text) : DUE_EMPTY_ICON_SVG;
due.title = draft.due || "마감일 지정";
}
paintAv(); paintDue();
inp.addEventListener("input", function () { draft.title = inp.value; });
inp.addEventListener("focus", function () { draft.focused = true; });
inp.addEventListener("blur", function () { draft.focused = false; });
inp.addEventListener("keydown", function (e) {
if (isImeEnter(e)) return;
if (e.key === "Enter") { e.preventDefault(); save(true); }
if (e.key === "Escape") { e.preventDefault(); e.stopPropagation(); close(); }
});
av.addEventListener("click", async function () {
draft.picking = true; // 멤버 조회 중에는 바깥 클릭으로 저장하지 않는다.
try {
const list = await membersOfProject(projectId);
if (!current() || !av.isConnected) return;
const r = av.getBoundingClientRect();
showContextMenu(r.left, r.bottom + 4, assigneeMenuItems(
list.map(function (m) { return m.user_email; }), draft.assignee,
function (email) { if (!current()) return; draft.assignee = email || ""; paintAv(); refocus(); }
));
} catch (err) { showToast("멤버 조회 실패: " + err.message, "error"); }
finally { draft.picking = false; }
});
due.addEventListener("click", function () {
openDatePopover(due, {
due: draft.due, allowStart: false,
onChange: function (patch) { if (!current()) return; draft.due = patch.due_date || null; paintDue(); refocus(); },
});
});
function close() {
if (!current() || draft.saving) return;
delete boardTaskDrafts[stage.id];
renderBoard();
}
async function save(keepOpen) {
if (!current() || draft.saving) return;
if (inp.isConnected) draft.title = inp.value;
const title = draft.title.trim();
if (!title) return;
draft.saving = true;
inp.disabled = av.disabled = due.disabled = true;
card.setAttribute("aria-busy", "true");
try {
const res = await api("POST", "/project/api/projects/" + projectId + "/tasks", {
title: title, stage_id: stage.id,
assignee_email: draft.assignee, assignee_name: draft.assignee ? idOf(draft.assignee) : "",
due_date: draft.due || null,
});
if (!current()) return;
mergeTask(res.task);
if (keepOpen) {
boardTaskDrafts[stage.id] = {
title: "", assignee: stage.default_assignee_email || "", due: null, focused: true, saving: false,
};
} else delete boardTaskDrafts[stage.id];
refreshActiveView();
refreshMyOpenBadge();
} catch (err) {
if (current()) {
draft.saving = false;
draft.focused = true;
renderBoard();
}
showToast("작업 추가 실패: " + err.message, "error");
}
}
function outside(e) {
if (!current() || !card.isConnected || draft.saving || draft.picking) return;
const target = e.target;
if (card.contains(target) || (datePopEl && datePopEl.contains(target)) || (ctxMenuEl && ctxMenuEl.contains(target))) return;
const add = target.closest(".pj-col-addtask, .pj-col-add");
if (add && add.closest(".pj-col") === body.closest(".pj-col")) return;
// 한글 조합의 마지막 글자가 blur에서 확정된 뒤 읽는다.
setTimeout(function () {
if (!current()) return;
if (inp.isConnected) draft.title = inp.value;
if (draft.title.trim()) save(false);
else close();
}, 0);
}
boardTaskOutsideDown[stage.id] = outside;
document.addEventListener("pointerdown", outside, true);
if (draft.focused && !draft.saving) setTimeout(function () {
if (!current() || !inp.isConnected || datePopEl || ctxMenuEl) return;
inp.focus();
inp.setSelectionRange(inp.value.length, inp.value.length);
// 컬럼 안에 새 카드가 보이도록만 스크롤한다(보드 가로 위치는 유지).
body.scrollTop = body.scrollHeight;
}, 0);
}
// 세션(컬럼) 드래그 재정렬 — 카드 드래그와 같은 네이티브 HTML5 DnD 방식이되,
// dataTransfer 타입을 달리 써서(application/x-pj-stage) 카드 드롭과 안 섞인다.
function wireColumnDrag(col, s) {
@@ -4533,7 +4714,7 @@
// 드롭 지점(마우스 Y)이 이 컬럼의 카드들 중 어디에 해당하는지 인덱스로.
// 드래그 중인 카드 자신은 계산에서 제외(자기 위치가 기준을 흔들지 않게).
function cardDropIndex(body, clientY, excludeTaskId) {
const cards = Array.prototype.slice.call(body.querySelectorAll(".pj-card"))
const cards = Array.prototype.slice.call(body.querySelectorAll(".pj-card[data-task-id]"))
.filter(function (c) { return String(c.dataset.taskId) !== String(excludeTaskId); });
for (let i = 0; i < cards.length; i++) {
const r = cards[i].getBoundingClientRect();
@@ -4641,7 +4822,13 @@
// 지금 끌고 있는 하위 업무 줄 { sub, from(상위 업무) } — dragover 중엔
// dataTransfer 값을 읽을 수 없어서(보안상 type 만 보임) 여기 들고 있는다.
let dragSub = null;
const subOrderSaving = new Set();
const SUB_DRAG_TYPE = "application/x-pj-subtask";
function clearSubDropMarks() {
document.querySelectorAll(".pj-sub-drop-before, .pj-sub-drop-after").forEach(function (row) {
row.classList.remove("pj-sub-drop-before", "pj-sub-drop-after");
});
}
function cardSubRowHtml(sub) {
const di = dueInfo(sub.due_date, !!sub.completed_at);
return '<div class="pj-card-sub' + (sub.completed_at ? " is-done" : "") + '" data-sub-id="' + sub.id + '">' +
@@ -4717,15 +4904,64 @@
box.innerHTML = subs.length
? subs.map(cardSubRowHtml).join("")
: (canManage ? "" : '<div class="pj-card-sub-empty">하위 작업 없음</div>');
if (canManage) {
function dropPosition(e) {
let row = e.target.closest(".pj-card-sub");
if (!row || !box.contains(row)) {
const rows = box.querySelectorAll(".pj-card-sub");
row = rows[rows.length - 1];
}
if (!row) return null;
const rect = row.getBoundingClientRect();
return { row: row, id: Number(row.dataset.subId), after: e.clientY >= rect.top + rect.height / 2 };
}
box.ondragover = function (e) {
if (!dragSub || dragSub.from.id !== t.id || !e.dataTransfer.types.includes(SUB_DRAG_TYPE)) return;
e.preventDefault(); e.stopPropagation();
e.dataTransfer.dropEffect = "move";
clearSubDropMarks();
const pos = dropPosition(e);
if (pos && pos.id !== dragSub.sub.id && !subOrderSaving.has(t.id)) {
pos.row.classList.add(pos.after ? "pj-sub-drop-after" : "pj-sub-drop-before");
}
};
box.ondragleave = function (e) { if (!box.contains(e.relatedTarget)) clearSubDropMarks(); };
box.ondrop = async function (e) {
if (!dragSub || dragSub.from.id !== t.id || !e.dataTransfer.types.includes(SUB_DRAG_TYPE)) return;
e.preventDefault(); e.stopPropagation();
const movingId = dragSub.sub.id, pos = dropPosition(e);
dragSub = null;
clearSubDropMarks();
box.querySelectorAll(".is-dragging").forEach(function (row) { row.classList.remove("is-dragging"); });
if (!pos || pos.id === movingId || subOrderSaving.has(t.id)) return;
const ordered = subs.filter(function (sub) { return sub.id !== movingId; });
const moving = subs.find(function (sub) { return sub.id === movingId; });
const index = ordered.findIndex(function (sub) { return sub.id === pos.id; });
if (!moving || index < 0) return;
ordered.splice(index + (pos.after ? 1 : 0), 0, moving);
const ids = ordered.map(function (sub) { return sub.id; });
if (ids.join(",") === subs.map(function (sub) { return sub.id; }).join(",")) return;
subOrderSaving.add(t.id);
try {
await api("PUT", "/project/api/tasks/" + t.id + "/subtasks/order", { ordered_ids: ids });
if (subsCache[t.id] === subs) {
subsCache[t.id] = ordered;
renderBoard();
}
} catch (err) { showToast("하위 작업 순서 변경 실패: " + err.message, "error"); }
finally { subOrderSaving.delete(t.id); }
};
}
box.querySelectorAll(".pj-card-sub").forEach(function (row) {
const sub = subs.find(function (x) { return String(x.id) === row.dataset.subId; });
if (!sub) return;
// 드래그 — 이 하위 업무 한 줄만 다른 카드(상위 업무)로 옮긴다. 카드 자체도
// 드래그 — 같은 카드에서 순서를 바꾸거나 다른 상위 업무로 옮긴다. 카드 자체도
// draggable 이라 이벤트가 카드로 올라가면 카드 이동이 시작되므로 막는다.
if (canManage) {
row.draggable = true;
row.addEventListener("dragstart", function (e) {
e.stopPropagation();
if (subOrderSaving.has(t.id)) { e.preventDefault(); return; }
dragSub = { sub: sub, from: t };
e.dataTransfer.setData(SUB_DRAG_TYPE, String(sub.id));
e.dataTransfer.effectAllowed = "move";
@@ -4735,6 +4971,7 @@
e.stopPropagation();
row.classList.remove("is-dragging");
dragSub = null;
clearSubDropMarks();
document.querySelectorAll(".pj-card.is-sub-drop").forEach(function (c) { c.classList.remove("is-sub-drop"); });
});
}
@@ -5030,6 +5267,7 @@
});
}
const cardCompletionSaving = new Set();
function taskCard(t) {
const card = document.createElement("div");
card.className = "pj-card" + (t.completed_at ? " is-done" : "");
@@ -5050,7 +5288,13 @@
(showProjTag && t.project_name
? '<div class="pj-card-proj" style="color:' + (t.project_color || "#4573d2") + '">● ' + escapeHtml(t.project_name) + "</div>"
: "") +
'<div class="pj-card-title">' + escapeHtml(t.title) + "</div>" +
'<div class="pj-card-title-row"><button type="button" class="pj-card-check" role="checkbox" aria-checked="' + (!!t.completed_at) +
'" aria-label="' + escapeHtml((t.completed_at ? "완료 취소: " : "완료로 표시: ") + t.title) +
'" title="' + (t.completed_at ? "완료 취소" : "완료로 표시") + '"' +
(!(canManage && taskAccessLevel(t) === "full") || cardCompletionSaving.has(t.id) ? " disabled" : "") +
(cardCompletionSaving.has(t.id) ? ' aria-busy="true"' : "") +
'><span class="material-symbols-outlined" aria-hidden="true">check_circle</span></button>' +
'<div class="pj-card-title">' + escapeHtml(t.title) + "</div></div>" +
'<div class="pj-card-meta">' +
(t.priority && t.priority !== "normal"
? '<span class="pj-pri pj-pri-' + t.priority + '">' + (priorityLabels[t.priority] || t.priority) + "</span>"
@@ -5104,6 +5348,28 @@
: "");
const subsBox = card.querySelector(".pj-card-subs");
if (subsBox) fillCardSubs(subsBox, t);
const check = card.querySelector(".pj-card-check");
check.addEventListener("click", async function (e) {
e.stopPropagation();
if (!canManage || taskAccessLevel(t) !== "full" || cardCompletionSaving.has(t.id)) return;
cardCompletionSaving.add(t.id); check.disabled = true; check.setAttribute("aria-busy", "true");
let updated = false;
const hadFocus = document.activeElement === check;
try {
const res = await api("PUT", "/project/api/tasks/" + t.id, { completed: !t.completed_at });
mergeTask(res.task); updated = true;
} catch (err) { showToast("완료 상태 변경 실패: " + err.message, "error"); }
finally {
cardCompletionSaving.delete(t.id);
const restoreFocus = hadFocus && (document.activeElement === check || document.activeElement === document.body);
refreshActiveView();
if (restoreFocus) {
const liveCheck = document.querySelector('.pj-card[data-task-id="' + t.id + '"] .pj-card-check');
if (liveCheck) liveCheck.focus();
}
}
if (updated) refreshMyOpenBadge();
});
card.addEventListener("click", function (e) {
// 하위 업무 펼치기/접기 — 보기 권한만 있어도 된다.
const tog = e.target.closest(".pj-card-subtoggle");
@@ -6810,6 +7076,11 @@
function onProjectAccessLost() {
if (accessLost) return;
accessLost = true;
Object.keys(boardTaskDrafts).forEach(function (id) { delete boardTaskDrafts[id]; });
Object.keys(boardTaskOutsideDown).forEach(function (id) {
document.removeEventListener("pointerdown", boardTaskOutsideDown[id], true);
delete boardTaskOutsideDown[id];
});
tasks = [];
discardTaskEdits();
if (!taskModal.hidden) closeSlidePanel(taskModal);
@@ -8144,6 +8415,75 @@
});
update();
}
// 공용 왼쪽 메뉴 너비: 170~500px, 마우스·방향키로 조절하고 브라우저에 기억.
function initSideResize() {
const layout = document.querySelector(".pj-layout");
const side = layout && layout.querySelector(".pj-side");
if (!side) return;
const key = "pj_side_w";
const handle = document.createElement("div");
handle.className = "pj-side-resizer"; handle.tabIndex = 0;
handle.setAttribute("role", "separator"); handle.setAttribute("aria-orientation", "vertical");
handle.setAttribute("aria-label", "왼쪽 메뉴 너비 조절");
handle.setAttribute("aria-valuemin", "170"); handle.setAttribute("aria-valuemax", "500");
handle.title = "끌어서 메뉴 너비 조절 (최소 170px)";
layout.appendChild(handle);
function width() { return parseInt(layout.style.getPropertyValue("--pj-side-w"), 10) || Math.round(side.getBoundingClientRect().width / uiZoom()) || 250; }
let currentWidth = width();
function apply(w) {
w = Math.max(170, Math.min(500, Math.round(w)));
// 같은 픽셀 너비면 스타일을 다시 쓰거나 화면을 다시 계산하지 않는다.
if (w === currentWidth && layout.style.getPropertyValue("--pj-side-w") === w + "px") return;
currentWidth = w;
layout.style.setProperty("--pj-side-w", w + "px"); handle.setAttribute("aria-valuenow", String(w));
}
function remember() { try { localStorage.setItem(key, String(currentWidth)); } catch (_) {} }
try { const saved = Number(localStorage.getItem(key)); if (Number.isFinite(saved) && saved > 0) apply(saved); } catch (_) {}
handle.setAttribute("aria-valuenow", String(currentWidth));
let finishDrag = null;
handle.addEventListener("mousedown", function (e) {
if (e.button !== 0 || finishDrag) return;
e.preventDefault();
currentWidth = width(); // 기본 너비는 창 크기에 따라 250px/220px로 바뀔 수 있다.
const x = e.clientX, w = currentWidth, zoom = uiZoom();
let pendingWidth = w, frame = null;
handle.classList.add("is-dragging"); document.documentElement.classList.add("pj-side-resizing");
// 마우스 이벤트가 화면 주사율보다 빨라도 최신 위치만 프레임당 한 번 반영한다.
function flush() { frame = null; apply(pendingWidth); }
function move(ev) {
pendingWidth = w + (ev.clientX - x) / zoom;
if (frame === null) frame = window.requestAnimationFrame(flush);
}
function up() {
// 마지막 프레임 전에 놓아도 마지막 이동 위치를 반영하고 예약된 콜백을 정리한다.
if (frame !== null) { window.cancelAnimationFrame(frame); flush(); }
document.removeEventListener("mousemove", move); document.removeEventListener("mouseup", up);
window.removeEventListener("blur", up); finishDrag = null;
handle.classList.remove("is-dragging"); document.documentElement.classList.remove("pj-side-resizing"); remember();
// resize 는 목표 표의 모든 글 높이·달력 등까지 재계산하므로 드래그 종료 때만 보낸다.
if (currentWidth !== w) window.dispatchEvent(new Event("resize"));
}
finishDrag = up;
document.addEventListener("mousemove", move); document.addEventListener("mouseup", up);
window.addEventListener("blur", up); // 창 밖에서 놓아도 드래그 상태가 남지 않게 한다.
});
handle.addEventListener("keydown", function (e) {
if (!['ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(e.key)) return;
e.preventDefault();
if (finishDrag) finishDrag();
currentWidth = width();
const before = currentWidth;
apply(e.key === "Home" ? 170 : e.key === "End" ? 500 : currentWidth + (e.key === "ArrowLeft" ? -10 : 10)); remember();
if (currentWidth !== before) window.dispatchEvent(new Event("resize"));
});
handle.addEventListener("dblclick", function () {
if (finishDrag) finishDrag();
layout.style.removeProperty("--pj-side-w");
currentWidth = width();
try { localStorage.removeItem(key); } catch (_) {}
handle.setAttribute("aria-valuenow", String(currentWidth)); window.dispatchEvent(new Event("resize"));
});
}
function initScrollIndicators() {
document.querySelectorAll(".pj-side, .pj-mytasks-pane, .pj-inbox-pane")
.forEach(attachScrollIndicator);
@@ -8266,10 +8606,10 @@
const year = table.dataset.year;
const isAdmin = table.dataset.admin === "true";
// ── 열 너비 — 머리 칸 오른쪽 끝을 끌어 조절, 브라우저에 기억(localStorage pj_goal_col_w) ──
// ── 열 너비 — 셀 오른쪽 경계에서 끌기·더블클릭 맞춤, 브라우저에 기억(localStorage pj_goal_col_w) ──
// · c1·c2 = 왼쪽 이름 두 칸(구분·항목) → 표의 CSS 변수 --goal-c1-w·--goal-c2-w(c2 의 left 도 c1 너비로 정해진다)
// · y = 연간, m1~m12 = 월, q1~q4 = 분기 → 그 머리 칸의 --cw(표는 table-layout: fixed 라 머리 칸 너비가 열 너비)
// 화면 배율(uiZoom) 안이라 마우스 이동 거리는 배율로 나눈다. 더블클릭 = 기본 너비.
// 화면 배율(uiZoom) 안이라 마우스 이동 거리는 배율로 나눈다. 더블클릭 = 가장 긴 문단에 맞춤.
const COL_KEY = "pj_goal_col_w";
const colDefault = { c1: 72, c2: 72, y: 90, q1: 80, q2: 80, q3: 80, q4: 80 };
for (let m = 1; m <= 12; m++) colDefault["m" + m] = 85;
@@ -8280,7 +8620,8 @@
const saved = JSON.parse(localStorage.getItem(COL_KEY) || "null");
if (saved) Object.keys(colDefault).forEach(function (k) {
const v = parseInt(saved[k], 10);
if (v) colW[k] = clampCol(k, v);
// 자동 맞춤은 긴 문단을 자르지 않도록 드래그 최대 너비를 넘을 수 있다.
if (v > 0) colW[k] = Math.max(colLimit(k)[0], v);
});
} catch (_) {}
function saveColW() {
@@ -8305,8 +8646,112 @@
}
applyColW();
let lastColResize = 0;
table.querySelectorAll(".pj-goal-colresize").forEach(function (h) {
h.addEventListener("mousedown", function (e) {
// rowspan/colspan 을 포함한 논리 열을 따라 각 셀의 오른쪽 경계에 손잡이를 붙인다.
// 병합 셀에서는 오른쪽 끝 열의 너비를 조절한다. 새 줄·병합 뒤에도 다시 배선한다.
function addColHandles() {
const keys = Array.from(table.tHead.rows[0].cells).map(function (th) { return th.querySelector(".pj-goal-colresize").dataset.col; });
const occupied = [];
Array.from(table.rows).forEach(function (tr, r) {
occupied[r] = occupied[r] || [];
let c = 0;
Array.from(tr.cells).forEach(function (td) {
while (occupied[r][c]) c++;
const end = c + td.colSpan - 1;
for (let rr = r; rr < r + td.rowSpan; rr++) {
occupied[rr] = occupied[rr] || [];
for (let cc = c; cc <= end; cc++) occupied[rr][cc] = true;
}
td.dataset.goalCols = keys.slice(c, end + 1).join(",");
if (!td.querySelector(".pj-goal-colresize") && keys[end]) {
const h = document.createElement("span"); h.className = "pj-goal-colresize";
h.dataset.col = keys[end]; td.appendChild(h);
}
const handle = td.querySelector(".pj-goal-colresize");
if (handle) handle.title = "끌어서 너비 조절 · 더블클릭하면 내용에 맞춤";
c = end + 1;
});
});
}
addColHandles();
function naturalCellWidth(td) {
// 원본은 건드리지 않는다. 같은 표 구조의 숨은 복사본으로 폰트·부분 서식·여백을
// 그대로 재되, 화면 폭에 따른 줄바꿈만 해제한다(직접 넣은 줄바꿈은 유지).
const probe = document.createElement("div"), copy = td.cloneNode(true);
const measureTable = table.cloneNode(false), section = td.parentElement.parentElement.cloneNode(false), row = td.parentElement.cloneNode(false);
probe.style.cssText = "position:fixed;left:0;top:0;visibility:hidden;pointer-events:none;width:max-content;";
probe.setAttribute("aria-hidden", "true");
[measureTable, section, row].forEach(function (n) { n.removeAttribute("id"); });
measureTable.style.cssText += ";width:max-content;table-layout:auto;";
copy.classList.add("pj-goal-autofit-measure");
copy.querySelectorAll(".pj-goal-colresize, .pj-goal-menu-btn, .pj-goal-move-edge").forEach(function (n) { n.remove(); });
// input의 현재 초안은 HTML 속성과 다를 수 있고, 기본 입력칸의 내재 너비도 제외한다.
copy.querySelectorAll("input, textarea").forEach(function (n) {
const text = document.createElement("span");
text.className = n.className; text.style.cssText = n.style.cssText;
text.textContent = n.value; n.replaceWith(text);
});
[copy].concat(Array.from(copy.querySelectorAll("*"))).forEach(function (n) {
n.removeAttribute("id"); n.removeAttribute("contenteditable"); n.removeAttribute("data-placeholder");
n.classList.remove("is-shrunk", "is-gone");
const overrides = { position: "static", width: "max-content", "min-width": "0", "max-width": "none",
height: "auto", overflow: "visible", transition: "none", "overflow-wrap": "normal", "word-break": "normal" };
Object.keys(overrides).forEach(function (p) { n.style.setProperty(p, overrides[p], "important"); });
if (n.matches(".pj-goal-text, .pj-goal-text-ro, .pj-goal-area-text, .pj-goal-row-text")) {
n.style.setProperty("white-space", "pre", "important");
}
});
copy.style.setProperty("display", "block", "important");
row.appendChild(copy); section.appendChild(row); measureTable.appendChild(section); probe.appendChild(measureTable);
// 접힌 분기의 display:none 셀도 전체 자동 맞춤 때 측정할 수 있다.
pane.appendChild(probe);
try { return Math.ceil(copy.getBoundingClientRect().width / uiZoom()) + 2; }
finally { probe.remove(); }
}
function autoFitCol(key) {
let width = colLimit(key)[0];
table.querySelectorAll("[data-goal-cols]").forEach(function (td) {
const keys = td.dataset.goalCols.split(",");
if (!keys.includes(key)) return;
// 병합 칸의 다른 열은 유지하고 선택한 열에 필요한 나머지 너비만 더한다.
const otherWidth = keys.reduce(function (sum, k) { return sum + (k === key ? 0 : colW[k]); }, 0);
width = Math.max(width, naturalCellWidth(td) - otherWidth);
});
colW[key] = width;
applyColW(); saveColW(); fitAll(); stickKpi();
}
function autoFitAllCols() {
const cells = Array.from(table.querySelectorAll("[data-goal-cols]")).map(function (td) {
return { keys: td.dataset.goalCols.split(","), width: naturalCellWidth(td) };
});
Object.keys(colDefault).forEach(function (key) { colW[key] = colLimit(key)[0]; });
cells.filter(function (cell) { return cell.keys.length === 1; }).forEach(function (cell) {
colW[cell.keys[0]] = Math.max(colW[cell.keys[0]], cell.width);
});
cells.filter(function (cell) { return cell.keys.length > 1; }).forEach(function (cell) {
const sum = cell.keys.reduce(function (w, key) { return w + colW[key]; }, 0);
if (cell.width > sum) colW[cell.keys[cell.keys.length - 1]] += cell.width - sum;
});
applyColW(); saveColW(); fitAll(); stickKpi();
}
function widthMenuItems(td) {
const key = (td.dataset.goalCols || "").split(",").pop();
if (!colDefault[key]) return [];
return [
{ label: "현재 열 너비 자동 맞춤", icon: menuIcon("fit_screen"), onClick: function () { autoFitCol(key); } },
{ label: "전체 열 너비 자동 맞춤", icon: menuIcon("view_week"), onClick: autoFitAllCols },
];
}
table.addEventListener("contextmenu", function (e) {
const td = e.target.closest("th, td");
if (!td || !table.contains(td)) return;
// 관리자 업무 셀·이름 칸은 아래의 기존 편집 메뉴에 합쳐 표시한다.
if (isAdmin && td.closest("tbody.pj-goal-area") &&
(td.tagName === "TH" || table.dataset.halves === "true" || td.dataset.month === "0")) return;
e.preventDefault(); showContextMenu(e.clientX, e.clientY, widthMenuItems(td));
});
table.addEventListener("mousedown", function (e) {
const h = e.target.closest(".pj-goal-colresize");
if (!h) return;
if (e.button !== 0) return;
e.preventDefault();
e.stopPropagation();
@@ -8329,15 +8774,15 @@
}
document.addEventListener("mousemove", onMove);
document.addEventListener("mouseup", onUp);
});
h.addEventListener("click", function (e) { e.stopPropagation(); });
h.addEventListener("dblclick", function (e) {
}, true);
table.addEventListener("click", function (e) { if (e.target.closest(".pj-goal-colresize")) e.stopPropagation(); }, true);
table.addEventListener("dblclick", function (e) {
const h = e.target.closest(".pj-goal-colresize");
if (!h) return;
e.preventDefault();
e.stopPropagation();
colW[h.dataset.col] = colDefault[h.dataset.col];
applyColW();
saveColW();
fitAll();
});
lastColResize = Date.now();
autoFitCol(h.dataset.col);
});
// ── 틀 고정 — 머리 줄 아래 숫자 지표(매출·로아스) 줄까지 세로 스크롤에도 위에 붙어 있다.
@@ -8429,6 +8874,7 @@
" · " + months.length + "개월";
});
});
addColHandles(); // 합계·달성률의 textContent 를 바꾼 뒤에도 손잡이를 유지한다.
}
recompute();
@@ -8468,7 +8914,7 @@
syncFoldBtn(h);
if (!animate || reduce) {
cells.forEach(function (c) { c.classList.toggle("is-shrunk", folded); c.classList.toggle("is-gone", folded); });
if (!folded) table.querySelectorAll('.pj-goal-m[data-h="' + h + '"] textarea.pj-goal-text').forEach(fit);
if (!folded) table.querySelectorAll('.pj-goal-m[data-h="' + h + '"] .pj-goal-text').forEach(fit);
return;
}
table.classList.add("is-folding");
@@ -8481,7 +8927,7 @@
}
foldTimers[h] = setTimeout(function () {
if (folded) cells.forEach(function (c) { c.classList.add("is-gone"); });
else table.querySelectorAll('.pj-goal-m[data-h="' + h + '"] textarea.pj-goal-text').forEach(fit);
else table.querySelectorAll('.pj-goal-m[data-h="' + h + '"] .pj-goal-text').forEach(fit);
delete foldTimers[h];
if (!Object.keys(foldTimers).length) table.classList.remove("is-folding");
}, FOLD_MS + 20);
@@ -8500,13 +8946,16 @@
applyFold(h, true);
});
});
// 글 칸 높이 맞추기 — 접혀 안 보이는 칸은 건너뛴다(높이 0 으로 재져 펼쳤을 때 글이 잘림). 펼칠 때 다시 잰다.
// contenteditable 글 칸은 내용의 자연 높이를 쓴다. 표가 가장 높은 칸에 행을 맞추고
// 짧은 칸은 상단에 둔다. 글·폭·부분 서식 변경과 숨긴 분기에서도 오래된 높이가 남지 않는다.
function fit(ta) {
if (ta.tagName !== "TEXTAREA") { ta.style.removeProperty("height"); return; }
// 예전 textarea 템플릿도 지원하되 접힌 칸은 펼친 뒤 잰다.
if (!ta.offsetParent) return;
ta.style.height = "auto";
ta.style.height = ta.scrollHeight + "px";
}
function fitAll() { table.querySelectorAll("textarea.pj-goal-text").forEach(fit); }
function fitAll() { table.querySelectorAll(".pj-goal-text").forEach(fit); }
QUARTERS.forEach(function (q) { applyFold(q, false); });
// 병합 선택(Shift+클릭) — 관리자 전용, 아래에서 채운다. 접기 버튼이 먼저 부르므로 여기 둔다.
@@ -8576,9 +9025,16 @@
// 글 칸 연결 — 처음 한 번 + 표를 그 자리에서 다시 그린 뒤 새 칸에(refreshTable). 되살린 초안 수를 돌려준다.
function bindTexts(root) {
let restored = 0, conflict = 0;
root.querySelectorAll("textarea.pj-goal-text").forEach(function (ta) {
root.querySelectorAll(".pj-goal-text").forEach(function (ta) {
if (ta.dataset.bound) return;
ta.dataset.bound = "1";
if (ta.tagName !== "TEXTAREA") window.PJGoalText.attach(ta);
["top", "right", "bottom", "left"].forEach(function (edge) {
const handle = document.createElement("span");
handle.className = "pj-goal-move-edge"; handle.dataset.edge = edge;
handle.title = "끌어서 내용과 서식 이동"; handle.setAttribute("aria-hidden", "true");
ta.closest("td").appendChild(handle);
});
const r = textSaver.track(ta, ta.value);
if (r === "restored") restored++;
else if (r === "conflict") conflict++;
@@ -8590,17 +9046,122 @@
else if (conflict) showToast("다른 곳에서 바뀐 칸 " + conflict + "개는 예전 초안을 되살리지 않았습니다.");
}
bindTexts(table);
window.PJGoalText.init(table, el("pj-goal-format"));
let moveBusy = false, moveClickUntil = 0;
function goalCellTd(node) {
const td = node && node.closest && node.closest("tbody.pj-goal-area td.pj-goal-texttd");
return td && table.contains(td) && td.querySelector(".pj-goal-text") ? td : null;
}
function setMoveActive(td) {
table.querySelectorAll(".is-goal-active").forEach(function (cell) { cell.classList.remove("is-goal-active"); });
if (td) td.classList.add("is-goal-active");
}
function moveBody(editor) {
// 열의 기본 서식도 현재 표시값으로 명시해 연간·분기의 굵기가 이동 뒤 달라지지 않게 한다.
const cs = getComputedStyle(editor), rgb = cs.color.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
const defaults = { bold: Number(cs.fontWeight) >= 600 || cs.fontWeight === "bold", italic: cs.fontStyle === "italic",
underline: (cs.textDecorationLine || "").includes("underline") };
const size = Math.round(parseFloat(cs.fontSize)); if (size >= 10 && size <= 32) defaults.size = size;
if (rgb) defaults.color = "#" + rgb.slice(1).map(function (v) { return Number(v).toString(16).padStart(2, "0"); }).join("");
return window.PJGoalText.encode(window.PJGoalText.readRuns(editor).map(function (run) { return Object.assign({}, defaults, run); }));
}
function moveCell(sourceTd, targetTd) {
if (moveBusy || sourceTd === targetTd) return;
moveBusy = true;
return withStruct(async function () {
const source = sourceTd.querySelector(".pj-goal-text"), target = targetTd.querySelector(".pj-goal-text");
const fields = [source, target], attrs = fields.map(function (n) { return n.getAttribute("contenteditable"); });
try {
if (!document.contains(sourceTd) || !document.contains(targetTd) || !source.value) return;
fields.forEach(function (n) { n.setAttribute("contenteditable", "false"); n.closest("td").classList.add("is-goal-move-saving"); });
await flushTexts();
const sourceBody = source.value, targetBody = target.value;
if (targetBody && !await confirm("대상 셀의 내용을 덮어쓸까요? 원본의 내용과 서식으로 바뀝니다.", { okText: "덮어쓰기", cancelText: "취소" })) return;
const res = await api("POST", "/project/api/goals/cells/move", {
source_row: source.dataset.row, source_month: source.dataset.month,
target_row: target.dataset.row, target_month: target.dataset.month,
source_body: sourceBody, target_body: targetBody, body: moveBody(source),
});
source.value = ""; target.value = res.body;
textSaver.acceptSaved(source, ""); textSaver.acceptSaved(target, target.value);
fit(source); fit(target); clearMergeSel(); setMoveActive(targetTd); flashSaved(targetTd);
showToast("내용과 서식을 이동했습니다.");
} catch (err) {
showToast("셀 이동 실패: " + err.message + " — 두 칸의 화면 내용은 유지됩니다. 다시 시도하거나 새로고침해 저장 상태를 확인해 주세요.", "error");
} finally {
fields.forEach(function (n, i) {
if (attrs[i] == null) n.removeAttribute("contenteditable"); else n.setAttribute("contenteditable", attrs[i]);
n.closest("td").classList.remove("is-goal-move-saving");
});
moveBusy = false;
}
});
}
// 선택한 셀의 테두리는 이동, 일반 본문 드래그는 기존 글/병합 범위 선택을 유지한다.
table.addEventListener("mousedown", function (e) {
if (e.button !== 0 || e.shiftKey) return;
const source = goalCellTd(e.target), handle = e.target.closest(".pj-goal-move-edge");
if (!source) return;
if (!handle) { if (!moveBusy) setMoveActive(source); return; }
e.preventDefault(); e.stopImmediatePropagation();
if (moveBusy || !source.querySelector(".pj-goal-text").value) return;
const startX = e.clientX, startY = e.clientY;
let moving = false, target = null, frame = null, x = startX, y = startY;
function updateTarget() {
table.querySelectorAll(".is-goal-move-target").forEach(function (n) { n.classList.remove("is-goal-move-target"); });
target = goalCellTd(document.elementFromPoint(x, y));
if (target === source) target = null;
if (target) target.classList.add("is-goal-move-target");
}
function scroll() {
const r = pane.getBoundingClientRect();
if (x >= r.left && x <= r.right && y >= r.top && y <= r.bottom) {
if (x < r.left + 24) pane.scrollLeft -= 16; else if (x > r.right - 24) pane.scrollLeft += 16;
if (y < r.top + 24) pane.scrollTop -= 16; else if (y > r.bottom - 24) pane.scrollTop += 16;
}
updateTarget(); frame = requestAnimationFrame(scroll);
}
function move(ev) {
x = ev.clientX; y = ev.clientY;
if (!moving && Math.hypot(x - startX, y - startY) < 4) return;
if (!moving) {
moving = true; source.classList.add("is-goal-moving");
document.documentElement.classList.add("pj-goal-moving");
const selection = window.getSelection(); if (selection) selection.removeAllRanges();
frame = requestAnimationFrame(scroll);
}
updateTarget();
}
function end(ev) {
if (frame !== null) cancelAnimationFrame(frame);
document.removeEventListener("mousemove", move); document.removeEventListener("mouseup", end);
document.removeEventListener("keydown", key, true); window.removeEventListener("blur", cancel);
source.classList.remove("is-goal-moving"); document.documentElement.classList.remove("pj-goal-moving");
table.querySelectorAll(".is-goal-move-target").forEach(function (n) { n.classList.remove("is-goal-move-target"); });
if (moving) moveClickUntil = Date.now() + 300;
if (ev && moving && target) moveCell(source, target);
}
function cancel() { end(null); }
function key(ev) { if (ev.key === "Escape") { ev.preventDefault(); ev.stopImmediatePropagation(); cancel(); } }
document.addEventListener("mousemove", move); document.addEventListener("mouseup", end);
document.addEventListener("keydown", key, true); window.addEventListener("blur", cancel);
}, true);
table.addEventListener("click", function (e) {
if ((Date.now() < moveClickUntil && e.detail !== 0 && goalCellTd(e.target)) || e.target.closest(".pj-goal-move-edge")) {
e.preventDefault(); e.stopImmediatePropagation();
}
}, true);
// 칸이 세로로 길어도(옆 칸 글이 길거나 세로 병합) 칸 아무 곳이나 누르면 그 칸 입력 — 커서는 글 끝(엑셀처럼).
// 입력칸(textarea)은 글 높이만큼이라 그 아래를 누르면 아무것도 안 되던 것. Shift+클릭(범위 고르기)·끌기는 그대로.
table.addEventListener("click", function (e) {
if (e.shiftKey || e.button !== 0) return;
const td = e.target.closest("td.pj-goal-texttd");
if (!td || e.target.closest("textarea, input, button, a")) return;
const ta = td.querySelector("textarea.pj-goal-text");
if (!td || e.target.closest(".pj-goal-text, textarea, input, button, a")) return;
const ta = td.querySelector(".pj-goal-text");
if (!ta || ta === document.activeElement) return;
ta.focus();
const n = ta.value.length;
ta.setSelectionRange(n, n);
const range = document.createRange(); range.selectNodeContents(ta); range.collapse(false);
const selection = window.getSelection(); selection.removeAllRanges(); selection.addRange(range);
});
// 한 줄 안 칸들 높이는 표가 맞춘다 — 창 폭이 바뀌면 글 줄바꿈이 달라지니 다시 잰다.
window.addEventListener("resize", fitAll);
@@ -8755,6 +9316,7 @@
table.querySelectorAll("tbody.pj-goal-area").forEach(function (t) { t.remove(); });
fresh.querySelectorAll("tbody.pj-goal-area").forEach(function (t) { table.appendChild(document.importNode(t, true)); });
textSaver.prune();
addColHandles();
applyColW();
QUARTERS.forEach(function (q) { applyFold(q, false); });
bindTexts(table);
@@ -8828,7 +9390,7 @@
return items;
}
function openAreaMenu(th, x, y, opts) {
showContextMenu(x, y, areaMenuItems(th.closest("tbody"), { x: x, y: y }),
showContextMenu(x, y, areaMenuItems(th.closest("tbody"), { x: x, y: y }).concat([null], widthMenuItems(th)),
Object.assign({ label: textOf(th, ".pj-goal-area-text") + " 구역 메뉴" }, opts || {}));
}
table.addEventListener("contextmenu", function (e) {
@@ -8916,7 +9478,7 @@
// 2열 = 항목 칸 밖에 따로 추가(묶음의 맨 위·맨 아래 기준), 묶인 칸이면 "항목 칸 나누기"도
const grouped = (th.rowSpan || 1) > 1;
showContextMenu(x, y, rowMenuItems(tr, labelGroupBottom(tr), true,
{ splitRow: grouped ? tr : null, move: grouped ? null : tr }),
{ splitRow: grouped ? tr : null, move: grouped ? null : tr }).concat([null], widthMenuItems(th)),
Object.assign({ label: (textOf(th, ".pj-goal-row-text") || "이름 없는") + " 줄 메뉴" }, opts || {}));
}
table.addEventListener("contextmenu", function (e) {
@@ -8961,7 +9523,7 @@
if (!td || !table.contains(td)) return;
e.preventDefault();
const r = yearCellRows(td);
showContextMenu(e.clientX, e.clientY, rowMenuItems(r.top, r.bottom, r.single, { sameLabel: true }));
showContextMenu(e.clientX, e.clientY, rowMenuItems(r.top, r.bottom, r.single, { sameLabel: true }).concat([null], widthMenuItems(td)));
});
}
@@ -9077,12 +9639,14 @@
let drag = null;
clearMergeSel = function () {
sel = null;
setMoveActive(null);
table.querySelectorAll("td.is-merge-sel").forEach(function (td) { td.classList.remove("is-merge-sel"); });
};
const paint = function () {
table.querySelectorAll("td.is-merge-sel").forEach(function (td) { td.classList.remove("is-merge-sel"); });
if (!sel) return;
sel.cells.forEach(function (c) { if (hits(c, sel)) c.td.classList.add("is-merge-sel"); });
setMoveActive(sel.n === 1 ? sel.cells.find(function (c) { return hits(c, sel); }).td : null);
};
const select = function (tbody, a, b) {
const cells = gridOf(tbody);
@@ -9125,7 +9689,7 @@
let lastCleared = null; // [[textarea, 예전 글], …]
const clearSel = async function (s) {
const tas = s.cells.filter(function (c) { return hits(c, s); })
.map(function (c) { return c.td.querySelector("textarea.pj-goal-text"); })
.map(function (c) { return c.td.querySelector(".pj-goal-text"); })
.filter(function (ta) { return ta && ta.value !== ""; });
if (!tas.length) return;
lastCleared = tas.map(function (ta) { return [ta, ta.value]; });
@@ -9168,6 +9732,7 @@
clearMergeSel();
anchorCell = { tbody: tbody, td: td };
drag = { tbody: tbody, td: td, moved: false };
select(tbody, td, td);
});
table.addEventListener("mouseover", function (e) {
if (!drag) return;
@@ -9215,7 +9780,7 @@
items.push({ label: "병합 해제" + (mergedIn.length > 1 ? " (" + mergedIn.length + "곳)" : ""), icon: menuIcon("call_split"),
onClick: function () { clearMergeSel(); unmerge(mergedIn); } });
}
if (inSel.some(function (c) { const t = c.td.querySelector("textarea.pj-goal-text"); return t && t.value; })) {
if (inSel.some(function (c) { const t = c.td.querySelector(".pj-goal-text"); return t && t.value; })) {
items.push({ label: "내용 지우기 (Del)", icon: menuIcon("ink_eraser"), onClick: function () { clearSel(s); } });
}
if (td.dataset.month === "0" && s.n === 1) { // 3열(연간 칸) 하나 우클릭 — 줄 추가·삭제도
@@ -9223,7 +9788,8 @@
if (items.length) items.push(null);
rowMenuItems(r.top, r.bottom, r.single, { sameLabel: true }).forEach(function (it) { items.push(it); });
}
if (!items.length) { clearMergeSel(); return; }
if (items.length) items.push(null);
widthMenuItems(td).forEach(function (item) { items.push(item); });
e.preventDefault();
showContextMenu(e.clientX, e.clientY, items);
});
@@ -9872,6 +10438,7 @@
initMentionInbox();
initLiveRefresh();
initGlobalSearch();
initSideResize();
initScrollIndicators();
initHoverTips();
});
+98
View File
@@ -0,0 +1,98 @@
NanumSquare — Copyright 2016 NAVER Corporation. Font designed by Sandoll Communications Inc.
NanumSquareNeo — Copyright 2022 NAVER Corp. Font Designed by Sandoll Inc.
NanumSquareRound — Copyright 2017 NAVER Corporation. Font designed by Sandoll Communications Inc.
Original copyright notices embedded in the unmodified fonts are reproduced in the accompanying *.LICENSE.txt files.
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
## SIL OPEN FONT LICENSE
Version 1.1 - 26 February 2007
## PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
## DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
## PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
##TERMINATION
This license becomes null and void if any of the above conditions are
not met.
##DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
Copyright © 2022 NAVER Corp. All rights reserved. Font Designed by Sandoll Inc.
Binary file not shown.
@@ -0,0 +1,5 @@
Copyright ®œ 2016 NAVER Corporation. All rights reserved. Font designed by Sandoll Communications Inc.
NAVER Corporation
www.navercorp.com
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,5 @@
Copyright ®œ 2017 NAVER Corporation. All rights reserved. Font designed by Sandoll Communications Inc.
NAVER Corporation
http://www.navercorp.com
+94
View File
@@ -0,0 +1,94 @@
Copyright (c) 2021, Kil Hyung-jin (https://github.com/orioncactus/pretendard),
with Reserved Font Name Pretendard.
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
https://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file not shown.
+12
View File
@@ -0,0 +1,12 @@
# Project 웹폰트
Project 옵션에서 선택한 폰트만 브라우저가 불러옵니다. 외부 CDN 요청은 없으며 파일을 수정하지 않았습니다.
- Pretendard Variable 1.3.9: https://github.com/orioncactus/pretendard (SIL OFL 1.1, `Pretendard-LICENSE.txt`)
- NanumSquare / NanumSquareNeo / NanumSquareRound: https://campaign.naver.com/nanumsquare_neo/
네이버 공식 웹폰트 `https://hangeul.pstatic.net/hangeul_static/webfont/`에서 배포하는 원본.
각 폰트에 내장된 저작권 표기는 `*.LICENSE.txt`, OFL 1.1 전문은 `Nanum-OFL.md`에 포함했습니다.
OFL 본문 출처: https://github.com/naver/nanumfont/wiki/Open-Font-License
원본 문서의 NanumGothicCoding 저작권 머리글은 이 폴더에 포함된 세 폰트의 내장 저작권 정보로 바꾸고, 라이선스 본문은 그대로 두었습니다.
Regular / Bold / ExtraBold를 각각 제공하고, Pretendard는 100~900 가변 굵기를 제공합니다.
+82 -9
View File
@@ -9,9 +9,22 @@
목록(보기 탭, 예전 "리스트") · 캘린더(예전 "달력") · 수신함 · 첨부 파일 · 작업 링크 복사 ·
프로젝트 칸 + "다른 프로젝트에 추가"(예전 "연결된 프로젝트") · 담당자 없음(예전 "(미지정)").
"@태그"는 그대로 쓴다. 코드 식별자·DB 컬럼(`tasks`, `stage_id`, `task_followers` 등)과 코드 주석은 예전 이름 그대로다.
**도움말** — `/project/help`(`project/help.html` + `static/project-help.css`), 프로젝트 관리 화면 상단 바 로그아웃
**도움말** — `/project/help`(`project/help.html` + `static/project-help.css`·`static/project-help.js`), 프로젝트 관리 화면 상단 바 로그아웃
오른쪽 **?** 아이콘(`_help_btn.html`, `erp_base.html` 의 `topbar_after_logout` 블록)으로 새 탭에서 연다. 처음 쓰는 사람용
기능 설명 20장 — **화면 기능을 바꾸면 도움말도 같이 고친다.**
기능 설명 22장 — 목표·주간 회의록은 별도 장으로 진입·입력·지표 계산·쇼핑몰 연결·저장·삭제까지 설명한다.
도움말 검색은 실제 본문의 장·소제목으로 색인을 만들어 제목·본문을 한 글자부터 검색한다(띄어 쓴 단어는 모두 포함).
결과에 소제목·본문 일부와 일치 단어를 강조하고, 클릭 또는 Enter로 해당 소제목에 스크롤·포커스를 옮긴다.
`/`는 도움말 검색창, Esc·지우기는 초기화. 한글 조합 중에는 검색 이동을 하지 않는다.
검색어는 `?q=`, 읽는 위치는 `#소제목`으로 유지해 새로고침·공유·뒤로 가기에서도 복원한다. DB/API 호출 없이 동작한다.
검증: `python tests/js/render_help.py` 후 `node tests/js/help_ui.test.js`(jsdom),
`node tests/js/help.browser.test.js`(Playwright/Chromium — 실제 ERP 셸·390px 모바일·검색 이동·URL 복원).
**화면 기능을 바꾸면 도움말도 같이 고친다.**
**Project 옵션**(2026-10-02) — 도움말 오른쪽 톱니 버튼(`_options.html` 공통 include)이 native dialog를 연다.
현재 시스템 폰트(기본)·Pretendard Variable·NanumSquare·NanumSquareNeo·NanumSquareRound 중 선택하고 미리보기 → 저장 후 닫기.
`localStorage.pj_font`에 이 브라우저의 선택을 기억하며 모든 Project 화면에서 복원한다. 취소는 적용하지 않는다.
`project.css`의 `--pj-font`만 변경하므로 다른 ERP 화면은 영향을 받지 않으며 아이콘·코드 고정폭 폰트는 유지한다.
폰트는 `static/vendor/project-fonts/`에 원본·저작권/OFL을 함께 보관하고 `project-fonts.css`에서 선언한다(외부 CDN 없음).
저장 시 400/700 글꼴 로딩을 확인하고, 실패하면 이전 설정과 열린 창을 유지해 재시도할 수 있다.
**멤버 이름 표기** — 이메일 아이디의 첫 글자만 대문자(king → King). JS 는 `idOf(email)`/`capName(s)`,
템플릿은 `{{ nm[:1]|upper }}{{ nm[1:] }}` 로 화면에 그릴 때만 바꾼다(API `id`·DB 값은 그대로 — 멘션·검색은 이메일 기준).
**프로젝트 색상·아이콘(아사나식)** — 색상표는 32색(`store.COLOR_PALETTE`, 8칸×4줄 — 위 2줄은 아사나 프로젝트 16색, 아래 2줄은 같은 열의 진한 색. 진한 칸은 체크를 흰색 `.is-dark`. 새 프로젝트
@@ -45,6 +58,26 @@
## 1-1. 프로젝트 → 섹션 → 작업 (하위 작업 포함) 3단계 구조
**화면 조정(2026-10-03)** — 본문 좌우 여백 8px. 공용 왼쪽 메뉴 오른쪽 경계를 드래그해
170~500px로 조절(방향키도 지원, 더블클릭 기본값), `localStorage.pj_side_w`에 기억한다.
드래그 중에는 최신 마우스 위치를 화면 프레임당 한 번 반영하고, 목표 표 글 높이 등 전체 화면 재계산은
놓는 순간에 한 번만 실행한다. 창 포커스를 잃을 때도 마지막 위치를 저장하고 드래그를 종료한다.
수신함·내 작업 배지는 메뉴 이름 바로 옆에 표시. 댓글·답글 입력칸은 70px 고정 높이, 긴 글은 내부 스크롤.
전체 멤버는 메뉴 내부 폭 207px 이하에서는 3열, 그보다 넓으면 4열로 자동 재배치한다(container query).
각 멤버 칸은 최소 너비를 강제하지 않고 스크롤바용 여백 안에 맞추므로 오른쪽 멤버가 가려지지 않는다.
보드 그룹 머리의 왼쪽 화살표+세로선 아이콘은 그룹 축소, 축소 후 반대 방향 아이콘으로 펼치기.
축소 시 카드·추가 버튼을 숨기고 섹션 제목·작업 수를 세로로 표시하며
`localStorage['pj_board_fold:'+projectId]`에 섹션 id(전체 프로젝트 보기에서는 이름)별로 기억한다.
이 설정은 화면 표시만 바꾸므로 읽기 전용 사용자도 조절 가능하며 서버 작업·섹션 데이터는 변경하지 않는다.
목표 표 열 너비는 모든 행의 셀 오른쪽 경계에서 조절(병합 셀은 오른쪽 끝 열), 새 줄·병합·합계 재계산 뒤에도 유지.
경계를 더블클릭하면 그 열의 가장 긴 문단에 자동으로 맞춘다. 직접 넣은 줄바꿈은 유지하고 글꼴·크기·굵기·여백을
반영하며, 병합 칸은 다른 열 너비를 유지한 채 선택한 열만 맞춘다. 긴 문단은 드래그 최대 너비(600px)를 넘어도
맞추고 브라우저에 기억한다(이름 열도 자동 맞춤 가능). 현재 편집 중인 글·숫자도 내용 변경 없이 측정한다.
목표 업무 행 높이는 가장 높은 글 칸의 자연 높이에 맞춘다. 글·이름 칸 모두 위·아래 6px 여백과 상단 정렬을
사용하며, 글이 짧아지면 행도 줄어든다. 글이 한 줄이거나 비어 있으면 한 줄 높이만 확보하고 보기 전용도 같은 규칙이다.
목표 글자를 선택하면 해당 셀 상단 중앙을 기준으로 셀 위에 서식 도구가 표시되며, 색상은 지정된 12색 견본으로만 선택한다.
기존 글의 다른 색상은 보존. 글자 선택 해제·외부 클릭·편집 셀 제거 시 도구를 닫고 기존 부분 서식·자동 저장을 재사용한다.
**"섹션"은 새 개념이 아니라 기존 "단계"(칸반 컬럼)를 그대로 재사용한다** —
아사나도 보드 뷰의 컬럼과 목록 뷰의 구분선이 같은 "섹션" 하나다. DB
컬럼/테이블 이름(`project_stages`, `stage_id`)은 그대로 두고, 사용자에게
@@ -57,17 +90,29 @@
HTML5 DnD, `PUT /api/projects/{id}/stages/order` 재사용). "전체 프로젝트"
스코프(여러 프로젝트를 섹션 '이름'으로 합쳐 보는 예전 방식)에서는 섹션을
하나로 특정할 수 없어 관리 UI가 없다.
- **보드 빠른 작업 추가**(2026-10-02) — 하단 `+ 작업 추가`·섹션 메뉴에서
상세창 대신 보드 안에 이름·담당자·마감일 입력 카드가 열린다. Enter는 저장 후 연속 입력,
카드 밖 클릭은 저장 후 닫기, Esc·빈 카드 밖 클릭은 취소. 섹션 기본 담당자를 적용하고,
저장 실패 시 입력을 유지하며 저장 중 반복 제출을 막는다. 기존 작업 생성 API를 재사용한다.
**섹션 머리 `+`는 기존 오른쪽 작업 상세창**(`openTaskModal`)을 열어 제목·설명·담당자·우선순위·마감일을 설정한다.
- **하위 작업(subtask)** — 새 테이블이 아니라 `tasks.parent_task_id` 재사용
(부모 삭제 시 CASCADE). 작업 편집 팝업 안에 인라인으로 표시되며(체크박스+
제목+담당자+마감일, 한 줄에서 바로 저장), 보드/캘린더/목록에는 최상위
작업만 카드로 뜬다(하위 작업은 부모 카드의 "N ⤷ ▾" 토글로 — 누르면 아사나처럼 카드 아래로
하위 작업 목록(완료 체크·제목·마감·담당자)이 펼쳐진다. 펼친 상태는 페이지에 머무는 동안 유지).
섹션을 갖지 않는다(칸반에 안 보이므로).
펼친 하위 작업 한 줄을 다른 카드로 드래그하면 그 작업의 하위 작업으로 옮겨진다
펼친 하위 작업 한 줄을 같은 카드 안에서 위아래로 드래그하면 순서가 저장된다
(`PUT /api/tasks/{parent_id}/subtasks/order` `{ordered_ids}` — 작업 팝업과 같은 API).
보라색 선으로 삽입 위치를 표시하며 실패 시 기존 순서를 유지한다.
다른 카드로 드래그하면 그 작업의 하위 작업으로 옮겨진다
(`POST /api/tasks/{id}/move-parent` `{parent_task_id}` → `db.move_subtask`, 활동 `subtask_moved`).
받는 쪽은 **같은 프로젝트의 최상위 작업만**(순환 방지), 하위 작업의 하위 작업은 함께 따라간다.
**카드 크기·표지**(2026-10-02): 카드 높이 100px 고정(`.pj-card-head` height 86px = 100 − 아래 여백 12 − 테두리 2, 제목 2줄·
프로젝트 배지가 있으면 1줄까지, 담당자·날짜 줄은 맨 아래), 담당자 13.2px·아바타 20px·날짜 12.1px(기존 +10%).
**카드 완료 표시**: 제목 왼쪽 원형 체크 버튼(`.pj-card-check`, role=checkbox·aria-checked).
완료된 카드는 녹색 원 안 흰 체크 + 회색 제목으로 표시하며 취소선은 없다. 클릭하면 기존 작업 PUT `{completed}`로 완료/취소.
저장 중 중복 클릭을 막고 응답 후 카드·내 작업 개수를 갱신한다. 실패하면 상태를 유지해 재시도할 수 있다.
읽기 전용 작업은 비활성 체크로 상태만 표시하며 카드 높이·표지·하위 작업 펼침과 드래그 구조는 유지한다.
설명에 이미지가 있으면 **첫 이미지를 카드 위 표지**로(아사나, `cardCoverSrc` — template 로 읽어 이미지를 불러오지 않음,
우리 첨부·http(s)·data:image 만, 높이 140px object-fit cover). 표지·펼친 하위 작업은 100px 위·아래에 더해진다.
**하위 작업이 없는 카드**도 같은 모양의 빈 토글(⤷ ▾, `.pj-card-subtoggle.is-empty` — 카드에 마우스를 올리면 보임, 편집 권한자만)이
@@ -365,7 +410,7 @@ description 을 항상 HTML로 취급하기 때문). 두 번 실행하면 이중
댓글 입력칸은 아사나처럼 **창 맨 아래 고정**(`#pj-comment-dock`) — `.pj-modal-body` 바깥 형제라서
끝까지 스크롤해도 마지막 내용이 입력칸 위에서 멈춘다(sticky 아님). 새 작업(id 없음)이면 숨긴다.
댓글·댓글 대화창(`#pj-cm-input`)·답글 입력칸은 여러 줄 입력칸(`textarea.pj-composer-ta`) — **Enter = 등록, Shift+Enter = 줄바꿈**,
글 줄 수만큼 높이가 늘어난다(`fitComposer`, 최대 160px). 댓글 본문은 `white-space: pre-wrap` 이라 줄바꿈이 그대로 보인다.
입력칸 높이는 70px로 고정된다(`fitComposer`, 긴 글은 내부 스크롤). 댓글 본문은 `white-space: pre-wrap` 이라 줄바꿈이 그대로 보인다.
**설명란 이미지 더블클릭 → 별도 브라우저 창**(`openImageWindow`, 페이지 안 팝업 아님) — 창 크기 = 원본 크기(화면보다 크면 95%),
처음 원본 100%(창보다 크면 맞춤), 휠 = 커서 기준 확대·축소, 끌기 = 이동, 아래 막대 − / % / + · 1:1 · 맞춤, 더블클릭 = 원본↔맞춤,
키 + − 0 1 Esc. 팝업이 막히면 허용 안내 토스트.
@@ -513,7 +558,14 @@ description 을 항상 HTML로 취급하기 때문). 두 번 실행하면 이중
(`initGoalSide`, localStorage `pj_goal_open`, 목표 화면에선 항상 펼침). 연도 목록은 `router._goal_years_nav`
(`goal_years` 최근 연도 먼저 + **올해는 항상**, 013 미적용이면 올해만) — 사이드바를 그리는 모든 화면 컨텍스트에 `goal_years`.
- 연도를 누르면 `/project/goals/{연도}`(`goals.html`) — 스프레드시트 같은 한 표. 머리 줄(연간·1~12월)과 왼쪽 두 칸은 고정,
이번 달 열 강조. **가로 스크롤 때 3열(구분·항목·연간)까지 고정** — 연간 열 `position: sticky; left: 1열+2열 너비`, 경계 그림자. 월 칸 너비 85px·연간 90px(여백 포함, `box-sizing: border-box`), 머리·왼쪽 이름 가운데 정렬(왼쪽 이름은 세로도 가운데 — 관리자 도구는 칸 아래에 떠 있는 막대라 자리를 차지하지 않음). **모든 열**(구분·항목·연간·1~12월·상/하반기)은 머리 칸 오른쪽 끝을 끌어 너비 조절(더블클릭 = 기본 너비) — 브라우저별 localStorage `pj_goal_col_w`(키 `c1`·`c2`·`y`·`m1`~`m12`·`h1`·`h2`, 기본값과 다른 칸만 저장). 이름 두 칸은 48~320px·CSS 변수 `--goal-c1-w`·`--goal-c2-w`, 나머지는 40~600px·머리 칸의 `--cw`(table-layout: fixed 라 머리 칸 너비가 열 너비). 반기 접기 애니메이션의 월 칸 안쪽 고정 폭은 `--fold-w`(병합 칸 = 걸친 월 너비 합)로 JS 가 넣는다.
이번 달 열 강조. **가로 스크롤 때 3열(구분·항목·연간)까지 고정** — 연간 열 `position: sticky; left: 1열+2열 너비`, 경계 그림자.
월 칸 기본 너비 85px·연간 90px(여백 포함, `box-sizing: border-box`). 머리·왼쪽 이름은 가로 가운데 정렬이며,
업무 영역의 이름·글은 세로 상단 정렬, 위·아래 여백 각 6px이다. 행 높이는 가장 높은 글 칸에 맞추고 글이 줄면 함께 줄어든다.
**모든 열**(구분·항목·연간·1~12월·분기)은 모든 행의 셀 오른쪽 끝에서 끌어 너비 조절(더블클릭 = 가장 긴 문단에 맞춤).
브라우저별 localStorage `pj_goal_col_w`(키 `c1`·`c2`·`y`·`m1`~`m12`·`q1`~`q4`, 기본값과 다른 칸만 저장).
드래그는 이름 두 칸 48~320px·CSS 변수 `--goal-c1-w`·`--goal-c2-w`, 나머지 40~600px·머리 칸의 `--cw`로 조절한다.
자동 맞춤은 긴 문단에 맞게 최대 너비를 넘어도 저장·복원한다. 접기 애니메이션의 월 칸 안쪽 고정 폭은
`--fold-w`(병합 칸 = 걸친 월 너비 합)로 JS가 넣는다.
- **틀 고정** — 세로 스크롤에도 머리 줄 + 숫자 지표(매출·로아스) 줄까지 위에 붙어 있다. 지표 칸 `position: sticky` + 줄마다 `--kpi-top`(머리 줄 높이 + 앞 지표 줄 높이 합, `stickKpi`, 창 크기 바뀌면 다시 잼). z-index: 영역 이름 칸 2(마우스 올림 6) < 지표 칸 7 < 지표 이름 칸 8 < 머리 줄 9 < 머리 이름 칸 10.
- **숫자 지표** `goal_metrics`(year·metric `sales|roas`·kind `target|actual`·month 1~12·value NUMERIC(18,2)) —
매출 목표/실적/달성, 로아스 목표/실적. 매출 연간 = 월 합계, 달성률 = 실적÷목표(월별, **연간·반기는 그 기간 목표 합계 전체 대비 입력된
@@ -576,8 +628,9 @@ description 을 항상 HTML로 취급하기 때문). 두 번 실행하면 이중
애니메이션(`applyFold`): 접기 = `.is-shrunk`(칸 width·padding·테두리 → 0, `.is-folding` 동안만 transition .32s) 뒤
`.is-gone`(display:none), 펴기 = 거꾸로. 줄어드는 동안 칸 안 내용은 원래 폭(`85px × --span`)으로 고정해 잘라 내서 줄 높이가
출렁이지 않는다. **표는 `width: 1px` + `table-layout: fixed`** — fixed 는 표 너비가 auto 가 아닐 때만 먹는다(auto 면 칸 너비가
내용을 따라가 펼칠 때 애니메이션 없이 한 번에 튄다). 표는 칸 너비 합만큼 늘어난다. 접힌 칸의 글 칸 높이는 잴 수 없어(`fit` 이
`offsetParent` 없으면 건너뜀) 펼친 뒤 다시 잰다. `prefers-reduced-motion` 이면 애니메이션 없이.
내용을 따라가 펼칠 때 애니메이션 없이 한 번에 튄다). 표는 칸 너비 합만큼 늘어난다. contenteditable 글 칸은 고정 높이 없이
펼쳤을 때의 내용·너비로 자연 높이가 정해진다(예전 textarea는 숨겨져 있으면 측정을 건너뛰고 펼친 뒤 다시 잼).
`prefers-reduced-motion` 이면 애니메이션 없이.
- **영역·줄 이름 바로 수정**(관리자) — 이름(`[data-goal-edit="area|row"]`)을 누르면 contenteditable(`startNameEdit`) —
Enter·칸 떠남 = 저장, Esc = 취소, 붙여넣기는 글자만. 영역 이름 빈 값은 되돌림(서버도 400), 줄 이름은 빈 값 허용(빈 줄 이름은
마우스를 올리면 "줄 이름" 자리 표시). 예전 ✎(prompt) 버튼은 없앴다. 색·순서·줄 추가·삭제는 우클릭 메뉴(아래).
@@ -600,7 +653,7 @@ description 을 항상 HTML로 취급하기 때문). 두 번 실행하면 이중
또는 **Shift+클릭**(마지막으로 누른 칸부터). 범위가 병합된 칸에 걸치면 **엑셀처럼 그 칸 전체로 넓힌다**(`expand`). 칸 한 번 클릭은
그대로 입력. 다른 곳 누름·Esc = 해제.
- **우클릭**: "셀 병합 (N줄 × M칸)"(2칸 이상) · "병합 해제"(범위 안 병합된 칸, 여러 곳이면 개수). 범위 밖을 우클릭하면 그 칸만
고른 것으로(엑셀과 같음). 해당 메뉴가 없으면 브라우저 기본 메뉴. 묶음이 다른 가로 범위는 서버를 부르지 않고 안내.
고른 것으로(엑셀과 같음). 너비 자동 맞춤 메뉴도 함께 표시한다. 묶음이 다른 가로 범위는 서버를 부르지 않고 안내.
- `POST /api/goals/areas/{area_id}/merge {row_from, row_to(줄 id), col_from, col_to(칸 번호)}` → `db.merge_goal_rect`: 영역 FOR UPDATE,
걸친 병합 흡수(넓힌 뒤 묶음 다시 검사), 범위 안 글을 **왼쪽 위부터 줄·칸 순서대로 줄바꿈으로 이어 왼쪽 위 칸에**(글을 잃지 않게 —
엑셀은 왼쪽 위 값만 남기지만 여기선 잇는다), 나머지 칸 글·안쪽 병합은 지운다. 응답 `{row_id, start, span, row_span}`.
@@ -628,13 +681,33 @@ description 을 항상 HTML로 취급하기 때문). 두 번 실행하면 이중
(`POST /api/goals/rows/{첫 줄}/split-label` — 이어 붙은 줄들이 각자 빈 이름 항목 칸으로).
- 묶음 첫 줄 삭제 → 바로 아래 이어 붙은 줄이 첫 줄이 되고 이름이 비어 있으면 넘겨받음. 묶인 줄(첫 줄·이어 붙은 줄)과 바꾸는 ↑↓ 이동은 400
(나눈 뒤 이동), 묶음 첫 줄 도구 막대엔 ↑↓ 없음. 새 연도 만들기는 묶음도 복사한다.
- **칸 아무 곳이나 눌러 입력**(엑셀처럼) — 글 칸(textarea)은 글 높이만큼이라, 옆 칸 글이 길거나 세로 병합으로 칸이 길면 아래쪽을 눌러도
- **선택한 글자 서식**(관리자, 2026-10-02) — 목표 업무 영역 글 칸은 `.pj-goal-text[contenteditable]`.
같은 칸의 글자를 드래그해 선택하면 셀 상단 중앙을 기준으로 셀 위에 엑셀 형태 도구가 나타난다(여러 줄 글의 어느 줄을 선택해도 동일 위치).
아이콘은 처음 엑셀 형태 도구 크기의 80%이다. 밑에 현재 색상 선을 둔 `가`+드롭다운은 기존 12색 견본,
`가`+위/아래 화살표는 크기 2px 증감(10~32px, 혼합 크기는 조각마다 증감), 굵게·기울임·밑줄은 적용 상태가 보이는 토글 버튼.
서식 초기화는 구분선 뒤의 지우개 아이콘(14.4px)으로 표시하며 접근성 이름·도움말은 `서식 초기화`이다.
모든 버튼은 24px 높이, 서식 바는 위아래 여백 4px로 한 줄에서 34px 높이. 서식 초기화는 선택 범위의 모든 서식만 제거하며 글은 유지한다.
기존 `createFieldSaver`의 자동 저장·실패 재시도·임시 복구를 재사용한다.
`goal_cells.body` TEXT에 `pj-rich:v1:` + JSON 텍스트 조각 배열 `{text,bold?,italic?,underline?,color?,size?}`를 저장한다(추가 마이그레이션 없음).
평문은 기존 형식 그대로, `store.validate_goal_text`가 허용 서식과 보이는 글자 길이를 검사하고 `goal_text_html`이 글을 escape한 안전한 span만 만든다.
셀 병합은 각 조각 서식을 보존하고, 회의록 월간 계획 추출은 `goal_text_plain`으로 글만 읽는다.
- **칸 아무 곳이나 눌러 입력**(엑셀처럼) — 글 입력칸은 글 높이만큼이라, 옆 칸 글이 길거나 세로 병합으로 칸이 길면 아래쪽을 눌러도
입력이 안 됐다. 이제 업무 영역 글 칸(`td.pj-goal-texttd`)·회의록 글/금액 칸 아무 곳이나 누르면 그 칸 입력으로 들어가고 커서는 글 끝.
칸 전체가 글 입력 마우스 모양. Shift+클릭(범위 고르기)·끌기(병합 선택)는 그대로.
입력 중 테두리·밝은 배경도 입력칸이 아니라 **칸 전체**(`td:focus-within`, 회의록 표도 같음).
- **고른 칸 내용 지우기(엑셀 Del)** — 끌기·Shift+클릭으로 고른 범위에서 Del → 범위 안 글 칸을 비우고 칸마다 바로 저장, 안내 토스트.
바로 직전 지우기는 **Ctrl+Z** 로 되돌림(되돌린 값도 저장). 입력 중(글 칸에 커서)일 때의 Del·Ctrl+Z 는 평소 글자 편집.
우클릭 메뉴에도 "내용 지우기 (Del)"(`ink_eraser`, 고른 범위에 글이 있을 때).
- **우클릭 너비 자동 맞춤**(2026-10-03) — 목표 표의 이름·글·숫자·머리 칸 모두 "현재 열 너비 자동 맞춤" / "전체 열 너비 자동 맞춤"을 표시한다.
보기 전용 사용자도 사용 가능하며 너비는 브라우저에 저장한다. 현재 열은 경계 더블클릭과 같고, 병합 칸은 오른쪽 끝 열을 맞춘다.
전체 맞춤은 접힌 월 열도 포함해 각 열의 가장 긴 문단에 맞추고, 병합 글에 부족한 폭은 그 병합의 마지막 열에 더한다.
- **셀 테두리로 내용 이동**(관리자, 2026-10-03) — 업무 영역의 연간·월·분기 글 칸 하나를 클릭한 뒤 위·아래·왼쪽 테두리를 잡아
다른 글 칸에 놓으면 내용과 색·크기·굵게·기울임·밑줄을 옮긴다. 오른쪽 경계는 열 너비 조절용이다. 끄는 동안 대상 칸을 표시하고
표 가장자리에서는 자동 스크롤한다. Esc·창 포커스 해제·원본에 놓기는 취소한다. 대상에 글이 있으면 덮어쓰기를 확인한다.
병합 시작 칸의 글도 이동 가능하며 병합 배치·영역 색·열 너비는 유지한다. 연간·분기의 기본 글자 서식도 명시해 원본의 표시를 보존한다.
미저장 글을 먼저 저장한 후 `POST /api/goals/cells/move`로 두 칸을 한 트랜잭션에서 이동한다(추가 마이그레이션 없음).
일반 글 저장·병합과 영역 잠금을 공유하고 원본·대상 예상값을 비교한다. 다른 창의 수정·병합에 가려진 칸은 409로 중단한다.
성공 응답 뒤 원본을 비우며, 실패하면 두 칸의 화면 내용을 유지한다. 응답이 유실된 동일 요청 재시도는 완료 상태를 확인해 성공으로 반환한다.
- **우클릭 메뉴 아이콘** — `menuIcon(name)`(Material Symbols)을 `showContextMenu` 항목 `icon` 에: 위에 줄 추가 `add_row_above` ·
아래에 줄 추가 `add_row_below` · 줄 삭제 `delete`(빨강) · 셀 병합 `cell_merge` · 병합 해제 `call_split` · 항목 칸 나누기
`horizontal_split` · (회의록) 위로/아래로 `arrow_upward`/`arrow_downward` · 쇼핑몰 연결 `link` · 연결 안 함 `link_off` · 쇼핑몰 `storefront`.
@@ -0,0 +1,211 @@
main-app 목표관리·주간회의록: 버그 7개와 UI·UX 문제 2개 수정 요청
아래 9개 항목을 실제 코드에서 확인하고 수정해 주세요. 분석이나 수정 계획만 제시하지 말고, 구현·회귀 테스트·관련 문서 갱신까지 완료해 주세요. 기존 변경 사항과 사용자 데이터를 보존하고, 수정 완료 여부는 재현 테스트 결과로 증명해 주세요.
1. 작업 맥락과 범위
프로젝트: DBX ERP main-app, FastAPI / PostgreSQL / Jinja / JavaScript.
개발 PC 경로: G:\내 드라이브\프로젝트\Main-app
운영 서버 main-app 경로: /opt/www/main
작업 전 AGENTS.md를 확인하고 다음 문서를 순서대로 읽어 주세요.
- docs/PROJECT_OVERVIEW.md
- docs/SERVER_ARCHITECTURE.md
- docs/DATABASES.md
- docs/DEPLOYMENT.md
이어서 docs/PROJECT_MODULE.md와 관련 코드를 읽어 주세요.
기존 점검 보고서:
docs/reviews/GOALS_MEETINGS_REVIEW_2026-10-01.md
보고서의 기준 커밋은 21981eb입니다. 아래 줄 번호는 당시 기준이므로 현재 코드의 함수·동작을 기준으로 위치를 다시 찾아 주세요. 이미 해결된 항목은 중복 수정하지 말고, 해당 재현 테스트가 통과함을 확인해 주세요.
주요 파일:
- app/static/project.js
- app/static/project.css
- app/modules/project/router.py
- app/modules/project/db.py
- app/modules/project/store.py
- app/modules/project/templates/project/goals.html
- app/modules/project/templates/project/goal_meeting.html
- tests/test_project_module.py
- tests/js/project_ui.test.js 및 관련 테스트 도구
이번 작업은 9개 문제의 수정입니다. 무관한 전체 리팩터링이나 화면 재설계는 하지 마세요. 기존 자동 저장, 관리자 편집 권한, 분기 접기, 열 너비 조절, 스크롤 위치 유지, 셀 병합·해제, 항목 칸 묶음, 참석자 선택, 쇼핑몰 연결, 한글 입력을 유지해 주세요.
주차 규칙은 유지해 주세요: 1주차는 그 달 첫 월요일이 있는 주이며, 주는 월요일이 속한 달의 것입니다. 월간 목표·누적은 달의 1일~말일을 기준으로 합니다. 연간·분기 매출 달성률은 해당 기간 목표 합계 전체 대비 실적 합계입니다.
운영 DB나 운영 화면에서 재현을 위해 입력·생성·삭제하지 마세요. 로컬 테스트 대역 또는 운영과 분리된 테스트 DB를 사용하세요. 비밀값을 출력하거나 커밋하지 마세요. 파괴 명령·신규 DB 생성·운영 데이터 보정은 AGENTS.md의 승인 규칙을 따르세요. 이 요청에는 운영 배포나 운영 데이터 변경이 포함되지 않습니다.
2. 가장 먼저 수정할 저장 손실 버그 3개
[버그 1 / P1] 회의록 자동 저장이 아직 전송하지 않은 글을 저장 완료로 처리
위치: project.js의 initGoalMeeting() → queue(), flush(), flushAll(), beforeunload. 당시 약 9110행.
재현:
1) 같은 글 칸에 draft A를 입력하고 blur로 PUT을 시작합니다.
2) A 응답을 지연한 상태에서 draft B를 입력합니다.
3) A 응답을 완료하고 B의 800ms 자동 저장 시간을 기다립니다.
실제 관찰: 화면은 B, data-saved도 B, 서버는 A, PUT은 1회뿐입니다.
원인: await p.save(ta.value) 이후 바뀐 ta.value를 saved에 기록합니다.
수정 요구:
- 요청에 보낸 값과 현재 초안을 분리하고, 성공한 요청값만 저장 완료 기준으로 기록하세요.
- 같은 칸의 요청을 직렬화하거나 동등한 방법으로 오래된 요청이 최신 저장을 덮지 못하게 하세요. 클라이언트 응답만 무시하는 것으로 서버의 쓰기 순서 문제를 해결했다고 간주하지 마세요.
- 진행 중 새 입력이 생기면 최신 값이 뒤이어 저장되도록 하세요.
- 실패한 칸은 dirty 상태와 초안을 보존하고 재시도할 수 있어야 합니다.
- pending 타이머뿐 아니라 진행 중 저장도 flushAll이 기다려야 합니다.
- 페이지 이동·새로고침 과정에서도 미저장 상태를 잊지 마세요. beforeunload의 keepalive만으로 저장을 보장한다고 표현하지 마세요.
완료 기준:
- A 응답 전 B를 입력해도 최종 서버 값이 B입니다.
- 지연·중복 blur·빠른 연속 입력에도 최신 값이 남습니다.
- 저장 실패 후 페이지 이탈 시도에서 미저장 초안이 조용히 사라지지 않으며, 가능한 재전송·이탈 경고·초안 복구 등 구현한 보호 동작을 검증합니다.
[버그 2 / P1] 숫자 저장의 늦은 응답이 최신 입력을 덮음
위치: initGoals()의 숫자 change 처리(약 8229행), initGoalMeeting()의 금액 change 처리(약 9179행).
재현: 200 저장 응답을 지연한 동안 같은 입력창에 300을 입력하고, 그 후 200 응답을 완료하면 화면 값이 200으로 되돌아갑니다.
수정 요구:
- 응답이 도착해도 요청 이후 바뀐 최신 초안을 보존하세요.
- 서버의 정규화 값·쉼표 표기는 현재 초안이 해당 요청 이후 변경되지 않았을 때만 적용하세요.
- 실패 응답에서도 요청 이후 작성한 새 입력을 과거 saved 값으로 되돌리지 마세요.
- 목표 표 숫자, 회의록 정량 목표·지난주 결과, 금주 목표를 확인하세요. 금주 목표 저장의 전체 새로고침이 다른 칸의 미저장 글을 잃게 만들지 않도록 함께 검증하세요.
- 저장 순서와 초안 보호는 버그 1과 일관된 방식으로 처리하세요.
완료 기준: 늦은 200 응답 후에도 현재 초안 300이 유지되고, 사용자가 300을 확정하면 최종 서버 값도 300입니다. 응답 순서 역전·실패·빠른 재편집을 테스트하세요.
[버그 3 / P1] 글 저장 실패 후 표를 다시 그려 미저장 계획을 지움
위치: initGoals() → saveText(), flushTexts(), refreshTable(), 구조 변경·병합 호출부. 당시 약 8257 / 8386 / 8416행.
재현: 목표 칸에 unsaved important plan을 입력한 직후 업무 영역 추가를 실행합니다. 글 PUT은 503으로 실패하고 화면 GET은 기존 저장본을 반환하면, 새 글이 기존 original로 바뀝니다.
원인: saveText가 실패를 삼켜 flushTexts가 성공한 것처럼 끝나고, DOM 교체가 계속됩니다.
수정 요구:
- 실패를 상위 작업에 전달하고 초안을 유지하세요.
- 구조 변경·병합·해제·표 교체 전에 dirty 칸과 진행 중 저장을 실제로 완료하세요.
- 저장 실패 시 해당 구조 작업·DOM 교체를 중단하세요. 이미 시작된 구조 요청도 고려하여 순서를 조정하세요.
- flush 중 새로 입력한 글도 잃지 않도록 하세요.
- 목표 글 저장 역시 같은 칸의 오래된 요청이 최신 값을 덮는 문제를 방지하세요.
완료 기준: 글 PUT 실패 시 작성 내용이 남고 불필요한 표 교체가 발생하지 않습니다. 성공한 경우에만 영역·줄 추가/이동·병합 등이 정상 진행됩니다. 진행 중 저장과 실패를 각각 재현하세요.
3. 데이터 연결·표시 버그 4개
[버그 4 / P2] 회의록 생성 순서에 따라 지난주 연결이 빠짐
위치: ProjectStore.create_meeting(), get_meeting(), carry_from 처리. 당시 db.py 약 2524 / 2536행.
재현: 2026-09-28 주를 먼저 생성한 다음 2026-09-21 주를 생성합니다. 앞 주가 존재해도 9/28의 carry_from은 NULL로 남습니다.
운영 화면 관찰: 9/21과 9/28 모두 회의록 존재 점이 있고, 9/28의 24개 줄 중 data-prev가 있는 줄은 0개였습니다. 실제 운영 생성·삭제 이력은 확인하지 않았으며, 생성 순서는 동일한 상태를 만드는 확인된 원인입니다.
수정 요구:
- 회의록 생성 순서와 무관하게 대응 항목의 직전 주 리뷰를 연결할 수 있게 하세요.
- 이름 변경·동일 이름의 여러 줄·순서 변경·다른 구역의 같은 이름을 고려하세요. label만 비교해 임의로 첫 줄에 연결하지 마세요.
- 안정적인 항목 식별자 또는 기존 연결 구조를 안전하게 활용하는 방법을 선택하고 이유를 설명하세요.
- 연결이 불확실한 과거 데이터는 추정으로 다른 항목에 붙이지 마세요. 안전한 처리 기준을 문서화하세요.
- 필요하면 멱등 마이그레이션 파일을 작성하고 적용·검증 방법을 제공하세요. 운영 적용·운영 보정은 실행하지 마세요.
완료 기준: 정순 생성·역순 생성 모두 올바른 항목에 연결됩니다. 중복 이름·이름 변경·앞 주 삭제/재생성·새로 추가된 항목에서도 다른 줄의 결과가 섞이지 않습니다. 기존 데이터의 자동 복구 가능 범위와 제한을 명확히 보고하세요.
[버그 5 / P2] 다른 주의 결과를 지난주 날짜 아래 표시
위치: router.py의 _meeting_view() → it.prev 처리(약 2922행), goal_meeting.html의 지난주 리뷰 머리(약 190행).
재현: 9/28 회의록의 참조 줄이 9/7 회의록이면, 표 머리는 9/21~9/27이지만 결과와 달성률은 9/7~9/13 데이터를 사용합니다.
수정 요구:
- 버그 4의 연결 정책과 일치하도록 실제 리뷰 데이터 기간과 표시 기간을 맞추세요.
- 기본적으로 '지난주' 리뷰는 정확히 7일 전 주만 사용하세요. 직전 주가 없으면 지난주 자료 없음으로 표시하세요.
- 이전 회의록 양식·항목을 이어받는 기능은 유지할 수 있지만, 몇 주 전 결과를 지난주로 표시하거나 잘못된 주에 결과·평가를 저장하지 마세요.
- 더 이전 회의록 결과를 보여줄 필요가 있으면 별도 명칭과 실제 날짜를 명시하고 지난주 지표와 분리하세요.
완료 기준: 누락된 주·연말/연초·월 경계에서도 표 머리, 각 줄 결과·달성률, 머리 전주 목표가 모두 같은 실제 주를 의미합니다.
[버그 6 / P2] 실적 조회 장애를 매출 0원으로 표시
위치: router.py의 _perf_markets(), _perf_sum(), _meeting_view(). 당시 약 2849 / 2854 / 2901행.
재현: 실적 저장소 list_marketplaces()에서 예외를 발생시키면 월 누적·전주 결과·금주 결과가 모두 0이고 perf=true로 나옵니다.
수정 요구:
- 정상 조회 결과 0건, 설정된 쇼핑몰 없음, 실적 모듈 미연결, 목록 조회 실패, 매출 조회 실패를 구분하세요.
- 실적을 알 수 없을 때 0원·0%로 표시하거나 이를 이용해 주당 필요 매출을 계산하지 마세요.
- head.perf의 기존 용도와 템플릿 조건을 확인하고 필요하면 연결 여부·조회 성공 여부를 별도 상태로 관리하세요.
- 회의록은 계속 열리고 직접 입력도 사용할 수 있어야 합니다.
완료 기준: 실제 정상 무매출은 0으로 표시됩니다. 조회 장애는 미확인/조회 실패로 표시되고, 그 실적에 의존하는 달성률·필요 매출도 미확인입니다. 부분 실패 처리도 일관되게 테스트하세요.
[버그 7 / P2] 정량 목표 저장 후 이번주 달성률이 갱신되지 않음
위치: initGoalMeeting()의 금액 change 처리, .pj-meet-week-slot / .pj-meet-week-auto. 당시 약 9179행.
재현: 실적 100·목표 100·표시 100%인 행에서 목표를 200으로 저장하면 표시가 100%로 남습니다. 정상은 50%입니다.
수정 요구:
- 서버가 확정한 현재 목표와 현재 실적으로 비율을 즉시 갱신하세요.
- 0·빈 목표·실적 미확인·저장 실패를 구분하세요.
- 목표 저장과 백그라운드 실적 repaint가 겹쳐도 이전 비율이 다시 들어오지 않도록 하세요.
- 수정 중인 초안과 서버 확정값의 의미를 일관되게 표시하고, 다른 입력칸은 유지하세요.
완료 기준: 목표 100→200이면 100%→50%로 즉시 바뀝니다. 목표 0·삭제·실적 조회 실패·백그라운드 갱신과의 동시 실행을 테스트하세요.
4. UI·UX 문제 2개
[UX 8] 목표의 구역·항목 메뉴가 우클릭에만 있어 찾기·접근이 어려움
위치: project.js의 areaMenuItems(), rowMenuItems(), contextmenu 처리(약 8483 / 8560행), goals.html, project.css.
수정 요구:
- 기존 우클릭 메뉴는 유지하세요.
- 구역·항목에 작은 메뉴 진입점 또는 동등한 접근 수단을 제공하세요.
- 기존 사용자 요구로 제거한 큰 마우스오버 도구 막대를 그대로 복원하지 마세요. 이름 편집·열 너비·병합·분기 접기를 방해하지 않는 간결한 방식으로 구현하세요.
- Tab으로 접근, Enter/Space로 열기, Escape로 닫기, 닫은 뒤 포커스 복귀, 터치 클릭을 지원하세요.
- 메뉴 버튼에 명확한 접근성 이름을 제공하고 관리자에게만 편집 기능을 노출하세요.
완료 기준: 마우스 우클릭·키보드·터치로 동일한 메뉴 작업을 실행할 수 있고 표 레이아웃·고정 열이 깨지지 않습니다. 터치 검증을 못 했다면 완료했다고 쓰지 말고 미검증 범위를 보고하세요.
[UX 9] 매출 자동 갱신 실패와 자료 시점을 알 수 없음
위치: initMeetingSync()의 say()·catch(약 8860 / 8926행), goal_meeting.html의 hidden #pj-meet-sync(약 109행).
수정 요구:
- 기존 요구대로 정상 자동 갱신은 조용히 유지하세요. 항상 표시되는 큰 진행 상태 줄을 되살리지 마세요.
- 실패 시 최소한의 오류 안내와 재시도 수단을 제공하세요.
- 자료의 마지막 성공 갱신 시점 또는 확인 가능한 갱신 상태를 과장 없이 보여 주세요.
- 일부 쇼핑몰만 실패한 경우 전체 성공처럼 표시하거나 성공 시점을 부정확하게 기록하지 마세요.
- 권한 없음은 권한 없는 API를 반복 호출하지 않고 설명하며, 기존 10분 제한·중복 작업 합류 동작과 일관되게 처리하세요.
- 저장된 실적을 읽은 시점과 쇼핑몰에서 실제로 갱신에 성공한 시점을 혼동하지 마세요. 서버가 확인해 주지 않는 최신성을 브라우저 시각으로 만들어 표시하지 마세요.
완료 기준: 정상 시 조용한 화면, 실패 시 식별 가능한 안내·재시도, 부분 실패 시 정확한 상태가 확인됩니다. 재시도·갱신 중에도 편집 중인 글과 숫자가 보존됩니다.
5. 검증과 완료 보고
각 버그는 먼저 원래 실패 조건을 재현하고 수정 후 동일 조건이 통과하는 테스트를 남겨 주세요. 지연 응답·순서 역전·503·빠른 연속 입력은 테스트 대역으로 결정적으로 만들고, 정상 즉시 응답만 시험하지 마세요.
반드시 포함할 검증:
- 회의록 글 A→B 연속 입력과 늦은 A 응답
- 숫자 200 저장 중 300 재입력, 오래된 성공/실패 응답
- 저장 실패 후 dirty 초안 유지와 페이지 이탈 보호
- 진행 중 저장이 있는 상태의 구조 변경·새로고침·병합
- 역순 생성 회의록, 중복 이름, 이름 변경, 누락 주, 월·연도 경계
- 실적 목록 조회 장애, 매출 조회 장애, 정상 매출 0건
- 목표 변경 후 비율 및 백그라운드 repaint와의 동시 실행
- 관리자/읽기 전용 권한, 우클릭·키보드 메뉴, 정상/실패/부분 실패 갱신 안내
- 기존 분기 접기·고정 열·열 너비·병합·스크롤 유지·참석자·한글 입력에 대한 관련 회귀 확인
기존 테스트 실행 방식을 확인하고 이번 변경에 맞는 테스트를 실행하세요. 환경이 없어 실행하지 못한 통합 테스트를 통과했다고 보고하지 마세요. 관련 사용자 도움말과 docs/PROJECT_MODULE.md를 최종 구현에 맞게 갱신하세요. 환경변수를 추가한다면 예시 파일과 배포 문서도 갱신하세요.
완료 보고는 다음을 포함해 주세요.
1) 9개 항목별 수정 위치·최종 동작·검증 결과
2) 실제 실행한 테스트 명령과 결과, 실행하지 못한 검증
3) 필요한 마이그레이션과 운영 적용 전 확인 사항(운영 적용은 별도)
4) 과거 회의록 연결의 안전한 복구 가능 범위와 남은 제한
5) 변경 파일 목록과 UI 확인 결과
근거가 달라진 항목은 실제 코드와 테스트 결과를 설명하세요. 계획만 남기거나 일부 항목을 조용히 누락하지 말고, 승인된 로컬 수정과 검증을 끝까지 완료해 주세요.
@@ -0,0 +1,94 @@
# 클로드 수정 재검증 — 목표관리·주간회의록
검증일: 2026-10-01. 대상 커밋: `e1006c63de3b56f698138cf3674f5fbdde726c48`. 비교 기준: 최초 점검 커밋 `21981eb`.
## 판정
기존 9개 항목의 기본 동작은 대부분 개선됐다. 그러나 **초안 복구에서 입력이 영구적으로 사라지는 P1 문제가 재현돼 완전 해결로 판정할 수 없다.** 지난주 연결은 마이그레이션 018 적용이 필요하며, 기존에 연결 사슬 없이 만들어진 회의록은 018 적용만으로 복구되지 않는다. 운영 DB의 적용·복구 완료 여부는 이번 검증에서 확인하지 않았다.
기능 소스와 운영 데이터는 수정하지 않았다. 실제 운영 화면의 배포 상태·실제 터치 기기·화면 배치까지 검증한 결과는 아니다.
## 재현한 추가 문제
### P1 — 초안의 기준값이 서버값과 다르면 최신 입력과 백업을 삭제
위치:
- `app/static/project.js:271`: `d.base !== initial`이면 `localStorage.removeItem(...)` 후 복구하지 않는다.
- `app/static/project.js:304`: 요청에 보낸 원문을 저장 기준값으로 기록한다.
- `app/static/project.js:9488`: 회의록 글 저장 성공 시 서버가 실제 저장한 `res.item.content`를 기준값에 반영하지 않는다.
- `app/modules/project/store.py:627`: 실제 서버는 글의 앞뒤 공백을 `.strip()`으로 제거한다. 목표 글에도 같은 처리(`:476`)가 있다.
실제 `project.js`와 렌더된 회의록 템플릿을 jsdom에서 실행했다. 네트워크와 서버 저장만 대역으로 만들어 지연·장애를 주었으며, 서버의 공백 정규화와 같은 처리를 사용했다.
**재현 A — 정상 저장에서도 공백 때문에 충돌로 오판**
1. 기존 글 `original`에서 `A `를 입력하고 저장 요청을 보낸다(끝 공백 포함).
2. 응답 전에 `B - latest unsaved work`로 계속 입력한다.
3. 서버는 `A`를 저장하고 정상 응답한다. 브라우저 백업은 `{base: "A ", draft: "B - latest unsaved work"}`다.
4. B가 저장되기 전에 페이지를 닫았다가 서버의 A로 다시 연다.
5. 복구 코드가 `"A " !== "A"`를 충돌로 판단한다. 화면은 A만 남고 **B의 localStorage 백업도 삭제된다.**
관측 결과:
```json
{"server":"A","base":"A ","draft":"B - latest unsaved work","restored":"A","backupAfter":null}
```
**재현 B — 서버 저장 뒤 응답만 끊긴 경우**
1. A 저장 요청 중 B를 추가 입력한다.
2. 서버에는 A가 저장됐지만 응답에서 네트워크 오류가 발생한다.
3. 백업 기준값은 기존 `original`, 초안은 B다.
4. 다시 열면 서버 A와 기준값 original이 달라 충돌 처리되고, **B 백업이 삭제된다.**
```json
{"server":"A","base":"original","draft":"B - latest unsaved work","restored":"A","backupAfter":null}
```
페이지 이탈 경고가 있더라도 사용자가 닫거나 브라우저가 종료되는 경우를 보호하지 못한다. 자동 덮어쓰기를 막는 것은 적절하지만, 유일한 미저장 사본까지 삭제하면 복구 수단이 없어지는 것이 문제다. 목표 글도 같은 `createFieldSaver`와 공백 정규화를 사용하므로 동일한 경로의 위험이 있다(이번 직접 재현은 회의록 글).
수정 요구:
- 저장 기준값은 서버의 실제 저장값과 일치시킨다. 회의록 줄은 응답의 `item.content`, 다른 글 저장 API는 확정값 반환 또는 일관된 정규화가 필요하다. 최신 입력 B는 보존한다.
- 충돌한 초안은 지우지 말고 별도 복구 대상으로 남긴다. 현재 서버값과 초안을 확인하고 복사·복원할 수 있어야 한다.
- 저장됐지만 응답을 잃은 경우에도 백업을 보존한다. 확인되지 않은 자동 덮어쓰기는 피한다.
- 위 두 시나리오를 목표 글·회의록 글·메모에 추가한다. 서버값 유지와 최신 초안 복구 가능성을 각각 검증한다.
## 기존 9개 항목별 결과
| 번호 | 최초 문제 | 재검증 결과 |
|---|---|---|
| 1 | 저장 중 추가 입력을 저장 완료로 오판 | 기본 A→B 저장·같은 칸 직렬화·실패 표시·재시도는 통과. 다만 위 P1 초안 복구 유실을 추가 수정해야 한다. |
| 2 | 숫자의 늦은 응답이 새 입력을 덮음 | 통과. 목표 숫자·회의록 목표·결과 입력 모두 새 초안 보존, 순차 저장 확인. |
| 3 | 글 저장 실패 뒤 구조 변경으로 입력 유실 | 기본 시나리오 통과. 실패하면 영역 추가·병합·표 교체 중단, 표 GET 중 새 글도 보호. |
| 4 | 회의록 역순 생성 시 지난주 미연결 | 조건부. 018 적용 상태의 새 데이터는 실제 저장소 메서드 대역 실행에서 연결 확인. 미적용 상태는 여전히 미연결. 기존 독립 사슬 데이터는 별도 복구가 필요하다. |
| 5 | 몇 주 전 자료를 직전 주 자료로 표시 | 통과. 저장소가 정확히 7일 전 주만 조회하며, 그 주가 없으면 리뷰를 비운다. 중간 주를 만들면 해당 주 자료로 연결. |
| 6 | 실적 조회 장애를 0원으로 표시 | 통과. 목록 장애·매출 장애에서는 None/미확인, 정상 0건만 0원. 의존하는 필요 매출·달성률도 구분. |
| 7 | 정량 목표 변경 뒤 이번주 실적 % 미갱신 | 통과. 목표 100→200이면 실적 100 기준 100%→50%, 0·빈칸 처리, 실패 시 확정 목표 기준 유지. |
| 8 | 목표 조작이 우클릭에만 존재 | DOM·이벤트 검증 통과. 메뉴 버튼·키보드 이동·Esc·포커스 복귀 확인. 실제 터치·배치·입력기는 별도 확인 필요. |
| 9 | 매출 갱신 실패·자료 시점이 보이지 않음 | 기본 시나리오 통과. 전체/부분 실패 안내·재시도·서버 갱신 시각·권한 없는 경우 호출 차단 확인. |
### 4번 완료 조건
`scripts/sql/project_db_018_meeting_line_keys.sql`은 기존 `carry_from` 사슬을 공유하는 줄에 같은 키를 준다. 두 주가 각각 양식으로 만들어져 `carry_from=NULL`인 경우에는 각자 다른 키를 받으므로 **마이그레이션만으로 서로 연결되지 않는다.** 이는 SQL 주석과 프로젝트 문서에도 명시돼 있다.
`project_db_018b_meeting_line_link_candidates.sql`은 후보 조회만 수행한다. 사람이 같은 항목임을 확인하고 별도 연결해야 한다. 최초 운영 관찰에서 발견한 9/21·9/28 미연결 자료가 실제 복구됐는지까지 확인해야 4번을 완료로 볼 수 있다. 현재 검증에서 운영 데이터가 여전히 미연결이라고 단정하지는 않는다.
이름만으로 무조건 연결하는 방식은 중복 이름·새 항목의 결과를 섞을 수 있어 적절하지 않다. 검증된 쌍만 연결하고, 후속 주 연결까지 확인한다.
## 검증 기록과 한계
| 검증 | 결과 |
|---|---|
| `python tests/js/render_goals.py` + `node tests/js/goals_meeting_ui.test.js` | **106개 assertion 통과**, exit 0, ALL PASS |
| `python tests/js/render_project.py` + `node tests/js/project_ui.test.js` | **51개 assertion 통과**, exit 0, ALL PASS |
| 별도 경계 조건 스크립트 `verify_claude_edges.cjs` | 위 공백·응답 유실 상황에서 최신 초안과 백업 삭제 재현 |
| 별도 저장소·라우터 대역 실행 `verify_claude_backend.py` | 역순 생성(018 적용/미적용), 날짜 공백, 중간 주 연결, 실적 장애/실제 0, 기존 독립 키 미연결 **8개 확인 통과** |
| Python 변경 파일 문법 컴파일 | 통과 |
| `python tests/test_project_module.py` | **SKIP** — 로컬 `PROJECT_TEST_DB_URL` 미설정 |
| `python tests/test_meeting_line_keys_migration.py` | **SKIP** — 같은 이유. 실제 PostgreSQL에서 018 적용·멱등성·제약조건은 미검증 |
별도 재현 스크립트는 `%TEMP%/main-app-goals-review-20261001/`에 있다. 백엔드 대역 실행은 실제 `ProjectStore.create_meeting/get_meeting`과 `_meeting_view`를 실행하되 DB 연결·SQL 결과를 메모리로 대체했다. **SQL 자체의 실행 검증을 대신하지 않는다.** UI 테스트는 실제 프로젝트 JS·템플릿을 사용하지만 가짜 HTTP 응답 기반이며 실제 브라우저 렌더링 검증을 대신하지 않는다.
현재 판단: 수정 방향과 기본 검증은 타당하다. **초안 유실 P1을 고치고, 018 실DB 검증 및 기존 미연결 회의록 복구 확인을 마친 뒤 완료 판정**하는 것이 적절하다.
@@ -0,0 +1,79 @@
# 목표관리·주간회의록 점검 — 2026-10-01
대상: 로컬 HEAD `21981eb`, `app/modules/project/`의 목표·회의록 저장/조회, `app/static/project.js`, 두 화면 템플릿. 실제 Chrome 운영 화면은 읽기 전용으로 관찰했다. 기능 코드·운영 DB·환경변수는 수정하지 않았다.
확인 결과: **기능 버그 7개, UI·UX 문제 2개**. P1은 입력 손실 때문에 우선 수정, P2는 데이터 연결·표시 정확도 수정이다. UI·UX 항목은 개선 제안으로 구분한다.
| 번호 | 우선순위 | 위치 | 문제와 수정 방향 |
|---|---|---|---|
| 1 | P1 | `app/static/project.js:9110` | 회의록 자동 저장 응답에서 요청 당시 글 대신 현재 입력값을 `saved`로 기록한다. 미전송 글이 저장됐다고 간주되어 다음 저장을 생략한다. 요청값을 캡처하고 칸별 저장 순서·최신 입력을 관리한다. |
| 2 | P1 | `app/static/project.js:8229`, `9179` | 숫자 저장의 늦은 응답이 사용자가 다시 입력 중인 값을 덮는다. 목표 표 숫자와 회의록 정량 목표·결과 입력에 같은 구조가 있다. 응답은 요청값이 현재 초안과 일치할 때만 입력창에 반영한다. |
| 3 | P1 | `app/static/project.js:8257`, `8386`, `8416` | 목표 글 저장 실패를 함수 내부에서 삼켜 구조 변경이 계속된다. 표를 다시 그리면 미저장 글이 사라진다. 저장 실패를 상위 작업에 전달하고, 모든 변경·진행 중 저장을 완료하기 전 DOM 교체·병합을 막는다. |
| 4 | P2 | `app/modules/project/db.py:2524`, `2536` | 다음 주 회의록을 먼저 만들고 앞 주를 나중에 만들면 기존 다음 주의 `carry_from`을 연결하지 않는다. 실제 운영 화면에도 앞 주 존재 표시와 다음 주 리뷰 미연결이 동시에 있다. 안정적인 항목 연결키를 두고 생성 순서와 무관하게 전주 연결을 처리한다. |
| 5 | P2 | `app/modules/project/router.py:2922`, `app/modules/project/templates/project/goal_meeting.html:190` | 한 주 이상 건너뛰면 가장 가까운 과거 회의록의 줄을 읽으면서 표 머리는 무조건 직전 주 날짜를 표시한다. 다른 주의 목표·결과·달성률을 지난주 수치로 오인한다. 실제 참조 주를 표시하거나 직전 주가 없으면 리뷰를 비운다. |
| 6 | P2 | `app/modules/project/router.py:2849`, `2854`, `2901` | 쇼핑몰 목록 조회 장애를 빈 목록으로 바꿔 매출 합계를 0원으로 표시한다. 저장소 객체만 있으면 연결 여부도 참이다. 조회 실패와 실제 0건을 구분해 장애 시 지표를 미확인으로 표시한다. |
| 7 | P2 | `app/static/project.js:9179` | 이번주 정량 목표 저장 뒤 `pj-meet-week-slot`의 목표 대비 %를 갱신하지 않는다. 이번주 실적 표시를 보관해 목표 변경 후 즉시 재계산한다. |
| 8 | UX | `app/static/project.js:8483`, `8560`, `app/modules/project/templates/project/goals.html` | 목표 구역·항목의 색·순서·줄 추가·삭제가 우클릭 메뉴에만 있다. 키보드로 이름 칸에 접근할 수 없고 터치 대안도 없어 기능을 찾고 실행하기 어렵다. 이름 칸에 포커스 가능한 메뉴 버튼이나 키보드·터치 진입점을 제공한다. |
| 9 | UX | `app/static/project.js:8860`, `8926`, `app/modules/project/templates/project/goal_meeting.html:109` | 매출 자동 갱신 실패 메시지도 숨은 상태 요소에만 전달되어 사용자는 실패·자료 시점을 알 수 없다. 정상 갱신은 조용히 유지하되 실패 안내와 마지막 성공 시점·재시도 진입점을 제공한다. |
## 재현 근거
### 1. 회의록: 저장되지 않은 글을 저장됨으로 처리
실제 `project.js`를 jsdom에서 실행하고 PUT 응답만 지연했다.
1. `draft A`를 입력하고 칸을 떠나 저장 요청을 보낸다.
2. 요청이 끝나기 전에 같은 칸에 `draft B`를 입력한다.
3. A의 저장 응답을 완료하고 B의 자동 저장 대기 시간 800ms가 지나도록 기다린다.
관찰 결과: **화면 B, `data-saved` B, 서버 A, PUT 1회**. 두 번째 글은 서버에 보내지지 않았다. `flush()`가 `await p.save(ta.value)` 뒤 바뀐 `ta.value`를 저장 완료 값으로 기록하기 때문이다.
추가 실패 시나리오: 저장을 503으로 실패시킨 뒤 `beforeunload`를 발생시키면 요청은 실패한 PUT 한 번뿐이었다. `pending`에서 먼저 지운 칸은 페이지 이탈 저장에도 포함되지 않는다. 실패한 초안을 계속 dirty 상태로 보관해야 한다.
### 2. 숫자: 이전 저장 응답이 최신 입력을 덮음
목표 숫자 200의 저장 응답을 지연한 동안 같은 입력창을 300으로 바꾸고, 그 후 200 응답을 완료했다.
관찰 결과: **현재 입력 300 → 200**. 사용자 초안이 이전 요청 응답으로 바뀌었다. 회의록 금액 저장도 응답값을 무조건 입력창에 대입하는 동일한 방식이다.
### 3. 목표 표: 저장 실패 후 구조 새로 그리기로 글 손실
목표 칸에 `unsaved important plan`을 입력한 직후 업무 영역 추가를 실행했다. 글 PUT은 503으로 실패, 화면 GET은 기존 저장본을 반환하도록 했다.
관찰 요청 순서: 영역 POST → 글 PUT(503) → 화면 GET. 최종 textarea는 **미저장 계획 → 기존 `original`**로 돌아갔다. 오류 토스트가 떠도 편집 글 자체가 사라진다. `saveText()`가 실패를 다시 던지지 않아 `flushTexts()`가 성공한 것처럼 끝난다.
### 4. 회의록 생성 순서에 따른 전주 연결 누락
실제 `ProjectStore.create_meeting()`을 호출하되 SQL 실행만 메모리 대역으로 바꿨다. 실제 DB에는 접속하지 않았다.
재현: 9/28 주 생성 → 9/21 주 생성. 결과: 앞 주 회의록은 존재하지만 9/28 줄의 **`carry_from`은 NULL**로 남았다.
운영 화면 관찰: 2026년 9월 화면에서 **9/21·9/28 모두 회의록 존재 점이 있으며, 선택된 9/28 주의 24개 줄 중 `data-prev`가 있는 줄은 0개**였다. 실제 운영 데이터가 이 상태에 이른 생성·삭제 이력은 확인하지 않았다. 생성 순서는 같은 상태를 만드는 확인된 원인이다.
### 5. 주차를 건너뛰었을 때 리뷰 기간 불일치
실제 `_meeting_view()`에 9/28 회의록의 참조 줄이 9/7 회의록인 데이터를 전달했다.
관찰 결과: 표 머리에 사용할 지난주 날짜는 **9/21~9/27**, 실제 줄의 결과 기간은 **9/7~9/13**, 그 다른 주의 목표 100·결과 50을 사용한 달성률 **50%**가 나온다. 머리의 전주 목표는 정확히 직전 주인지 검사하지만 줄은 검사하지 않는다.
### 6. 조회 장애가 실제 매출 0원처럼 표시
실적 저장소 대역의 `list_marketplaces()`에서 예외를 발생시켰다.
관찰 결과: **월 누적 0, 전주 결과 0, 금주 결과 0, `perf=true`**. 월 목표 1,000원인 재현 데이터에서 필요 매출도 1,000원으로 계산됐다. 장애로 실적을 못 읽은 상태와 실제 무매출을 구분하지 못한다.
### 7. 목표 변경 뒤 이번주 달성률 미갱신
실제 회의록 JS에 현재 실적 100·목표 100·표시 100%인 행을 전달하고 목표를 200으로 저장했다.
관찰 결과: **목표 200, 이번주 실적 100, 표시 100% 유지**. 올바른 표시는 50%다. 입력 금액만 바꾸고 아래 실적 비율은 재계산하지 않는다.
## 검증 범위와 우선순위
- JS는 실제 전체 `app/static/project.js`를 실행했다. DOM·API는 로컬 테스트 대역이며 운영 화면에는 입력·생성·삭제를 실행하지 않았다.
- Python은 실제 조회 함수·생성 메서드를 호출하고 DB·실적 저장소를 대역으로 바꿨다. 실제 PostgreSQL 통합 테스트는 실행하지 않았다.
- 총 8개 재현 시나리오를 실행했다(위 7개 버그 + 저장 실패 후 페이지 이탈 시나리오). 레이아웃은 실제 Chrome 화면으로 확인했으며 모바일·인쇄는 미검증이다.
- 재현 스크립트는 개발 PC `%TEMP%/main-app-goals-review-20261001/`에 `review_ui.cjs`, `review_backend.py`, `review_rate.cjs`로 보관했다. jsdom도 그 임시 폴더에 설치했다. 저장소 의존성 파일은 변경하지 않았다.
- 수정 순서: **칸별 저장 큐·요청값/초안 분리 → 실패 시 초안 보존·구조 변경 중단 → 전주 연결/날짜 정합성 → 실적 장애 구분·달성률 갱신 → 메뉴 접근성과 갱신 실패 안내**.
이 보고서는 발견·재현 결과이며 수정 완료 보고서가 아니다.
+24
View File
@@ -25,3 +25,27 @@ node tests/js/goals_meeting_ui.test.js # jsdom 필요(npm install jsdom
```
실제 브라우저 레이아웃·입력기·터치 기기는 아니다(그건 헤드리스 크롬으로 따로 확인).
목표 열 자동 맞춤은 실제 Chromium에서도 검증한다. 로컬 테스트 HTML·프로젝트 CSS/폰트를 사용하며 운영 서버·DB에 연결하지 않는다.
부분 서식과 셀 여백, 명시적 줄바꿈, 75% 배율, 600px를 넘는 긴 문단, 저장된 너비 복원을 확인한다.
행 높이는 3줄/2줄 셀의 상단 정렬·같은 위아래 여백, 한 줄로 줄였을 때 높이 축소, 큰 글씨, 보기 전용 화면까지 확인한다.
실제 마우스로 셀 테두리를 끌어 내용·부분 서식을 이동하고, 지연 응답 동안 원본을 유지하는지 확인한다.
우클릭 현재/전체 열 자동 맞춤은 접힌 월 열의 측정·너비 저장도 검증한다. jsdom에서는 저장 실패·409 충돌·덮어쓰기 취소·Esc 취소를 추가로 확인한다.
```powershell
python tests/js/render_goals.py
# playwright 설치 또는 NODE_PATH로 기존 설치 지정
$env:PJ_TEST_BROWSER = 'C:/Program Files/Google/Chrome/Application/chrome.exe'
node tests/js/goals_autofit.browser.test.js
```
`PJ_TEST_BROWSER`를 생략하면 Playwright에 설치된 기본 Chromium을 사용한다.
셀 이동 API의 권한·예상값 충돌·트랜잭션 롤백·응답 유실 재시도는 DB 없이 실행할 수 있다.
```bash
python -m unittest discover -s tests -p test_project_goal_move.py
```
실제 PostgreSQL 이동·동시 요청 검증은 `python tests/test_project_module.py`에 포함된다.
`PROJECT_TEST_DB_URL`에 기존 로컬 테스트 DB를 지정해야 하며, 미설정 또는 로컬 주소가 아니면 건너뛴다.
+273
View File
@@ -0,0 +1,273 @@
// 실제 Chromium + 프로젝트 CSS/폰트로 열 자동 너비를 검증한다(운영 서버·DB 미사용).
// python tests/js/render_goals.py
// NODE_PATH=<playwright가 있는 node_modules> node tests/js/goals_autofit.browser.test.js
// 설치된 Chrome 사용 시 PJ_TEST_BROWSER=<chrome 실행 파일 경로> 지정.
const assert = require("node:assert/strict");
const fs = require("node:fs");
const http = require("node:http");
const path = require("node:path");
const { chromium } = require("playwright");
const ROOT = path.resolve(__dirname, "../..");
const STATIC = path.join(ROOT, "app/static");
const server = http.createServer(function (req, res) {
const url = new URL(req.url, "http://localhost");
if (url.pathname === "/project/goals/2026") {
const fixture = url.searchParams.has("readonly") ? "goals_ro.html" : "goals_admin.html";
const html = fs.readFileSync(path.join(__dirname, ".out", fixture), "utf8")
.replace("<body>", '<body style="font-family:var(--pj-font)"><div class="erp-app">')
.replace("</body>", "</div></body>");
res.setHeader("Content-Type", "text/html; charset=utf-8"); res.end(html); return;
}
if (url.pathname.startsWith("/project/api/")) {
res.setHeader("Content-Type", "application/json"); res.end("{}"); return;
}
const file = path.resolve(STATIC, "." + decodeURIComponent(url.pathname.slice(7)));
if (!url.pathname.startsWith("/static/") || !file.startsWith(STATIC + path.sep) || !fs.existsSync(file) || !fs.statSync(file).isFile()) {
res.statusCode = 404; res.end(); return;
}
const types = { ".css": "text/css", ".js": "text/javascript", ".woff2": "font/woff2", ".woff": "font/woff" };
res.setHeader("Content-Type", types[path.extname(file)] || "application/octet-stream");
fs.createReadStream(file).pipe(res);
});
(async function () {
let browser;
try {
await new Promise(function (resolve) { server.listen(0, "127.0.0.1", resolve); });
browser = await chromium.launch({ headless: true, executablePath: process.env.PJ_TEST_BROWSER || undefined });
const page = await browser.newPage({ viewport: { width: 1600, height: 1000 } });
const errors = [], writes = [];
page.on("pageerror", function (e) { errors.push(e.message); });
page.on("request", function (r) { if (r.method() !== "GET") writes.push(r.url()); });
await page.goto("http://127.0.0.1:" + server.address().port + "/project/goals/2026");
await page.evaluate(async function () {
await document.fonts.ready;
const a = document.querySelector('.pj-goal-text[data-row="10"][data-month="1"]');
const b = document.querySelector('.pj-goal-text[data-row="11"][data-month="1"]');
a.value = "다담: 100 백만(김지통)\n주부콩: 20백만(김지통)";
b.value = "pj-rich:v1:" + JSON.stringify([{ text: "가장 긴 문단: 글자 크기와 굵기도 반영", size: 32, bold: true }, { text: " 끝" }]);
window.autofitDraft = b.value;
document.getElementById("pj-goal-pane").scrollTop = 0;
});
async function fit(key) {
await page.locator('thead .pj-goal-colresize[data-col="' + key + '"]').dblclick();
}
async function widths() {
return page.evaluate(function () {
const td = document.querySelector('.pj-goal-text[data-row="11"][data-month="1"]').closest("td");
const head = document.querySelector('thead th[data-col="m1"]');
return { logical: parseFloat(head.style.getPropertyValue("--cw")), cell: td.getBoundingClientRect().width,
zoom: document.documentElement.classList.contains("pj-ui-scale") ? 0.75 : 1 };
});
}
await fit("m1");
const rich = await widths();
const expected = await page.evaluate(function () {
const td = document.querySelector('.pj-goal-text[data-row="11"][data-month="1"]').closest("td");
const editor = td.querySelector(".pj-goal-text"), ctx = document.createElement("canvas").getContext("2d");
let textWidth = 0;
Array.from(editor.childNodes).forEach(function (node) {
const style = getComputedStyle(node.nodeType === 1 ? node : editor);
ctx.font = style.fontWeight + " " + style.fontSize + " " + style.fontFamily;
textWidth += ctx.measureText(node.textContent).width;
});
const cellStyle = getComputedStyle(td), style = getComputedStyle(editor);
return textWidth + parseFloat(style.paddingLeft) + parseFloat(style.paddingRight) + parseFloat(cellStyle.borderRightWidth);
});
assert(rich.logical >= expected && rich.logical <= expected + 4, JSON.stringify({ rich, expected }));
assert(Math.abs(rich.cell - rich.logical) < 1, "실제 셀 너비와 지정한 너비 일치");
assert(await page.evaluate(function () { return document.querySelector('.pj-goal-text[data-row="11"][data-month="1"]').value === window.autofitDraft; }));
console.log("PASS rich text, actual font geometry, preserved draft");
await page.evaluate(function () {
document.querySelector('.pj-goal-text[data-row="11"][data-month="1"]').value = "짧음";
});
await fit("m1");
const plain = await widths();
assert(plain.logical < rich.logical, "짧은 문단으로 바꾸면 너비 축소");
const lineRects = await page.evaluate(function () {
const editor = document.querySelector('.pj-goal-text[data-row="10"][data-month="1"]');
const range = document.createRange(); range.selectNodeContents(editor);
return Array.from(range.getClientRects()).filter(function (r) { return r.width > 0; }).map(function (r) { return r.top; });
});
assert.equal(new Set(lineRects).size, 2, "명시적 두 문단은 각각 한 줄로 표시");
await page.evaluate(function () { document.documentElement.classList.add("pj-ui-scale"); });
await fit("m1");
const zoomed = await widths();
assert(Math.abs(zoomed.logical - plain.logical) <= 1, JSON.stringify({ plain, zoomed }));
assert(Math.abs(zoomed.cell / zoomed.zoom - zoomed.logical) < 1);
console.log("PASS explicit paragraphs, shrink to fit, 75% zoom");
await page.evaluate(function () {
document.documentElement.classList.remove("pj-ui-scale");
document.querySelector('.pj-goal-text[data-row="10"][data-month="1"]').value = "길이가 아주 긴 목표 문단 ".repeat(20);
});
await fit("m1");
const large = await widths();
assert(large.logical > 600);
// 새로고침 때 기존 beforeunload 보호가 수정한 초안을 저장하는 것은 별도 동작이다.
assert.deepEqual(writes, [], "자동 맞춤 자체는 쓰기 요청 없음");
await page.reload();
assert.equal((await widths()).logical, large.logical);
assert.equal(await page.locator(".pj-goal-autofit-measure").count(), 0);
assert.deepEqual(errors, []);
console.log("PASS long paragraph beyond 600px, persisted width, no writes/errors");
const mergedPage = await browser.newPage({ viewport: { width: 1600, height: 1000 } });
await mergedPage.addInitScript(function () {
document.addEventListener("DOMContentLoaded", function () {
const editor = document.querySelector('.pj-goal-text[data-row="10"][data-month="1"]');
const td = editor.closest("td");
td.colSpan = 2; td.dataset.span = "2"; td.nextElementSibling.remove();
editor.textContent = "병합한 셀에서도 다른 열은 그대로 유지하고 가장 긴 문단에 맞춰 줍니다";
});
});
await mergedPage.goto("http://127.0.0.1:" + server.address().port + "/project/goals/2026");
const before = await mergedPage.locator('thead th[data-col="m1"]').evaluate(function (th) { return th.style.getPropertyValue("--cw"); });
await mergedPage.locator('tbody.pj-goal-area [data-row-id="10"] .pj-goal-colresize[data-col="m2"]').dblclick();
const merged = await mergedPage.evaluate(function () {
const a = document.querySelector('thead th[data-col="m1"]'), b = document.querySelector('thead th[data-col="m2"]');
const editor = document.querySelector('.pj-goal-text[data-row="10"][data-month="1"]');
const range = document.createRange(); range.selectNodeContents(editor);
return { first: a.style.getPropertyValue("--cw"), last: parseFloat(b.style.getPropertyValue("--cw")),
actual: editor.closest("td").getBoundingClientRect().width,
lines: Array.from(range.getClientRects()).filter(function (r) { return r.width > 0; }).length };
});
assert.equal(merged.first, before);
assert.equal(merged.lines, 1, JSON.stringify(merged));
assert(Math.abs(merged.actual - parseFloat(before) - merged.last) < 1, JSON.stringify(merged));
console.log("PASS merged cell mapping, one unwrapped paragraph, other column unchanged");
await mergedPage.close();
for (const readonly of [false, true]) {
const heightPage = await browser.newPage({ viewport: { width: 1600, height: 1000 } });
await heightPage.addInitScript(function () {
document.addEventListener("DOMContentLoaded", function () {
const row = document.querySelector('tr[data-row-id="10"]');
row.querySelector('td[data-month="0"] > div').textContent = "첫 번째 줄\n두 번째 줄\n세 번째 줄";
row.querySelector('td[data-month="1"] > div').textContent = "첫 줄\n둘째 줄";
});
});
await heightPage.goto("http://127.0.0.1:" + server.address().port + "/project/goals/2026" + (readonly ? "?readonly=1" : ""));
await heightPage.evaluate(function () {
// 세 줄은 열 폭에 의해 추가로 접히지 않도록 연간 열만 넓힌다.
const h = document.querySelector('thead .pj-goal-colresize[data-col="y"]');
h.dispatchEvent(new MouseEvent("dblclick", { bubbles: true, cancelable: true }));
});
async function rowMetrics() {
return heightPage.evaluate(function () {
const row = document.querySelector('tr[data-row-id="10"]');
const long = row.querySelector('td[data-month="0"] > div'), short = row.querySelector('td[data-month="1"] > div');
const cell = long.closest("td"), style = getComputedStyle(long), cellStyle = getComputedStyle(cell);
const range = document.createRange(); range.selectNodeContents(long);
return { row: row.getBoundingClientRect().height, editor: long.getBoundingClientRect().height,
paddingTop: parseFloat(style.paddingTop), paddingBottom: parseFloat(style.paddingBottom),
border: parseFloat(cellStyle.borderTopWidth) + parseFloat(cellStyle.borderBottomWidth),
topDifference: short.getBoundingClientRect().top - long.getBoundingClientRect().top,
lines: new Set(Array.from(range.getClientRects()).filter(function (r) { return r.width > 0; }).map(function (r) { return r.top; })).size,
namesAtTop: Array.from(row.querySelectorAll("th")).every(function (th) { return getComputedStyle(th).verticalAlign === "top"; }),
oneLineRow: document.querySelector('tr[data-row-id="11"]').getBoundingClientRect().height };
});
}
const initial = await rowMetrics();
assert.equal(initial.lines, 3, JSON.stringify(initial));
assert.equal(initial.paddingTop, initial.paddingBottom);
assert(Math.abs(initial.row - initial.editor - initial.border) <= 1, JSON.stringify(initial));
assert(Math.abs(initial.topDifference) <= 1, "짧은 셀도 긴 셀과 같은 위치에서 상단 정렬");
assert(initial.namesAtTop, "구역·항목 이름도 상단 정렬");
assert(initial.oneLineRow <= 36, "한 줄 셀은 불필요한 빈 줄 없이 내용에 맞는 높이: " + initial.oneLineRow);
if (!readonly) {
await heightPage.evaluate(function () {
const row = document.querySelector('tr[data-row-id="10"]');
const long = row.querySelector('td[data-month="0"] > div'), short = row.querySelector('td[data-month="1"] > div');
long.value = "한 줄"; short.value = "한 줄";
long.dispatchEvent(new Event("input", { bubbles: true })); short.dispatchEvent(new Event("input", { bubbles: true }));
});
const smaller = await rowMetrics();
assert(smaller.row < initial.row && smaller.row <= 36, JSON.stringify({ initial, smaller }));
await heightPage.evaluate(function () {
const editor = document.querySelector('tr[data-row-id="10"] td[data-month="1"] > div');
editor.value = "pj-rich:v1:" + JSON.stringify([{ text: "큰 글씨\n두 줄", size: 32, bold: true }]);
editor.dispatchEvent(new Event("input", { bubbles: true }));
});
const largeText = await heightPage.evaluate(function () {
const editor = document.querySelector('tr[data-row-id="10"] td[data-month="1"] > div');
return { row: editor.closest("tr").getBoundingClientRect().height, editor: editor.getBoundingClientRect().height,
clipped: editor.scrollHeight > editor.clientHeight, border: parseFloat(getComputedStyle(editor.closest("td")).borderBottomWidth) };
});
assert(largeText.row > smaller.row && !largeText.clipped);
assert(Math.abs(largeText.row - largeText.editor - largeText.border) <= 1, JSON.stringify(largeText));
}
console.log("PASS content row height, symmetric padding, top alignment" + (readonly ? " (read-only)" : ", shrink and large font"));
await heightPage.close();
}
const interactive = await browser.newPage({ viewport: { width: 1600, height: 1000 } });
let releaseMove, startedMove;
const moveGate = new Promise(function (resolve) { releaseMove = resolve; });
const moveStarted = new Promise(function (resolve) { startedMove = resolve; });
const moveRequests = [];
await interactive.route("**/project/api/**", async function (route) {
const request = route.request();
if (request.url().endsWith("/goals/cells/move")) {
const payload = request.postDataJSON(); moveRequests.push(payload); startedMove();
await moveGate;
await route.fulfill({ json: { ok: true, body: payload.body } });
} else await route.fulfill({ json: { ok: true } });
});
await interactive.addInitScript(function () {
localStorage.setItem("pj_goal_col_w", JSON.stringify({ y: 240, m1: 240, m2: 240 }));
});
await interactive.goto("http://127.0.0.1:" + server.address().port + "/project/goals/2026");
const sourceCell = interactive.locator('tr[data-row-id="10"] td[data-month="1"]');
const targetCell = interactive.locator('tr[data-row-id="11"] td[data-month="2"]');
await sourceCell.locator(".pj-goal-text").evaluate(function (editor) {
editor.value = "pj-rich:v1:" + JSON.stringify([{ text: "드래그 이동", bold: true, italic: true, underline: true, size: 24, color: "#ff0000" }]);
});
await sourceCell.locator(".pj-goal-text").click();
const edge = await sourceCell.locator('.pj-goal-move-edge[data-edge="bottom"]').boundingBox();
const dest = await targetCell.boundingBox();
await interactive.mouse.move(edge.x + edge.width / 2, edge.y + edge.height / 2);
await interactive.mouse.down();
await interactive.mouse.move(dest.x + dest.width / 2, dest.y + dest.height / 2, { steps: 6 });
assert(await targetCell.evaluate(function (td) { return td.classList.contains("is-goal-move-target"); }));
await interactive.mouse.up(); await moveStarted;
assert.equal(moveRequests.length, 1);
assert.equal(await sourceCell.locator(".pj-goal-text").textContent(), "드래그 이동");
assert.equal(await targetCell.locator(".pj-goal-text").textContent(), "");
releaseMove();
await interactive.waitForFunction(function () {
return document.querySelector('tr[data-row-id="10"] .pj-goal-text[data-month="1"]').textContent === "";
});
const moved = await targetCell.locator(".pj-goal-text").evaluate(function (editor) { return JSON.parse(editor.value.slice(11))[0]; });
assert.equal(moved.text, "드래그 이동"); assert.equal(moved.color, "#ff0000"); assert.equal(moved.size, 24);
assert(moved.bold && moved.italic && moved.underline);
assert.deepEqual(await targetCell.evaluate(function (td) { return [td.colSpan, td.rowSpan]; }), [1, 1]);
console.log("PASS actual mouse border drag, delayed atomic response, all text formats, unchanged cell geometry");
await targetCell.click({ button: "right" });
await interactive.getByRole("menuitem", { name: "현재 열 너비 자동 맞춤" }).click();
const oneWidth = await interactive.locator('thead th[data-col="m2"]').evaluate(function (th) { return parseFloat(th.style.getPropertyValue("--cw")); });
assert(oneWidth < 240 && oneWidth > 100);
await interactive.evaluate(function () {
// 접힌 열도 전체 너비 계산에 포함한다.
const editor = document.querySelector('.pj-goal-text[data-row="20"][data-month="4"]');
editor.value = "접힌 열도 길이가 아주 긴 문단을 반영합니다";
document.querySelector('thead th[data-col="q2"]').click();
});
await interactive.waitForTimeout(400);
await targetCell.click({ button: "right" });
await interactive.getByRole("menuitem", { name: "전체 열 너비 자동 맞춤" }).click();
const all = await interactive.evaluate(function () {
const head = document.querySelector('thead th[data-col="m4"]');
return { width: parseFloat(head.style.getPropertyValue("--cw")), folded: head.classList.contains("is-gone"),
saved: JSON.parse(localStorage.getItem("pj_goal_col_w")).m4 };
});
assert(all.folded && all.width > 200 && all.saved === all.width, JSON.stringify(all));
console.log("PASS context menu single/all column fitting including collapsed columns");
await interactive.close();
console.log("ALL PASS");
} finally {
if (browser) await browser.close();
await new Promise(function (resolve) { server.close(resolve); });
}
})().catch(function (e) { console.error(e); process.exitCode = 1; });
+268 -11
View File
@@ -88,6 +88,7 @@ function makeEnv(html, url, opts) {
}
async function boot(env) {
if (env.d.readyState === "loading") await new Promise(function (r) { env.d.addEventListener("DOMContentLoaded", r); });
env.w.eval(fs.readFileSync(path.join(ROOT, "app", "static", "project-goal-text.js"), "utf8"));
env.w.eval(JS);
env.d.dispatchEvent(new env.w.Event("DOMContentLoaded"));
await settle();
@@ -114,6 +115,47 @@ function unload(env) {
return e;
}
// jsdom에는 글꼴·레이아웃 엔진이 없다. 숨은 복사본의 실제 DOM/서식을 확인하면서
// 결정적인 글 너비를 제공한다. 실제 CSS·폰트 측정은 별도 브라우저 검증으로 확인한다.
function mockAutoFitLayout(env) {
const realRect = env.w.HTMLElement.prototype.getBoundingClientRect;
const measured = [];
env.w.HTMLElement.prototype.getBoundingClientRect = function () {
if (!this.classList.contains("pj-goal-autofit-measure")) return realRect.call(this);
measured.push(this);
const content = this.querySelector(".pj-goal-text, .pj-goal-text-ro, .pj-goal-num, .pj-goal-area-text, .pj-goal-row-text") || this;
let line = 0, longest = 0;
function walk(node, size, bold) {
if (node.nodeType === 3) {
node.nodeValue.split("\n").forEach(function (text, i) {
if (i) { longest = Math.max(longest, line); line = 0; }
line += text.length * size * (bold ? 1.2 : 1);
});
} else if (node.nodeType === 1) {
if (node.tagName === "BR") { longest = Math.max(longest, line); line = 0; return; }
const nextSize = parseFloat(node.style.fontSize) || size;
const nextBold = node.style.fontWeight ? Number(node.style.fontWeight) >= 600 : bold;
Array.from(node.childNodes).forEach(function (child) { walk(child, nextSize, nextBold); });
}
}
walk(content, 10, false);
const zoom = env.d.documentElement.classList.contains("pj-ui-scale") ? 0.75 : 1;
return { width: (Math.max(longest, line) + 13) * zoom };
};
return measured;
}
function beginGoalMove(env, source, target) {
const td = source.closest("td");
td.dispatchEvent(new env.w.MouseEvent("mousedown", { bubbles: true, button: 0, clientX: 10, clientY: 10 }));
env.d.dispatchEvent(new env.w.MouseEvent("mouseup", { bubbles: true }));
const edge = td.querySelector('.pj-goal-move-edge[data-edge="bottom"]');
edge.dispatchEvent(new env.w.MouseEvent("mousedown", { bubbles: true, button: 0, clientX: 20, clientY: 20 }));
env.d.elementFromPoint = function () { return target; };
env.d.dispatchEvent(new env.w.MouseEvent("mousemove", { bubbles: true, clientX: 300, clientY: 200 }));
return function () { env.d.dispatchEvent(new env.w.MouseEvent("mouseup", { bubbles: true, clientX: 300, clientY: 200 })); };
}
// ── 가짜 서버 — 목표 표(글 칸 상태를 기억해 화면 GET 에 반영) ───────────────
function goalsServer(env, st) {
st = Object.assign({ cells: {}, areaAdded: false, cellHook: null, metricHook: null, getHook: null }, st || {});
@@ -137,23 +179,37 @@ function goalsServer(env, st) {
env.route("GET", /\/project\/goals\/2026$/, async function () {
if (st.getHook) await st.getHook();
st.gets = (st.gets || 0) + 1;
let html = PAGE.goals_admin.replace(/(<textarea class="pj-goal-text"[^>]*data-row="(\d+)" data-month="(\d+)"[^>]*>)([\s\S]*?)(<\/textarea>)/g,
let html = PAGE.goals_admin.replace(/(<div class="pj-goal-text"[^>]*data-row="(\d+)" data-month="(\d+)"[^>]*>)([\s\S]*?)(<\/div>)/g,
function (all, open, row, month, text, close) {
const k = row + ":" + month;
return open + (k in st.cells ? st.cells[k].replace(/&/g, "&amp;").replace(/</g, "&lt;") : text) + close;
return open + (k in st.cells ? renderGoalBody(env, st.cells[k]) : text) + close;
});
if (st.areaAdded) {
html = html.replace(/(<\/tbody>\s*)(<\/table>)/, '$1<tbody class="pj-goal-area" data-area-id="3" data-color="" style="--goal-bg: #fff">' +
'<tr data-row-id="30"><th class="pj-goal-c1 pj-goal-area-name" rowspan="1"><span class="pj-goal-area-text">새 영역</span></th>' +
'<th class="pj-goal-c2 pj-goal-row-label"><span class="pj-goal-row-text"></span></th>' +
'<td class="pj-goal-texttd pj-goal-year-col" data-month="0" data-span="1" data-rspan="1"><textarea class="pj-goal-text" rows="1" data-row="30" data-month="0"></textarea></td>' +
'<td class="pj-goal-texttd pj-goal-year-col" data-month="0" data-span="1" data-rspan="1"><div class="pj-goal-text" contenteditable="true" data-row="30" data-month="0"></div></td>' +
"</tr></tbody>$2");
}
return { text: html };
});
env.route("POST", new RegExp("/project/api/goals/cells/move$"), async function (u, body, call) {
st.moves = (st.moves || 0) + 1;
if (st.moveHook) { const result = await st.moveHook(body, call); if (result) return result; }
st.cells[body.source_row + ":" + body.source_month] = "";
st.cells[body.target_row + ":" + body.target_month] = body.body;
return { body: { ok: true, body: body.body } };
});
return st;
}
function renderGoalBody(env, value) {
const div = env.d.createElement("div");
const runs = value.startsWith("pj-rich:v1:") ? JSON.parse(value.slice(11)) : [{ text: value }];
env.w.PJGoalText.paint(div, runs);
return div.innerHTML;
}
// ── 가짜 서버 — 회의록 ────────────────────────────────────────────────
function meetServer(env, st) {
st = Object.assign({ items: {}, head: {}, itemHook: null, headHook: null, getHook: null, syncHook: null, page: PAGE.meeting_admin }, st || {});
@@ -368,14 +424,14 @@ function meetServer(env, st) {
const env = makeEnv(PAGE.goals_admin, GOALS_URL, { promptAnswer: "새 영역" });
const st = goalsServer(env, { cellHook: function () { return { status: 503, body: { detail: "temporary save failure" } }; } });
await boot(env);
const ta = env.d.querySelector('textarea.pj-goal-text[data-row="10"][data-month="1"]');
const ta = env.d.querySelector('.pj-goal-text[data-row="10"][data-month="1"]');
ta.focus(); type(env, ta, "unsaved important plan");
env.d.getElementById("pj-goal-area-add").click();
await settle(); await wait(20); await settle();
check("[3] 글 저장 실패 → 영역 추가 요청 안 보냄", !env.calls.some(function (c) { return c.method === "POST" && /\/areas$/.test(c.url); }),
env.calls.map(function (c) { return c.method + " " + c.url; }));
check("[3] 표를 다시 받지 않음", !st.gets);
check("[3] 미저장 계획 그대로", env.d.querySelector('textarea.pj-goal-text[data-row="10"][data-month="1"]').value === "unsaved important plan");
check("[3] 미저장 계획 그대로", env.d.querySelector('.pj-goal-text[data-row="10"][data-month="1"]').value === "unsaved important plan");
check("[3] 실패 안내", /저장/.test(env.toastText()), env.toastText());
});
await section(async function () { // 진행 중 저장 → 그 저장이 끝난 뒤에 영역 추가, 성공하면 표 교체(새 영역 보임, 저장된 글 유지)
@@ -383,7 +439,7 @@ function meetServer(env, st) {
const gate = deferred();
const st = goalsServer(env, { cellHook: async function () { await gate.promise; } });
await boot(env);
const ta = env.d.querySelector('textarea.pj-goal-text[data-row="10"][data-month="1"]');
const ta = env.d.querySelector('.pj-goal-text[data-row="10"][data-month="1"]');
ta.focus(); type(env, ta, "plan v2"); ta.blur();
await settle();
env.d.getElementById("pj-goal-area-add").click();
@@ -394,7 +450,7 @@ function meetServer(env, st) {
const order = env.calls.filter(function (c) { return c.method !== "GET" || /goals\/2026$/.test(c.url); }).map(function (c) { return c.method + " " + c.url.replace(/^https?:\/\/[^/]+/, ""); });
check("[3b] 순서: 글 PUT → 영역 POST → 표 GET", order.join(" | ") === "PUT /project/api/goals/rows/10/cells/1 | POST /project/api/goals/2026/areas | GET /project/goals/2026", order);
check("[3b] 새 영역이 그 자리에 보임(새로고침 없음)", !!env.d.querySelector('tbody.pj-goal-area[data-area-id="3"]') && env.navigations === 0);
check("[3b] 저장된 글 유지", env.d.querySelector('textarea.pj-goal-text[data-row="10"][data-month="1"]').value === "plan v2");
check("[3b] 저장된 글 유지", env.d.querySelector('.pj-goal-text[data-row="10"][data-month="1"]').value === "plan v2");
});
await section(async function () { // 표를 받는 사이에 새로 입력 → 저장 후 다시 받아 교체(입력 유실 없음)
const env = makeEnv(PAGE.goals_admin, GOALS_URL, { promptAnswer: "새 영역" });
@@ -404,19 +460,19 @@ function meetServer(env, st) {
await boot(env);
env.d.getElementById("pj-goal-area-add").click();
await settle();
const ta = env.d.querySelector('textarea.pj-goal-text[data-row="11"][data-month="1"]');
const ta = env.d.querySelector('.pj-goal-text[data-row="11"][data-month="1"]');
ta.focus(); type(env, ta, "typed during refresh");
gate.resolve();
await settle(); await wait(30); await settle();
check("[3c] 받는 사이 입력한 글 저장됨", st.cells["11:1"] === "typed during refresh", st.cells);
check("[3c] 교체된 표에도 그 글", env.d.querySelector('textarea.pj-goal-text[data-row="11"][data-month="1"]').value === "typed during refresh");
check("[3c] 교체된 표에도 그 글", env.d.querySelector('.pj-goal-text[data-row="11"][data-month="1"]').value === "typed during refresh");
check("[3c] 표를 다시 받음(2회)", st.gets === 2, st.gets);
});
await section(async function () { // 병합 — 저장 실패면 병합 요청 안 보냄
const env = makeEnv(PAGE.goals_admin, GOALS_URL);
const st = goalsServer(env, { cellHook: function () { return { status: 503, body: { detail: "x" } }; } });
await boot(env);
const ta = env.d.querySelector('textarea.pj-goal-text[data-row="10"][data-month="1"]');
const ta = env.d.querySelector('.pj-goal-text[data-row="10"][data-month="1"]');
ta.focus(); type(env, ta, "draft before merge");
const a = env.d.querySelector('td.pj-goal-texttd[data-month="1"]'), b = env.d.querySelector('tr[data-row-id="10"] td.pj-goal-texttd[data-month="2"]');
a.dispatchEvent(new env.w.MouseEvent("mousedown", { bubbles: true, button: 0 }));
@@ -543,7 +599,7 @@ function meetServer(env, st) {
check("[8] 보기 전용: 메뉴 버튼·이름 편집 없음", !env.d.querySelector(".pj-goal-menu-btn") && !env.d.querySelector("[data-goal-edit]"));
const th = env.d.querySelector("th.pj-goal-area-name");
th.dispatchEvent(new env.w.MouseEvent("contextmenu", { bubbles: true, cancelable: true }));
check("[8] 보기 전용: 우클릭 편집 메뉴 없음", !env.d.querySelector(".pj-ctxmenu"));
check("[8] 보기 전용: 우클릭은 너비 맞춤만 제공", Array.from(env.d.querySelectorAll(".pj-ctxmenu-item")).map(itemLabel).join("|") === "현재 열 너비 자동 맞춤|전체 열 너비 자동 맞춤");
// 분기 접기는 보기 전용도
const qth = env.d.querySelector('th.pj-goal-fold-th[data-h="1"]');
qth.dispatchEvent(new env.w.MouseEvent("click", { bubbles: true }));
@@ -563,6 +619,142 @@ function meetServer(env, st) {
const table = env.d.getElementById("pj-goal-table");
check("[회귀] 1열 너비 끌기 → --goal-c1-w 112px·기억", table.style.getPropertyValue("--goal-c1-w") === "112px" && /"c1":112/.test(env.w.localStorage.getItem("pj_goal_col_w") || ""),
table.style.getPropertyValue("--goal-c1-w"));
check("[너비] 지표·업무 모든 행의 셀 경계에 손잡이", Array.from(table.querySelectorAll("tbody th, tbody td")).every(function (td) { return !!td.querySelector(".pj-goal-colresize"); }));
const lower = env.d.querySelector('tbody.pj-goal-area .pj-goal-colresize[data-col="m1"]');
lower.dispatchEvent(new env.w.MouseEvent("mousedown", { bubbles: true, button: 0, clientX: 100 }));
env.d.dispatchEvent(new env.w.MouseEvent("mousemove", { bubbles: true, clientX: 160 }));
env.d.dispatchEvent(new env.w.MouseEvent("mouseup", { bubbles: true }));
check("[너비] 아래 행에서 월 너비 조절", table.querySelector('thead th[data-col="m1"]').style.getPropertyValue("--cw") === "145px");
env.d.getElementById("pj-goal-area-add").click(); await settle(); await wait(20); await settle();
const fresh = env.d.querySelector('tbody.pj-goal-area .pj-goal-colresize[data-col="m1"]');
check("[너비] 표 새로 그린 뒤에도 손잡이", !!fresh && fresh !== lower);
mockAutoFitLayout(env);
fresh.dispatchEvent(new env.w.MouseEvent("dblclick", { bubbles: true }));
check("[너비] 표를 다시 그린 뒤에도 더블클릭 내용 맞춤", table.querySelector('thead th[data-col="m1"]').style.getPropertyValue("--cw") === "95px");
});
await section(async function () {
const env = makeEnv(PAGE.goals_admin, GOALS_URL);
goalsServer(env); await boot(env);
const table = env.d.getElementById("pj-goal-table"), measured = mockAutoFitLayout(env);
const first = table.querySelector('.pj-goal-text[data-row="10"][data-month="1"]');
const second = table.querySelector('.pj-goal-text[data-row="11"][data-month="1"]');
first.value = "짧은 문단\n다담: 100 백만(김지통)\n주부콩: 20백만(김지통)";
second.value = "pj-rich:v1:" + JSON.stringify([{ text: "가장 긴 문단", size: 32, bold: true }, { text: " 끝" }]);
const draft = second.value, calls = env.calls.length;
function fit(key, body) {
const handle = table.querySelector((body ? "tbody " : "thead ") + '.pj-goal-colresize[data-col="' + key + '"]');
handle.dispatchEvent(new env.w.MouseEvent("dblclick", { bubbles: true, cancelable: true }));
}
function width(key) { return parseFloat(table.querySelector('thead th[data-col="' + key + '"]').style.getPropertyValue("--cw")); }
fit("m1", true);
const wanted = Math.ceil(7 * 32 * 1.2 + 2 * 10 + 13) + 2;
check("[자동 너비] 모든 행 중 가장 긴 문단·큰 글씨·굵기 반영", width("m1") === wanted, [width("m1"), wanted]);
check("[자동 너비] 원본 초안·부분 서식 보존·저장 요청 없음", second.value === draft && env.calls.length === calls);
check("[자동 너비] 복사본만 줄바꿈 해제·메뉴/손잡이 제외·측정 뒤 제거", measured.every(function (cell) {
const editor = cell.querySelector(".pj-goal-text");
return !cell.querySelector(".pj-goal-colresize, .pj-goal-menu-btn") && (!editor || editor.style.whiteSpace === "pre");
}) && !table.querySelector(".pj-goal-autofit-measure"));
second.value = "짧음";
fit("m1");
const paragraphWidth = Math.max.apply(null, first.textContent.split("\n").map(function (line) { return line.length; })) * 10 + 15;
check("[자동 너비] 명시적 줄바꿈 유지·문단 너비로 축소도 가능", width("m1") === paragraphWidth, [width("m1"), paragraphWidth]);
env.d.documentElement.classList.add("pj-ui-scale"); fit("m1");
check("[자동 너비] 75% 화면 배율에서도 같은 논리 너비", width("m1") === paragraphWidth);
env.d.documentElement.classList.remove("pj-ui-scale");
first.value = "긴".repeat(100); fit("m1");
const saved = env.w.localStorage.getItem("pj_goal_col_w");
check("[자동 너비] 600px를 넘는 문단도 잘리지 않고 기억", width("m1") === 1015 && JSON.parse(saved).m1 === 1015);
const restored = makeEnv(PAGE.goals_ro, GOALS_URL, { storage: { pj_goal_col_w: saved } });
goalsServer(restored); await boot(restored);
check("[자동 너비] 다시 열면 큰 자동 너비도 복원", restored.d.querySelector('thead th[data-col="m1"]').style.getPropertyValue("--cw") === "1015px");
const numeric = table.querySelector('input.pj-goal-num[data-month="2"]');
numeric.value = "12345678901234567890"; fit("m2");
check("[자동 너비] 숫자 입력칸의 현재 초안도 측정", width("m2") === 215);
table.querySelector(".pj-goal-area-text").textContent = "아주 긴 영역 이름"; fit("c1", true);
check("[자동 너비] rowspan 이름 열·메뉴 아이콘 제외", table.style.getPropertyValue("--goal-c1-w") === "115px");
const row = first.closest("tr"), merged = first.closest("td");
merged.colSpan = 2; merged.dataset.goalCols = "m1,m2";
merged.querySelector(".pj-goal-colresize").dataset.col = "m2";
row.querySelector('td[data-month="2"]').remove();
first.value = "병합".repeat(80);
const beforeM1 = width("m1"); fit("m2", true);
check("[자동 너비] 병합 셀은 나머지 열 유지·오른쪽 끝 열만 맞춤", width("m1") === beforeM1 && width("m2") === 1615 - beforeM1, [width("m1"), width("m2")]);
const qth = table.querySelector('thead th[data-col="q1"]'), folded = qth.classList.contains("is-folded");
fit("q1");
check("[자동 너비] 분기 열 더블클릭은 접기 상태를 바꾸지 않음", qth.classList.contains("is-folded") === folded);
mockAutoFitLayout(restored);
restored.d.querySelector('tbody .pj-goal-colresize[data-col="m1"]').dispatchEvent(new restored.w.MouseEvent("dblclick", { bubbles: true }));
check("[자동 너비] 보기 전용도 내용 맞춤 가능·쓰기 요청 없음", restored.d.querySelector('thead th[data-col="m1"]').style.getPropertyValue("--cw") === "95px" && !restored.calls.some(function (c) { return c.method !== "GET"; }));
});
await section(async function () {
const env = makeEnv(PAGE.goals_admin, GOALS_URL); goalsServer(env); await boot(env); mockAutoFitLayout(env);
const table = env.d.getElementById("pj-goal-table"), editor = table.querySelector('.pj-goal-text[data-row="10"][data-month="1"]');
editor.value = "길게".repeat(25);
function menu(cell) { cell.dispatchEvent(new env.w.MouseEvent("contextmenu", { bubbles: true, cancelable: true })); }
function action(label) { return Array.from(env.d.querySelectorAll(".pj-ctxmenu-item")).find(function (b) { return itemLabel(b) === label; }); }
menu(editor);
check("[너비 메뉴] 기존 내용 지우기·현재 열·전체 열 맞춤 함께 표시", !!action("내용 지우기 (Del)") && !!action("현재 열 너비 자동 맞춤") && !!action("전체 열 너비 자동 맞춤"));
action("현재 열 너비 자동 맞춤").click();
check("[너비 메뉴] 현재 열만 맞춤", table.querySelector('thead th[data-col="m1"]').style.getPropertyValue("--cw") === "515px" && table.querySelector('thead th[data-col="m2"]').style.getPropertyValue("--cw") === "85px");
table.querySelector('thead th[data-col="q1"]').click();
menu(table.querySelector('thead th[data-col="y"]')); action("전체 열 너비 자동 맞춤").click();
check("[너비 메뉴] 머리에서도 전체 맞춤·접힌 열 포함·저장", table.querySelector('thead th[data-col="m1"]').style.getPropertyValue("--cw") === "515px" && table.querySelector('thead th[data-col="q1"]').classList.contains("is-folded") && JSON.parse(env.w.localStorage.getItem("pj_goal_col_w")).m1 === 515);
menu(table.querySelector("th.pj-goal-area-name"));
check("[너비 메뉴] 구역 이름 편집 메뉴에도 맞춤 제공", !!action("색 바꾸기") && !!action("현재 열 너비 자동 맞춤"));
});
await section(async function () {
const gate = deferred(), env = makeEnv(PAGE.goals_admin, GOALS_URL);
const st = goalsServer(env, { moveHook: async function (body) { await gate.promise; return { body: { ok: true, body: body.body } }; } });
await boot(env);
const source = env.d.querySelector('.pj-goal-text[data-row="10"][data-month="1"]'), target = env.d.querySelector('.pj-goal-text[data-row="11"][data-month="2"]');
type(env, source, "pj-rich:v1:" + JSON.stringify([{ text: "이동할 글", color: "#ff0000", size: 24, bold: true, italic: true, underline: true }]));
const original = source.value;
const drop = beginGoalMove(env, source, target);
check("[셀 이동] 대상 미리보기·일반 범위 선택과 분리", target.closest("td").classList.contains("is-goal-move-target") && env.d.documentElement.classList.contains("pj-goal-moving"));
drop(); await settle();
check("[셀 이동] 먼저 초안 저장·이동은 한 번·응답 전 원본 유지", st.moves === 1 && source.value === original && target.value === "" && source.getAttribute("contenteditable") === "false" && target.getAttribute("contenteditable") === "false");
const moveIndex = env.calls.findIndex(function (c) { return /cells\/move$/.test(c.url); });
check("[셀 이동] 글 PUT 뒤 원자적 이동 API", moveIndex > env.calls.findIndex(function (c) { return c.method === "PUT" && /rows\/10\/cells\/1$/.test(c.url); }));
gate.resolve(); await settle();
const run = JSON.parse(target.value.slice(11))[0];
check("[셀 이동] 성공 뒤 원본 비우기·대상 글과 모든 서식 보존", source.value === "" && run.text === "이동할 글" && run.color === "#ff0000" && run.size === 24 && run.bold && run.italic && run.underline);
const count = env.calls.length; fire(env, source, "blur"); fire(env, target, "blur"); await settle();
check("[셀 이동] 저장 기준값·초안 정리·후속 blur 중복 저장 없음", env.calls.length === count && !env.w.localStorage.getItem("pj_draft:goal:10:1") && source.getAttribute("contenteditable") === "true" && target.closest("td").classList.contains("is-goal-active"));
});
for (const failure of ["network", "conflict", "save"]) await section(async function () {
const env = makeEnv(PAGE.goals_admin, GOALS_URL);
const st = goalsServer(env, { moveHook: function () { return failure === "network" ? "NETWORK" : { status: 409, body: { detail: "다른 창에서 수정" } }; },
cellHook: failure === "save" ? function () { return { status: 503, body: { detail: "저장 장애" } }; } : null });
await boot(env);
const source = env.d.querySelector('.pj-goal-text[data-row="10"][data-month="1"]'), target = env.d.querySelector('.pj-goal-text[data-row="11"][data-month="2"]');
if (failure === "save") type(env, source, "미저장 초안");
const before = source.value; beginGoalMove(env, source, target)(); await settle();
check("[셀 이동 " + failure + "] 실패해도 양쪽 내용·편집 가능 상태 유지", source.value === before && target.value === "" && source.getAttribute("contenteditable") === "true" && !env.d.documentElement.classList.contains("pj-goal-moving"));
check("[셀 이동 " + failure + "] 저장 실패면 이동 API 생략", failure !== "save" || !st.moves);
});
await section(async function () {
const env = makeEnv(PAGE.goals_admin, GOALS_URL), st = goalsServer(env); await boot(env);
const source = env.d.querySelector('.pj-goal-text[data-row="10"][data-month="1"]'), target = env.d.querySelector('.pj-goal-text[data-row="11"][data-month="2"]');
target.value = "대상 기존 글"; let confirmations = 0;
env.w.erpConfirm = function () { confirmations++; return Promise.resolve(false); };
beginGoalMove(env, source, target)(); await settle();
check("[셀 이동] 덮어쓰기 취소는 두 내용 유지·이동 없음", confirmations === 1 && !st.moves && source.value === "original" && target.value === "대상 기존 글");
env.w.erpConfirm = function () { return Promise.resolve(true); };
beginGoalMove(env, source, target)(); await settle();
check("[셀 이동] 확인 뒤 덮어쓰기·원본 비우기", st.moves === 1 && source.value === "" && target.textContent === "original");
});
await section(async function () {
const env = makeEnv(PAGE.goals_admin, GOALS_URL), st = goalsServer(env); await boot(env);
const source = env.d.querySelector('.pj-goal-text[data-row="10"][data-month="1"]'), target = env.d.querySelector('.pj-goal-text[data-row="11"][data-month="2"]');
beginGoalMove(env, source, target); key(env, env.d, "Escape"); await settle();
check("[셀 이동] Esc 취소는 원본 유지·이동 요청 없음", !st.moves && source.value === "original" && !env.d.documentElement.classList.contains("pj-goal-moving"));
beginGoalMove(env, source, target); env.w.dispatchEvent(new env.w.Event("blur")); await settle();
check("[셀 이동] 창 포커스 이탈도 이동 취소·드래그 정리", !st.moves && !env.d.querySelector(".is-goal-move-target"));
beginGoalMove(env, source, source)(); await settle();
check("[셀 이동] 자기 셀에 놓기 = 변경 없음", !st.moves && source.value === "original");
const ro = makeEnv(PAGE.goals_ro, GOALS_URL); goalsServer(ro); await boot(ro);
check("[셀 이동] 보기 전용에는 이동 테두리 없음", !ro.d.querySelector(".pj-goal-move-edge"));
});
// ════════════════════ [9] 매출 자동 갱신 — 정상 조용히 · 실패/일부 실패 안내 + 재시도 · 권한 없음 ════════════════════
@@ -656,6 +848,71 @@ function meetServer(env, st) {
check("[회귀] 참석자 고르기 → 칩 + 저장", !!env.d.querySelector('.pj-meet-chip[data-key="a@test.local"]') && st.head.attendees === "a@test.local", st.head);
});
await section(async function () { // 선택한 글자만 서식·서식 초기화·저장·다시 그리기
const env = makeEnv(PAGE.goals_admin, "http://localhost/project/goals/2026"); const st = goalsServer(env); await boot(env);
const d = env.d, w = env.w, editor = d.querySelector('.pj-goal-text[data-row="10"][data-month="1"]');
const toolbar = d.getElementById("pj-goal-format");
check("[서식] 글자를 선택하기 전 도구 숨김", toolbar.hidden);
const swatches = Array.from(d.querySelectorAll("[data-goal-color]"));
check("[서식] 요청한 12색 견본만 표시", swatches.map(function (b) { return b.dataset.goalColor; }).join(",") === "#000000,#4B5563,#9CA3AF,#DC2626,#EA580C,#CA8A04,#16A34A,#0891B2,#2563EB,#7C3AED,#DB2777,#FFFFFF" && swatches.every(function (b) { return !b.textContent.trim(); }));
type(env, editor, "앞 선택 뒤"); editor.focus();
const range = d.createRange(); range.setStart(editor.firstChild, 2); range.setEnd(editor.firstChild, 4);
w.getSelection().removeAllRanges(); w.getSelection().addRange(range); fire(env, editor, "mouseup");
check("[서식] 글자 선택하면 body 팝업 표시", !toolbar.hidden && toolbar.parentElement === d.body);
const format = function (name) { d.querySelector('[data-goal-format="' + name + '"]').click(); };
format("bold"); format("italic"); format("underline");
d.querySelector('[data-goal-format="color"]').click();
check("[서식] 색상 버튼으로 견본 펼침", !d.getElementById("pj-goal-color-grid").hidden);
d.querySelector('[data-goal-color="#DC2626"]').click(); format("size-up"); format("size-up"); format("size-up");
let runs = w.PJGoalText.readRuns(editor);
check("[서식] 선택한 두 글자에만 색·굵게·기울임·밑줄·크기", runs.length === 3 && runs[0].text === "앞 " && runs[1].text === "선택" && runs[1].bold === true && runs[1].italic === true && runs[1].underline === true && runs[1].color === "#dc2626" && runs[1].size === 20 && !runs[2].bold, runs);
check("[서식] 토글 버튼은 적용 상태 표시", ["bold", "italic", "underline"].every(function (k) { return d.querySelector('[data-goal-format="' + k + '"]').getAttribute("aria-pressed") === "true"; }));
format("size-down");
check("[서식] 크기 줄이기는 2px", w.PJGoalText.readRuns(editor)[1].size === 18 && d.querySelector('[data-goal-format="size"]').textContent === "18px");
format("size-up"); format("italic"); format("underline");
check("[서식] 다시 누르면 기울임·밑줄 해제", w.PJGoalText.readRuns(editor)[1].italic === false && w.PJGoalText.readRuns(editor)[1].underline === false);
format("italic"); format("underline");
fire(env, editor, "blur"); await settle();
check("[서식] 텍스트 조각을 기존 셀 API에 저장", st.cells["10:1"].startsWith("pj-rich:v1:") && JSON.parse(st.cells["10:1"].slice(11))[1].size === 20);
const persisted = st.cells["10:1"];
d.querySelector('[data-goal-format="reset"]').click(); fire(env, editor, "blur"); await settle();
check("[서식] 선택 서식 초기화는 글을 유지하고 평문 저장", editor.textContent === "앞 선택 뒤" && st.cells["10:1"] === "앞 선택 뒤");
editor.value = persisted; fire(env, editor, "input"); fire(env, editor, "blur"); await settle();
d.getElementById("pj-goal-area-add").click(); await settle(); await wait(20); await settle();
const fresh = d.querySelector('.pj-goal-text[data-row="10"][data-month="1"]');
check("[서식] 표 다시 그리기에도 선택 서식 유지", fresh !== editor && w.PJGoalText.readRuns(fresh)[1].size === 20 && w.PJGoalText.readRuns(fresh)[1].italic === true && w.PJGoalText.readRuns(fresh)[1].underline === true);
fresh.focus();
const plainRange = d.createRange(); plainRange.setStart(fresh.firstChild, 0); plainRange.setEnd(fresh.firstChild, 1);
w.getSelection().removeAllRanges(); w.getSelection().addRange(plainRange); fire(env, fresh, "mouseup");
check("[서식] 새 평문 선택은 도구 값을 기본값으로 표시", d.querySelector('[data-goal-format="bold"]').getAttribute("aria-pressed") === "false" && d.querySelector('[data-goal-format="size"]').textContent === "14px");
plainRange.collapse(true); w.getSelection().removeAllRanges(); w.getSelection().addRange(plainRange); fire(env, fresh, "keyup");
check("[서식] 글자 선택을 해제하면 숨김·이전 선택 적용 차단", toolbar.hidden && d.querySelector('[data-goal-format="reset"]').disabled);
});
await section(async function () { // 혼합 서식·각 조각 크기 변경·상한/하한
const env = makeEnv(PAGE.goals_admin, GOALS_URL); goalsServer(env); await boot(env);
const d = env.d, w = env.w, editor = d.querySelector('.pj-goal-text[data-row="10"][data-month="1"]');
editor.value = 'pj-rich:v1:' + JSON.stringify([{text:"작은", size:10, bold:true, italic:true}, {text:"큰", size:30, underline:true}]);
editor.focus(); const r = d.createRange(); r.selectNodeContents(editor);
w.getSelection().removeAllRanges(); w.getSelection().addRange(r); fire(env, editor, "mouseup");
const button = function (key) { return d.querySelector('[data-goal-format="' + key + '"]'); };
check("[서식 혼합] 크기는 혼합·토글은 혼합 상태", button("size").textContent === "혼합" && button("bold").getAttribute("aria-pressed") === "mixed");
button("size-up").click(); let runs = w.PJGoalText.readRuns(editor);
check("[서식 혼합] 선택 조각마다 2px 증가", runs[0].size === 12 && runs[1].size === 32);
button("size-up").click(); runs = w.PJGoalText.readRuns(editor);
check("[서식 혼합] 32px 상한 보존", runs[0].size === 14 && runs[1].size === 32);
button("bold").click(); runs = w.PJGoalText.readRuns(editor);
check("[서식 혼합] 혼합에서 클릭하면 전체 굵게·다른 서식 유지", runs.every(function (run) { return run.bold === true; }) && runs[0].italic && runs[1].underline);
button("bold").click();
check("[서식 혼합] 다시 클릭하면 전체 굵게 해제", w.PJGoalText.readRuns(editor).every(function (run) { return run.bold === false; }));
for (let i = 0; i < 12; i++) button("size-down").click();
check("[서식 혼합] 10px 하한·감소 비활성", w.PJGoalText.readRuns(editor).every(function (run) { return run.size === 10; }) && button("size-down").disabled);
for (let i = 0; i < 12; i++) button("size-up").click();
check("[서식 혼합] 32px 상한·증가 비활성", w.PJGoalText.readRuns(editor).every(function (run) { return run.size === 32; }) && button("size-up").disabled);
button("reset").click();
check("[서식 혼합] 초기화는 모든 서식 제거·내용 보존", editor.value === "작은큰");
});
clearTimeout(WATCHDOG);
const realUnhandled = unhandled.filter(function (m) { return !/Not implemented/.test(m); });
check("처리 안 된 Promise 거부 없음", realUnhandled.length === 0, realUnhandled);
+81
View File
@@ -0,0 +1,81 @@
// 실제 Chromium + ERP 셸에서 검색·이동과 데스크톱/모바일 표시 검증(DB 미사용).
// python tests/js/render_help.py
// PJ_TEST_BROWSER=<설치된 Chrome 경로> node tests/js/help.browser.test.js (playwright 필요)
const assert = require("node:assert/strict");
const fs = require("node:fs");
const http = require("node:http");
const path = require("node:path");
const { chromium } = require("playwright");
const ROOT = path.resolve(__dirname, "../..");
const STATIC = path.join(ROOT, "app/static");
const OUT = path.join(__dirname, ".out");
const server = http.createServer(function (req, res) {
const url = new URL(req.url, "http://localhost");
if (url.pathname === "/project/help") {
res.setHeader("Content-Type", "text/html; charset=utf-8");
res.end(fs.readFileSync(path.join(OUT, "help_render.html"))); return;
}
const file = path.resolve(STATIC, "." + decodeURIComponent(url.pathname.slice(7)));
if (!url.pathname.startsWith("/static/") || !file.startsWith(STATIC + path.sep) || !fs.existsSync(file) || !fs.statSync(file).isFile()) {
res.statusCode = 404; res.end(); return;
}
const types = { ".css": "text/css", ".js": "text/javascript", ".woff2": "font/woff2", ".woff": "font/woff", ".png": "image/png" };
res.setHeader("Content-Type", types[path.extname(file)] || "application/octet-stream");
fs.createReadStream(file).pipe(res);
});
(async function () {
let browser;
try {
await new Promise(resolve => server.listen(0, "127.0.0.1", resolve));
browser = await chromium.launch({ headless: true, executablePath: process.env.PJ_TEST_BROWSER || undefined });
const page = await browser.newPage({ viewport: { width: 1600, height: 1000 } });
const errors = [], mutations = [];
page.on("pageerror", e => errors.push(e.message));
page.on("request", r => { if (r.method() !== "GET") mutations.push(r.url()); });
await page.goto("http://127.0.0.1:" + server.address().port + "/project/help");
await page.locator("#pjh-query").waitFor({ state: "visible" });
await page.locator("#pjh-query").fill("셀 병합");
const first = page.locator("#pjh-results a").first();
assert.equal(await first.getAttribute("href"), "#goals-merge");
await page.screenshot({ path: path.join(OUT, "help-desktop.png") });
await first.click();
assert.equal(await page.evaluate(() => document.activeElement.id), "goals-merge");
assert.ok(await page.locator("#goals-merge").isVisible());
const rect = await page.locator("#goals-merge").boundingBox();
assert.ok(rect.y >= 0 && rect.y < 300, "앵커 이동 후 소제목이 화면 위에 표시");
await page.screenshot({ path: path.join(OUT, "help-goals.png") });
await page.keyboard.press("/");
await page.locator("#pjh-query").fill("쇼핑몰 연결");
await page.locator("#pjh-query").press("Enter");
assert.equal(await page.evaluate(() => document.activeElement.id), "meetings-markets");
await page.reload();
await page.locator("#pjh-query").waitFor({ state: "visible" });
assert.equal(await page.locator("#pjh-query").inputValue(), "쇼핑몰 연결");
assert.equal(await page.evaluate(() => document.activeElement.id), "meetings-markets");
await page.goBack();
assert.equal(await page.evaluate(() => document.activeElement.id), "goals-merge");
assert.equal(await page.locator("#pjh-query").inputValue(), new URL(page.url()).searchParams.get("q"), "뒤로 간 주소의 검색어 복원");
await page.setViewportSize({ width: 390, height: 844 });
await page.waitForFunction(() => document.querySelector(".erp-sidebar").getBoundingClientRect().right <= 1);
await page.keyboard.press("/");
await page.locator("#pjh-query").fill("회의록");
await page.screenshot({ path: path.join(OUT, "help-mobile.png") });
assert.ok(await page.locator("#pjh-query").isVisible(), "모바일에서 목차가 숨겨져도 검색 유지");
const widths = await page.evaluate(() => {
const nodes = [document.documentElement, document.querySelector(".erp-page"), document.querySelector(".pjh"), document.querySelector(".pjh-body")];
return nodes.map(n => ({ name: n.className || n.tagName, scroll: n.scrollWidth, client: n.clientWidth }));
});
assert.ok(widths.every(n => n.scroll <= n.client + 1), "모바일에서 가로 넘침 없음: " + JSON.stringify(widths));
await page.locator('#pjh-results a[href="#meetings-review"]').click();
assert.equal(await page.evaluate(() => document.activeElement.id), "meetings-review");
await page.screenshot({ path: path.join(OUT, "help-meeting-mobile.png") });
assert.deepEqual(errors, [], "브라우저 JS 오류 없음");
assert.deepEqual(mutations, [], "도움말 검색은 데이터 쓰기 요청 없음");
console.log("ALL PASS — Chromium 검색·Enter·새로고침·뒤로 가기·390px 모바일 레이아웃");
} finally {
if (browser) await browser.close();
await new Promise(resolve => server.close(resolve));
}
})().catch(function (e) { console.error(e); process.exitCode = 1; });
+100
View File
@@ -0,0 +1,100 @@
// python tests/js/render_help.py && node tests/js/help_ui.test.js (jsdom 필요)
const assert = require("node:assert/strict");
const fs = require("node:fs");
const path = require("node:path");
const { JSDOM } = require("jsdom");
const ROOT = path.resolve(__dirname, "../..");
const html = fs.readFileSync(path.join(__dirname, ".out/help_render.html"), "utf8");
const js = fs.readFileSync(path.join(ROOT, "app/static/project-help.js"), "utf8");
function boot(url) {
const dom = new JSDOM(html, { url: url || "http://localhost/project/help", runScripts: "outside-only" });
const w = dom.window;
w.HTMLElement.prototype.scrollIntoView = function () { w.lastScroll = this.id; };
w.eval(js);
return dom;
}
const dom = boot(), w = dom.window, d = w.document;
const input = d.getElementById("pjh-query");
function search(query) { input.value = query; input.dispatchEvent(new w.Event("input", { bubbles: true })); }
function links() { return Array.from(d.querySelectorAll("#pjh-results a")); }
function reset() { d.getElementById("pjh-search-clear").click(); }
assert.equal(d.querySelectorAll(".pjh-sec").length, 22);
assert.equal(d.querySelectorAll(".pjh-toc a").length, 22);
assert.equal(d.getElementById("pjh-search").hidden, false);
assert.equal(d.getElementById("pjh-results").hidden, true);
const ids = Array.from(d.querySelectorAll("[id]")).map(n => n.id);
assert.equal(new Set(ids).size, ids.length, "앵커 ID는 중복 없음");
Array.from(d.querySelectorAll('.pjh a[href^="#"]')).forEach(function (link) {
assert.ok(d.getElementById(link.getAttribute("href").slice(1)), "도움말 내부 링크 유효");
});
search("셀 병합");
assert.equal(links()[0].hash, "#goals-merge", "소제목 일치를 먼저 표시");
assert.ok(links()[0].querySelector("mark"));
assert.ok(d.querySelector("#goals mark"), "본문도 일치어 강조");
links()[0].click();
assert.equal(w.location.hash, "#goals-merge");
assert.equal(d.activeElement.id, "goals-merge", "결과 클릭은 해당 소제목에 포커스");
assert.equal(w.lastScroll, "goals-merge");
assert.equal(d.querySelector('.pjh-toc [aria-current="location"]').hash, "#goals");
assert.equal(new URL(w.location.href).searchParams.get("q"), "셀 병합");
search("7일 전");
assert.ok(links().some(a => a.hash === "#meetings-review"), "제목에 없는 본문 단어도 검색");
search("쇼핑몰 연결");
assert.equal(links()[0].hash, "#meetings-markets");
d.getElementById("pjh-search-form").dispatchEvent(new w.Event("submit", { bubbles: true, cancelable: true }));
assert.equal(d.activeElement.id, "meetings-markets", "Enter/submit은 첫 결과 이동");
const original = d.getElementById("meetings").textContent;
search("ROAS");
assert.ok(links().some(a => a.hash === "#goals-metrics"), "영문 대소문자 구분 안 함");
search("로아스");
assert.ok(links().length > 0, "한글 검색");
search("원");
assert.ok(links().length > 0, "한 글자 검색");
search(" 쇼핑몰 연결 ");
assert.equal(links()[0].hash, "#meetings-markets", "연속 공백·여러 단어 검색");
search("zz-no-help-match");
assert.equal(links().length, 0);
assert.match(d.getElementById("pjh-search-status").textContent, /결과가 없습니다/);
search("<img src=x onerror=alert(1)>");
assert.equal(links().length, 0, "HTML을 검색어 문자열로만 처리");
assert.equal(d.querySelector('img[src="x"]'), null);
search("[");
assert.equal(links().length, 0, "정규식 특수문자에도 예외 없음");
reset();
assert.equal(input.value, "");
assert.equal(d.getElementById("pjh-results").hidden, true);
assert.equal(d.querySelectorAll("mark.pjh-match").length, 0);
assert.equal(d.getElementById("meetings").textContent, original, "검색·초기화 뒤 원문 보존");
assert.equal(new URL(w.location.href).searchParams.has("q"), false);
assert.equal(d.activeElement, input);
search("분기");
input.dispatchEvent(new w.KeyboardEvent("keydown", { key: "Escape", bubbles: true, cancelable: true }));
assert.equal(input.value, "");
d.body.dispatchEvent(new w.KeyboardEvent("keydown", { key: "/", bubbles: true, cancelable: true }));
assert.equal(d.activeElement, input, "/ 단축키는 도움말 검색");
search("셀 병합");
input.dispatchEvent(new w.CompositionEvent("compositionstart", { bubbles: true }));
input.value = "회의록";
input.dispatchEvent(new w.Event("input", { bubbles: true }));
const before = w.location.hash;
d.getElementById("pjh-search-form").dispatchEvent(new w.Event("submit", { cancelable: true }));
assert.equal(w.location.hash, before, "한글 조합 중 submit은 이동 안 함");
assert.equal(links()[0].hash, "#goals-merge", "조합 중 검색 안 함");
input.dispatchEvent(new w.CompositionEvent("compositionend", { bubbles: true }));
assert.ok(links().some(a => a.hash === "#meetings-intro"), "조합 확정 뒤 검색");
const restored = boot("http://localhost/project/help?q=" + encodeURIComponent("쇼핑몰 연결") + "#meetings-markets");
assert.equal(restored.window.document.getElementById("pjh-query").value, "쇼핑몰 연결");
assert.equal(restored.window.document.activeElement.id, "meetings-markets", "공유 링크·새로고침 복원");
w.history.pushState(null, "", "/project/help?q=" + encodeURIComponent("셀 병합") + "#goals-merge");
w.dispatchEvent(new w.PopStateEvent("popstate"));
assert.equal(input.value, "셀 병합");
assert.equal(d.activeElement.id, "goals-merge", "뒤로 가기 위치·검색 복원");
restored.window.close();
dom.window.close();
console.log("ALL PASS — 도움말 검색·앵커·한글 조합·안전한 문자열·초기화·URL 복원");
+209
View File
@@ -33,6 +33,9 @@ function makeEnv() {
const dom = new JSDOM(html, { runScripts: "dangerously", pretendToBeVisual: true, url: "http://localhost/project/p/1" });
const w = dom.window, d = w.document;
w.__PJ_TEST__ = true;
w.HTMLDialogElement.prototype.showModal = function () { this.open = true; };
w.HTMLDialogElement.prototype.close = function () { this.open = false; this.dispatchEvent(new w.Event("close")); };
Object.defineProperty(d, "fonts", { configurable: true, value: { load: async function () { return [{}]; } } });
w.HTMLCanvasElement.prototype.getContext = function () { return null; };
w.URL.createObjectURL = function () { return "blob:x"; };
w.URL.revokeObjectURL = function () {};
@@ -103,6 +106,7 @@ async function boot(env) {
// 문제없음, 기존 코드 그대로). 테스트에서는 버튼 보강을 건너뛰고 원래 입력칸으로 시험한다.
env.d.querySelectorAll("select").forEach(function (s) { s.dataset.pjEnhanced = "1"; });
env.d.querySelectorAll("input[type=date]").forEach(function (i) { i.dataset.pjDate = "1"; });
env.w.eval(fs.readFileSync(path.join(ROOT, "app", "static", "project-options.js"), "utf8"));
env.w.eval(JS);
env.d.dispatchEvent(new env.w.Event("DOMContentLoaded"));
await settle();
@@ -419,6 +423,211 @@ function titleVal(d) { return d.getElementById("pj-t-title").value; }
check("[01][02] 이 프로젝트 권한 회수 → 작업 비우고 안내", !!d.querySelector(".pj-access-lost") && P.state().tasks.length === 0);
}
// 보드 빠른 추가 — 세 필드, 조합 입력·중복 저장·실패 복구·취소.
{
const env = makeEnv(); baseRoutes(env); const P = await boot(env);
const d = env.d, w = env.w, pending = deferred();
const posts = function () { return env.calls.filter(function (c) { return c.method === "POST" && /projects\/1\/tasks$/.test(c.url); }); };
env.route("POST", /projects\/1\/tasks$/, function () { return pending.promise; });
d.querySelector('.pj-col[data-stage-id="11"] .pj-col-addtask').click(); await wait(10);
let input = d.querySelector(".pj-tasknew-title");
check("[board] 추가는 상세창 대신 이름·담당자·마감일 카드", input && d.getElementById("pj-modal-task").hidden && d.querySelectorAll(".pj-tasknew input").length === 1 && d.querySelectorAll(".pj-tasknew-meta button").length === 2);
input.value = "간단한 새 작업"; input.dispatchEvent(new w.Event("input"));
input.dispatchEvent(new w.KeyboardEvent("keydown", { key: "Enter", isComposing: true, bubbles: true })); await settle();
input.dispatchEvent(new w.KeyboardEvent("keydown", { key: "Enter", keyCode: 229, bubbles: true })); await settle();
check("[board] 한글 조합 중 Enter는 저장하지 않음", posts().length === 0);
input.dispatchEvent(new w.KeyboardEvent("keydown", { key: "Enter", bubbles: true }));
input.dispatchEvent(new w.KeyboardEvent("keydown", { key: "Enter", bubbles: true }));
d.body.dispatchEvent(new w.Event("pointerdown", { bubbles: true })); await settle();
check("[board] 반복 Enter·바깥 클릭에도 저장은 한 번", posts().length === 1 && input.disabled);
d.querySelector('.pj-col[data-stage-id="11"] .pj-col-addtask').click(); await settle();
input = d.querySelector(".pj-tasknew-title");
input.dispatchEvent(new w.KeyboardEvent("keydown", { key: "Enter", bubbles: true })); await settle();
check("[board] 보드 다시 그리는 중에도 저장 상태 유지", input.disabled && input.value === "간단한 새 작업" && posts().length === 1);
check("[board] 생성 요청은 현재 섹션과 세 필드만", Object.keys(posts()[0].body).sort().join(",") === "assignee_email,assignee_name,due_date,stage_id,title" && posts()[0].body.stage_id === 11);
pending.resolve({ body: { task: detail(801, "간단한 새 작업") } }); await settle(); await wait(10);
check("[board] Enter 저장 후 새 카드와 다음 빈 입력 유지", !!d.querySelector('.pj-card[data-task-id="801"]') && d.querySelector(".pj-tasknew-title").value === "");
input = d.querySelector(".pj-tasknew-title");
input.dispatchEvent(new w.KeyboardEvent("keydown", { key: "Escape", bubbles: true })); await settle();
check("[board] Esc는 입력 카드만 취소", !d.querySelector(".pj-tasknew") && posts().length === 1);
d.querySelector('.pj-col[data-stage-id="11"] .pj-col-addtask').click(); await settle();
d.body.dispatchEvent(new w.Event("pointerdown", { bubbles: true })); await wait(10); await settle();
check("[board] 빈 카드 바깥 클릭은 빈 작업 생성 없이 닫기", !d.querySelector(".pj-tasknew") && posts().length === 1);
d.querySelector('.pj-col[data-stage-id="11"] .pj-col-add').click(); await wait(10);
check("[board] 상단 +는 기존 오른쪽 상세창을 열기", !d.getElementById("pj-modal-task").hidden && !d.querySelector(".pj-tasknew"));
await P.attemptClose(); await wait(400);
d.querySelector('.pj-col[data-stage-id="11"] .pj-col-addtask').click(); await wait(10);
input = d.querySelector(".pj-tasknew-title"); input.value = "실패해도 유지"; input.dispatchEvent(new w.Event("input"));
env.route("POST", /projects\/1\/tasks$/, function () { return { status: 500, body: { detail: "잠시 오류" } }; });
d.body.dispatchEvent(new w.Event("pointerdown", { bubbles: true })); await wait(10); await settle();
input = d.querySelector(".pj-tasknew-title");
check("[board] 저장 실패는 입력 복구 후 다시 입력 가능", input && input.value === "실패해도 유지" && !input.disabled);
env.route("POST", /projects\/1\/tasks$/, function (u, b) { return { body: { task: detail(802, b.title) } }; });
d.body.dispatchEvent(new w.Event("pointerdown", { bubbles: true })); await wait(10); await settle();
check("[board] 바깥 클릭 재시도 성공은 입력 닫고 카드 표시", !d.querySelector(".pj-tasknew") && !!d.querySelector('.pj-card[data-task-id="802"]'));
}
// 보드 하위 작업 — 앞·뒤 삽입, 실패 복구, 제자리 무요청, 다른 부모 이동.
{
const env = makeEnv(); baseRoutes(env); const d = env.d, w = env.w;
const subs = [901, 902, 903].map(function (id) { return detail(id, "하위 " + id, { parent_task_id: 101 }); });
env.route("GET", /tasks\/101$/, function () { return { body: { task: detail(101, "작업 A", { subtasks: subs }) } }; });
env.route("PUT", /tasks\/101\/subtasks\/order$/, function () { return { body: { ok: true } }; });
await boot(env);
d.querySelector('.pj-card[data-task-id="101"] .pj-card-subtoggle').click(); await settle();
const rows = function () { return Array.from(d.querySelectorAll('.pj-card[data-task-id="101"] .pj-card-sub')).map(function (r) { return Number(r.dataset.subId); }); };
const calls = function () { return env.calls.filter(function (c) { return /subtasks\/order$/.test(c.url); }); };
async function drag(fromId, toId, after) {
const from = d.querySelector('[data-sub-id="' + fromId + '"]'), to = d.querySelector('[data-sub-id="' + toId + '"]');
to.getBoundingClientRect = function () { return { top: 100, height: 34 }; };
const data = {}; const transfer = { types: [], setData: function (k, v) { data[k] = v; this.types.push(k); }, getData: function (k) { return data[k]; } };
function fire(el, kind) { const e = new w.MouseEvent(kind, { bubbles: true, cancelable: true, clientY: after ? 130 : 105 }); Object.defineProperty(e, "dataTransfer", { value: transfer }); el.dispatchEvent(e); }
fire(from, "dragstart"); fire(to, "dragover");
check("[board] 하위 작업 드래그는 카드 드래그와 분리", !transfer.types.includes("text/plain"));
if (fromId !== toId) check("[board] 삽입 위치 표시", to.classList.contains(after ? "pj-sub-drop-after" : "pj-sub-drop-before"));
fire(to, "drop"); fire(from, "dragend"); await settle();
}
await drag(903, 901, false);
check("[board] 마지막 하위 작업을 맨 앞으로 저장", rows().join(",") === "903,901,902" && calls()[0].body.ordered_ids.join(",") === "903,901,902");
await drag(903, 902, true);
check("[board] 첫 하위 작업을 맨 뒤로 저장", rows().join(",") === "901,902,903");
const before = calls().length; await drag(902, 902, false);
check("[board] 자기 위치에 놓으면 저장하지 않음", calls().length === before);
env.route("PUT", /tasks\/101\/subtasks\/order$/, function () { return { status: 500, body: { detail: "잠시 오류" } }; });
await drag(903, 901, false);
check("[board] 재정렬 실패는 기존 순서 유지·삽입 표시 정리", rows().join(",") === "901,902,903" && !d.querySelector(".pj-sub-drop-before, .pj-sub-drop-after"));
env.route("POST", /tasks\/901\/move-parent$/, function () { return { body: { ok: true } }; });
const from = d.querySelector('[data-sub-id="901"]'), target = d.querySelector('.pj-card[data-task-id="102"]');
const data = {}; const transfer = { types: [], setData: function (k, v) { data[k] = v; this.types.push(k); }, getData: function (k) { return data[k]; } };
["dragstart", "dragover", "drop", "dragend"].forEach(function (kind) { const e = new w.Event(kind, { bubbles: true, cancelable: true }); Object.defineProperty(e, "dataTransfer", { value: transfer }); (kind === "dragstart" || kind === "dragend" ? from : target).dispatchEvent(e); });
await settle();
check("[board] 기존 다른 부모 카드 이동 유지", env.calls.some(function (c) { return /tasks\/901\/move-parent$/.test(c.url) && c.body.parent_task_id === 102; }) && rows().join(",") === "902,903");
}
{
const env = makeEnv(); baseRoutes(env); await boot(env); const d = env.d, w = env.w;
const button = d.getElementById("pj-options-btn"), dialog = d.getElementById("pj-options-dialog"), select = d.getElementById("pj-options-font");
button.click();
check("[옵션] 도움말 옆 옵션은 기본 폰트로 대화창 열기", dialog.open && select.value === "system" && select.options.length === 5);
select.value = "pretendard"; select.dispatchEvent(new w.Event("change")); d.getElementById("pj-options-cancel").click();
check("[옵션] 취소는 선택한 폰트를 적용하지 않음", !dialog.open && !w.localStorage.getItem("pj_font"));
button.click(); select.value = "nanum-square-neo"; d.getElementById("pj-options-save").click(); await settle();
check("[옵션] 저장은 폰트 적용·기억 후 대화창 닫기", !dialog.open && w.localStorage.getItem("pj_font") === "nanum-square-neo" && d.documentElement.dataset.pjFont === "nanum-square-neo");
button.click(); check("[옵션] 다시 열면 저장한 선택 유지", select.value === "nanum-square-neo");
const loading = deferred(); d.fonts.load = function () { return loading.promise; };
select.value = "pretendard"; d.getElementById("pj-options-save").click(); await settle();
const cancel = new w.Event("cancel", { cancelable: true }); dialog.dispatchEvent(cancel);
check("[옵션] 저장 중 취소·Esc로 지연 적용이 발생하지 않음", d.getElementById("pj-options-cancel").disabled && cancel.defaultPrevented && dialog.open);
loading.resolve([{}]); await settle();
check("[옵션] 폰트 로딩 후 저장 완료", !dialog.open && w.localStorage.getItem("pj_font") === "pretendard");
button.click();
d.fonts.load = async function () { throw new Error("font failed"); };
select.value = "nanum-square-round"; d.getElementById("pj-options-save").click(); await settle();
check("[옵션] 폰트 로딩 실패는 이전 설정 유지·재시도 가능", dialog.open && !d.getElementById("pj-options-error").hidden && !select.disabled && w.localStorage.getItem("pj_font") === "pretendard");
}
// 카드 완료 체크 — 상세창과 분리, 중복 요청·실패 복구·읽기 전용.
{
const env = makeEnv(); baseRoutes(env); const d = env.d, w = env.w;
const seed = JSON.parse(d.getElementById("pj-data").textContent);
seed.tasks.find(function (t) { return t.id === 301; }).stage_id = 11;
d.getElementById("pj-data").textContent = JSON.stringify(seed);
const P = await boot(env);
const pending = deferred(); env.route("PUT", /tasks\/101$/, function () { return pending.promise; });
const button = function () { return d.querySelector('.pj-card[data-task-id="101"] .pj-card-check'); };
const puts = function () { return env.calls.filter(function (c) { return c.method === "PUT" && /tasks\/101$/.test(c.url); }); };
check("[카드 완료] 미완료는 선택되지 않은 원형 체크", button().getAttribute("role") === "checkbox" && button().getAttribute("aria-checked") === "false");
button().focus(); button().click(); button().dispatchEvent(new w.MouseEvent("click", { bubbles: true })); await settle();
check("[카드 완료] 체크는 상세창 없이 완료 요청 한 번", puts().length === 1 && puts()[0].body.completed === true && d.getElementById("pj-modal-task").hidden && button().disabled);
pending.resolve({ body: { task: detail(101, "작업 A", { completed_at: "2026-10-02" }) } }); await settle();
check("[카드 완료] 서버 응답 뒤 완료 카드·체크·포커스 반영", !!taskOf(P, 101).completed_at && button().getAttribute("aria-checked") === "true" && !button().disabled && button().closest(".pj-card").classList.contains("is-done") && d.activeElement === button());
env.route("PUT", /tasks\/101$/, function () { return { status: 500, body: { detail: "잠시 오류" } }; });
button().click(); await settle();
check("[카드 완료] 실패하면 완료 상태 유지·버튼 재시도 가능", button().getAttribute("aria-checked") === "true" && !button().disabled && puts()[1].body.completed === false);
env.route("PUT", /tasks\/101$/, function () { return { body: { task: detail(101, "작업 A") } }; });
button().click(); await settle();
check("[카드 완료] 다시 누르면 완료 취소", !taskOf(P, 101).completed_at && button().getAttribute("aria-checked") === "false" && !button().closest(".pj-card").classList.contains("is-done"));
const read = d.querySelector('.pj-card[data-task-id="301"] .pj-card-check'), before = env.calls.length;
check("[카드 완료] 연결된 읽기 전용 작업은 비활성 체크", !!read && read.disabled);
read.dispatchEvent(new w.MouseEvent("click", { bubbles: true })); await settle();
check("[카드 완료] 읽기 전용 체크는 서버 요청을 보내지 않음", env.calls.length === before);
}
{
const env = makeEnv(); baseRoutes(env);
env.w.localStorage.setItem("pj_board_fold:1", '{"id:11":true}');
env.w.localStorage.setItem("pj_side_w", "100");
await boot(env);
const d = env.d, w = env.w;
const col = function () { return d.querySelector('.pj-col[data-stage-id="11"]'); };
const btn = function () { return col().querySelector(".pj-col-collapse"); };
check("[그룹 축소] 저장된 상태로 시작·확장 접근성 표시", col().classList.contains("is-collapsed") && btn().getAttribute("aria-expanded") === "false" && col().querySelector(".pj-col-body").inert);
const before = env.calls.length;
btn().click();
check("[그룹 축소] 펼치기는 작업 변경 없이 상태만 저장", !col().classList.contains("is-collapsed") && btn().getAttribute("aria-expanded") === "true" && env.calls.length === before);
btn().click();
w.dispatchEvent(new w.Event("resize")); await settle();
check("[그룹 축소] 보드 다시 그리기 뒤에도 축소 유지", col().classList.contains("is-collapsed") && /"id:11":true/.test(w.localStorage.getItem("pj_board_fold:1")));
const layout = d.querySelector(".pj-layout"), handle = d.querySelector(".pj-side-resizer");
check("[왼쪽 메뉴] 저장된 좁은 너비는 최소 170px", layout.style.getPropertyValue("--pj-side-w") === "170px");
handle.dispatchEvent(new w.MouseEvent("mousedown", { bubbles: true, button: 0, clientX: 200 }));
d.dispatchEvent(new w.MouseEvent("mousemove", { bubbles: true, clientX: 100 }));
d.dispatchEvent(new w.MouseEvent("mouseup", { bubbles: true }));
check("[왼쪽 메뉴] 드래그 최소 너비·저장", layout.style.getPropertyValue("--pj-side-w") === "170px" && w.localStorage.getItem("pj_side_w") === "170");
handle.dispatchEvent(new w.KeyboardEvent("keydown", { bubbles: true, key: "ArrowRight" }));
check("[왼쪽 메뉴] 방향키 너비 조절", layout.style.getPropertyValue("--pj-side-w") === "180px");
// 프레임을 직접 진행시켜 빠른 마우스 이동과 놓는 순간의 순서를 검증한다.
const realRaf = w.requestAnimationFrame, realCancel = w.cancelAnimationFrame;
let nextFrame = 0, resizeCount = 0;
const frames = new Map();
w.requestAnimationFrame = function (fn) { frames.set(++nextFrame, fn); return nextFrame; };
w.cancelAnimationFrame = function (id) { frames.delete(id); };
function paint() {
const batch = Array.from(frames.values()); frames.clear(); batch.forEach(function (fn) { fn(); });
}
w.addEventListener("resize", function () { resizeCount++; });
function down(x) { handle.dispatchEvent(new w.MouseEvent("mousedown", { bubbles: true, button: 0, clientX: x })); }
function move(x) { d.dispatchEvent(new w.MouseEvent("mousemove", { bubbles: true, clientX: x })); }
function up() { d.dispatchEvent(new w.MouseEvent("mouseup", { bubbles: true })); }
down(200); move(220); move(240); move(260);
check("[왼쪽 메뉴] 빠른 이동은 프레임 하나로 모으고 전체 재계산 없음", frames.size === 1 && resizeCount === 0 && handle.getAttribute("aria-valuenow") === "180");
paint();
check("[왼쪽 메뉴] 프레임에서 최신 위치만 즉시 표시", layout.style.getPropertyValue("--pj-side-w") === "240px" && resizeCount === 0);
move(290); up();
check("[왼쪽 메뉴] 놓는 순간 마지막 위치 반영·한 번 재계산·콜백 정리", layout.style.getPropertyValue("--pj-side-w") === "270px" && w.localStorage.getItem("pj_side_w") === "270" && resizeCount === 1 && frames.size === 0 && !d.documentElement.classList.contains("pj-side-resizing"));
move(400); paint();
check("[왼쪽 메뉴] 종료 뒤 이동은 너비를 바꾸지 않음", handle.getAttribute("aria-valuenow") === "270");
d.documentElement.classList.add("pj-ui-scale");
down(200); move(230); paint(); up();
check("[왼쪽 메뉴] 75% 화면 배율에서도 이동 거리 보정", handle.getAttribute("aria-valuenow") === "310" && resizeCount === 2);
d.documentElement.classList.remove("pj-ui-scale");
down(200); move(1000); paint(); move(1100); paint(); up();
check("[왼쪽 메뉴] 최대 500px·중복 프레임은 재계산 없음", handle.getAttribute("aria-valuenow") === "500" && resizeCount === 3);
down(200); move(300); paint(); up();
check("[왼쪽 메뉴] 한계에서 너비가 그대로면 재계산 생략", resizeCount === 3);
down(200); move(150); w.dispatchEvent(new w.Event("blur"));
check("[왼쪽 메뉴] 창 포커스를 잃어도 저장·드래그 정리", handle.getAttribute("aria-valuenow") === "450" && w.localStorage.getItem("pj_side_w") === "450" && resizeCount === 4 && frames.size === 0 && !handle.classList.contains("is-dragging"));
handle.dispatchEvent(new w.KeyboardEvent("keydown", { bubbles: true, key: "Home" }));
handle.dispatchEvent(new w.KeyboardEvent("keydown", { bubbles: true, key: "ArrowLeft" }));
check("[왼쪽 메뉴] Home 최소값·한계 방향키 재계산 생략", handle.getAttribute("aria-valuenow") === "170" && resizeCount === 5);
handle.dispatchEvent(new w.MouseEvent("dblclick", { bubbles: true }));
check("[왼쪽 메뉴] 더블클릭 기본 너비·저장값 초기화", !layout.style.getPropertyValue("--pj-side-w") && handle.getAttribute("aria-valuenow") === "250" && w.localStorage.getItem("pj_side_w") === null && resizeCount === 6);
// jsdom에는 레이아웃이 없으므로 좁은 창의 CSS 기본 너비(220px)를 직접 제공한다.
d.querySelector(".pj-side").getBoundingClientRect = function () { return { width: 220 }; };
handle.dispatchEvent(new w.KeyboardEvent("keydown", { bubbles: true, key: "ArrowRight" }));
check("[왼쪽 메뉴] 기본값 복원 뒤 창 크기가 바뀌면 현재 너비에서 조절", handle.getAttribute("aria-valuenow") === "230" && resizeCount === 7);
w.requestAnimationFrame = realRaf; w.cancelAnimationFrame = realCancel;
const input = d.getElementById("pj-cm-input");
Object.defineProperty(input, "scrollHeight", { value: 300 });
input.value = "첫 줄\n둘째 줄\n셋째 줄"; input.dispatchEvent(new w.Event("input", { bubbles: true }));
check("[댓글] 긴 글도 높이 70px·내부 스크롤", input.style.height === "70px" && input.style.overflowY === "auto");
input.value = ""; input.dispatchEvent(new w.Event("input", { bubbles: true }));
check("[댓글] 비운 뒤에도 높이 70px", input.style.height === "70px");
}
{
const env = makeEnv(); baseRoutes(env);
env.w.localStorage.setItem("pj_side_w", "250"); await boot(env);
check("[왼쪽 메뉴] 저장값이 기본 너비와 같아도 명시적으로 복원", env.d.querySelector(".pj-layout").style.getPropertyValue("--pj-side-w") === "250px");
}
clearTimeout(WATCHDOG);
console.log(fails.length ? "\nFAILED: " + fails.join(", ") : "\nALL PASS");
process.exit(fails.length ? 1 : 0);
+1 -1
View File
@@ -21,7 +21,7 @@ OUT_DIR = os.path.join(ROOT, "tests", "js", ".out")
from app.modules.project import store # noqa: E402
from app.modules.project.router import _goal_area_layout, _goal_label_spans # noqa: E402
BASE_STUB = ("{% block head_extra %}{% endblock %}<body>{% block topbar_actions %}{% endblock %}"
BASE_STUB = ("{% block head_extra %}{% endblock %}<body>{% block topbar_after_logout %}{% endblock %}{% block topbar_actions %}{% endblock %}"
"<main class='erp-page'>{% block content %}{% endblock %}</main></body>")
ME = "me@test.local"
+25
View File
@@ -0,0 +1,25 @@
"""실제 ERP 기본 템플릿으로 도움말을 렌더한다. DB·운영 사용자 데이터 미사용.
python tests/js/render_help.py -> tests/js/.out/help_render.html
"""
from pathlib import Path
import jinja2
ROOT = Path(__file__).resolve().parents[2]
env = jinja2.Environment(
loader=jinja2.ChoiceLoader([
jinja2.FileSystemLoader(ROOT / "app/modules/project/templates"),
jinja2.FileSystemLoader(ROOT / "app/templates"),
]),
autoescape=jinja2.select_autoescape(["html"]),
)
html = env.get_template("project/help.html").render(
user={"email": "reader@test.local", "name": "Reader", "is_super_admin": False},
is_admin=False, nav_items=[], force_sidebar_collapsed=True,
page_title="프로젝트 관리 도움말", page_subtitle="처음 쓰는 분을 위한 기능 안내",
)
out = ROOT / "tests/js/.out/help_render.html"
out.parent.mkdir(parents=True, exist_ok=True)
out.write_text(html, encoding="utf-8")
print("rendered:", out)
+1 -1
View File
@@ -13,7 +13,7 @@ import jinja2
ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
OUT_DIR = os.path.join(ROOT, "tests", "js", ".out")
BASE_STUB = ("{% block head_extra %}{% endblock %}<body>{% block topbar_actions %}{% endblock %}"
BASE_STUB = ("{% block head_extra %}{% endblock %}<body>{% block topbar_after_logout %}{% endblock %}{% block topbar_actions %}{% endblock %}"
"<main class='erp-page'>{% block content %}{% endblock %}</main></body>")
ME = "me@test.local"
+179
View File
@@ -0,0 +1,179 @@
"""셀 이동의 실제 저장소/라우터 로직을 트랜잭션 대역으로 검증(실제 PostgreSQL 테스트는 test_project_module.py)."""
import copy
import importlib
import json
import unittest
from contextlib import contextmanager
from types import SimpleNamespace
from unittest.mock import patch
from fastapi import FastAPI
from fastapi.testclient import TestClient
from app.modules.project import store
from app.modules.project.db import ProjectStore
api_module = importlib.import_module("app.modules.project.router")
class Rows:
def __init__(self, rows=()):
self.rows = list(rows)
def fetchall(self):
return self.rows
def fetchone(self):
return self.rows[0] if self.rows else None
class Connection:
def __init__(self):
self.rows = {10: {"id": 10, "area_id": 2, "year": 2026}, 20: {"id": 20, "area_id": 1, "year": 2026}}
self.cells = {(10, 1): "original", (20, 2): "existing"}
self.calls, self.commits, self.rollbacks = [], 0, 0
self.fail_delete = False
self.transaction_depth = 0
@contextmanager
def transaction(self):
before = copy.deepcopy(self.cells)
self.transaction_depth += 1
try:
yield self
except Exception:
self.cells = before
self.rollbacks += 1
raise
else:
self.commits += 1
finally:
self.transaction_depth -= 1
def execute(self, sql, params):
self.calls.append((sql, params))
if sql.startswith("SELECT r.id, r.area_id, a.year"):
return Rows(self.rows[r] for r in set(params[0]) if r in self.rows)
if sql.startswith("SELECT id FROM goal_areas"):
return Rows({"id": a} for a in params[0])
if sql.startswith("SELECT id, area_id FROM goal_rows"):
return Rows(self.rows[r] for r in sorted(set(params[0])) if r in self.rows)
if sql.startswith("SELECT row_id, month, body"):
keys = [(params[0], params[1]), (params[2], params[3])]
return Rows({"row_id": r, "month": m, "body": self.cells[r, m]} for r, m in keys if (r, m) in self.cells)
if sql.startswith("INSERT INTO goal_cells"):
assert self.transaction_depth > 0, "Cell writes must hold the area lock until commit"
self.cells[params[0], params[1]] = params[2]
return Rows()
if sql.startswith("DELETE FROM goal_cells"):
assert self.transaction_depth > 0, "Cell writes must hold the area lock until commit"
if self.fail_delete:
raise RuntimeError("simulated delete failure")
self.cells.pop((params[0], params[1]), None)
return Rows()
if sql.startswith("SELECT a.id AS area_id"):
assert self.transaction_depth > 0, "Autocommit releases the area lock before the write"
row = self.rows.get(params[0])
return Rows([{"area_id": row["area_id"]}] if row else [])
raise AssertionError("Unexpected SQL: " + sql)
class GoalMoveTests(unittest.TestCase):
def setUp(self):
self.conn = Connection()
@contextmanager
def connection():
yield self.conn
self.st = ProjectStore.__new__(ProjectStore)
self.st._pool = SimpleNamespace(connection=connection)
self.st._table_exists = lambda conn, name: True
self.st._goal_quarters = lambda conn: True
self.merges = {}
self.st._area_geometry = lambda conn, area: (
[r for r in self.conn.rows if self.conn.rows[r]["area_id"] == area], self.merges.get(area, []), True)
self.payload = dict(source_row=10, source_month=1, target_row=20, target_month=2,
source_body="original", target_body="existing", body="original", updated_by="ADMIN@TEST.LOCAL")
def move(self, **changes):
return self.st.move_goal_cell(**(self.payload | changes))
def test_move_preserves_all_explicit_formats_and_locks_in_order(self):
rich = store.validate_goal_text(store.GOAL_RICH_PREFIX + json.dumps([
{"text": "formatted", "bold": True, "italic": True, "underline": True, "size": 24, "color": "#ff0000"}]))
self.conn.cells[10, 1] = rich
self.assertEqual(self.move(source_body=rich, body=rich), rich)
self.assertNotIn((10, 1), self.conn.cells)
self.assertEqual(self.conn.cells[20, 2], rich)
self.assertEqual(self.conn.commits, 1)
self.assertTrue(any("goal_areas" in sql and "FOR UPDATE" in sql and p == ([1, 2],) for sql, p in self.conn.calls))
def test_failure_after_target_write_rolls_back_both_cells(self):
before = dict(self.conn.cells)
self.conn.fail_delete = True
with self.assertRaises(RuntimeError):
self.move()
self.assertEqual(self.conn.cells, before)
self.assertEqual(self.conn.rollbacks, 1)
def test_concurrent_change_in_either_cell_aborts_without_writes(self):
for key in ((10, 1), (20, 2)):
with self.subTest(key=key):
self.setUp()
self.conn.cells[key] = "another user's edit"
before = dict(self.conn.cells)
with self.assertRaises(store.GoalCellConflict):
self.move()
self.assertEqual(self.conn.cells, before)
def test_lost_response_retry_succeeds_without_writing_again(self):
self.move()
count = len([sql for sql, _ in self.conn.calls if sql.startswith(("INSERT", "DELETE"))])
self.assertEqual(self.move(), "original")
self.assertEqual(len([sql for sql, _ in self.conn.calls if sql.startswith(("INSERT", "DELETE"))]), count)
def test_empty_target_and_defaults_become_explicit_styles(self):
self.conn.cells.pop((20, 2))
rich = store.GOAL_RICH_PREFIX + json.dumps([{"text": "original", "bold": False, "size": 14, "color": "#050505"}])
result = self.move(target_body="", body=rich)
self.assertEqual(store.goal_text_plain(result), "original")
self.assertIn('"bold":false', result)
def test_bad_content_missing_rows_wrong_year_and_hidden_merge_cell(self):
for changes, error in [({"body": "different"}, ValueError), ({"target_row": 999}, KeyError),
({"target_month": 17}, ValueError), ({"target_row": 10, "target_month": 1}, ValueError)]:
with self.subTest(changes=changes), self.assertRaises(error):
self.move(**changes)
self.conn.rows[20]["year"] = 2027
with self.assertRaises(ValueError):
self.move()
self.conn.rows[20]["year"] = 2026
self.merges[1] = [{"r0": 0, "r1": 0, "c0": 1, "c1": 2}]
with self.assertRaises(store.GoalCellConflict):
self.move()
def test_normal_save_uses_the_same_area_lock(self):
self.st.set_goal_cell(row_id=10, month=1, body="new")
self.assertIn("FOR UPDATE OF a", self.conn.calls[0][0])
self.assertEqual(self.conn.cells[10, 1], "new")
self.assertEqual(self.conn.commits, 1)
def test_http_admin_permissions_validation_and_conflict_status(self):
app = FastAPI()
app.include_router(api_module.router)
app.state.project_store = self.st
client = TestClient(app)
payload = {k: v for k, v in self.payload.items() if k != "updated_by"}
with patch.object(api_module, "_require_user", return_value={"email": "a@test.local", "role": "user"}):
self.assertEqual(client.post("/project/api/goals/cells/move", json=payload).status_code, 403)
with patch.object(api_module, "_require_user", return_value={"email": "a@test.local", "role": "admin"}):
self.assertEqual(client.post("/project/api/goals/cells/move", json=payload | {"source_body": None}).status_code, 400)
self.conn.cells[20, 2] = "changed"
self.assertEqual(client.post("/project/api/goals/cells/move", json=payload).status_code, 409)
self.conn.cells[20, 2] = "existing"
result = client.post("/project/api/goals/cells/move", json=payload)
self.assertEqual(result.status_code, 200)
self.assertEqual(result.json(), {"ok": True, "body": "original"})
if __name__ == "__main__":
unittest.main()
+54
View File
@@ -0,0 +1,54 @@
import json
import unittest
from app.modules.project import store
def rich(runs):
return store.GOAL_RICH_PREFIX + json.dumps(runs, ensure_ascii=False)
class GoalRichTextTests(unittest.TestCase):
def test_selected_styles_are_safe_and_legacy_text_stays_literal(self):
body = rich([{"text": "<img src=x onerror=alert(1)>", "bold": True,
"color": "#FF0000", "size": 20, "onclick": "alert(1)"},
{"text": " untouched", "color": "url(javascript:x)", "size": 99}])
stored = store.validate_goal_text(body)
html = store.goal_text_html(stored)
assert '&lt;img' in html and '<img' not in html
assert 'font-weight:700' in html and 'color:#ff0000' in html and 'font-size:20px' in html
assert 'javascript' not in html and 'onclick' not in stored and '99px' not in html
assert store.goal_text_html('<b>legacy</b>') == '&lt;b&gt;legacy&lt;/b&gt;'
def test_rich_merge_preserves_styles_and_plain_meeting_plan(self):
value = store.merge_goal_texts(['first', rich([{"text": "second", "bold": True, "size": 18}])])
assert store.goal_text_plain(value) == 'first\nsecond'
assert 'font-size:18px' in store.goal_text_html(value)
assert store.merge_goal_texts(['a', 'b']) == 'a\nb'
assert store.validate_goal_text(rich([{"text": " "}])) == ''
def test_italic_and_underline_survive_save_render_and_merge(self):
body = rich([{"text": "<선택>", "italic": True, "underline": True, "size": 16},
{"text": "해제", "italic": False, "underline": False},
{"text": "invalid", "italic": "url(javascript:x)", "underline": 1}])
stored = store.validate_goal_text(body)
runs = store.goal_text_runs(stored)
assert runs[0]["italic"] is True and runs[0]["underline"] is True
assert runs[1]["italic"] is False and runs[1]["underline"] is False
assert runs[2] == {"text": "invalid"}
html = store.goal_text_html(stored)
assert '&lt;선택&gt;' in html and 'font-style:italic' in html and 'text-decoration:underline' in html
assert 'font-style:normal' in html and 'text-decoration:none' in html
assert 'javascript' not in stored
merged = store.merge_goal_texts([stored, 'plain'])
assert store.goal_text_runs(merged)[0]["underline"] is True
assert store.goal_text_plain(merged) == '<선택>해제invalid\nplain'
def test_rich_payload_limits_and_malformed_data(self):
with self.assertRaises(ValueError):
store.validate_goal_text(rich([{"text": "x" * (store.GOAL_TEXT_MAX + 1)}]))
with self.assertRaises(ValueError):
store.validate_goal_text(store.GOAL_RICH_PREFIX + '{"unexpected":1}')
with self.assertRaises(ValueError):
store.validate_goal_text(store.GOAL_RICH_PREFIX + '[broken')
+49
View File
@@ -499,6 +499,55 @@ def test_store_goal_quarters_unit():
# ════════════════════════════════════════════════════════════
# 연간 목표 — 상·하반기 글 칸 · 월 칸 병합(마이그레이션 014) · 로아스 % 표기
# ════════════════════════════════════════════════════════════
def test_goal_cell_content_move():
"""실제 PostgreSQL: 서식 포함 이동·동시 이동 충돌·권한·병합 가림·응답 유실 재시도."""
from app.modules.project import store
year = 2060 + int(RUN, 16) % 40
assert req("POST", "/project/api/goals/years", ADMIN, json={"year": year}).status_code == 201
try:
board = ST.get_goal_board(year=year)
rid = board["areas"][0]["rows"][0]["id"]
rich = store.validate_goal_text(store.GOAL_RICH_PREFIX + '[{"text":"move","color":"#ff0000","size":24,"bold":true,"italic":true,"underline":true}]')
ST.set_goal_cell(row_id=rid, month=1, body=rich)
payload = {"source_row": rid, "source_month": 1, "target_row": rid, "target_month": 2,
"source_body": rich, "target_body": "", "body": rich}
endpoint = "/project/api/goals/cells/move"
assert req("POST", endpoint, BOB, json=payload).status_code == 403
assert req("POST", endpoint, ADMIN, json=payload | {"target_month": 17}).status_code == 400
ST.set_goal_cell(row_id=rid, month=2, body="another edit")
assert req("POST", endpoint, ADMIN, json=payload).status_code == 409
ST.set_goal_cell(row_id=rid, month=2, body="")
assert req("POST", endpoint, ADMIN, json=payload).json() == {"ok": True, "body": rich}
assert req("POST", endpoint, ADMIN, json=payload).status_code == 200
cells = ST.get_goal_board(year=year)["areas"][0]["rows"][0]["cells"]
assert 1 not in cells and cells[2] == rich
# 같은 원본을 서로 다른 대상으로 동시에 이동하면 한 요청만 성공한다.
ST.set_goal_cell(row_id=rid, month=1, body=rich)
ST.set_goal_cell(row_id=rid, month=2, body="")
barrier = threading.Barrier(2)
results = []
def move_to(month):
barrier.wait()
try:
ST.move_goal_cell(source_row=rid, source_month=1, target_row=rid, target_month=month,
source_body=rich, target_body="", body=rich, updated_by=ADMIN)
results.append("ok")
except store.GoalCellConflict:
results.append("conflict")
workers = [threading.Thread(target=move_to, args=(m,)) for m in (2, 3)]
for t in workers: t.start()
for t in workers: t.join(timeout=10)
assert sorted(results) == ["conflict", "ok"], results
aid = board["areas"][0]["id"]
ST.merge_goal_rect(area_id=aid, row_from=rid, row_to=rid, col_from=4, col_to=5)
hidden = payload | {"source_month": 2 if 2 in ST.get_goal_board(year=year)["areas"][0]["rows"][0]["cells"] else 3,
"target_month": 5}
assert req("POST", endpoint, ADMIN, json=hidden).status_code == 409
finally:
ST.delete_goal_year(year=year)
def test_goal_halves_and_merges():
year = 2060 + int(RUN, 16) % 40
ST.delete_goal_year(year=year) if year in ST.list_goal_years() else None