feat(project): 연간 목표 모든 열 너비 조절·지표 줄 틀 고정·항목 줄 위/아래 추가·삭제

- 연간·1~12월·상/하반기 열도 머리 칸 오른쪽 끝을 끌어 너비 조절(더블클릭 = 기본), localStorage pj_goal_col_w
  에 기본값과 다른 칸만 저장. 반기 접기 애니메이션의 안쪽 고정 폭은 --fold-w(병합 칸 = 걸친 월 너비 합)
- 세로 스크롤 틀 고정: 머리 줄 + 매출·로아스 지표 줄까지 sticky(줄마다 --kpi-top, stickKpi)
- 항목 칸 도구 막대에 + (아래에 줄 추가) 항상 표시, 우클릭 메뉴로 위/아래 줄 추가·줄 삭제
- POST /api/goals/areas/{id}/rows 에 ref_row_id·place(above|below) — 기준 줄 위/아래에 넣고 순서 다시 매김
- project.css/js 캐시 버전 20261001b, 문서·회귀 테스트 갱신

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-01 09:11:55 +09:00
parent 5d07770ce2
commit d3761183c3
13 changed files with 200 additions and 60 deletions
+33 -10
View File
@@ -2071,18 +2071,41 @@ class ProjectStore:
def move_goal_row(self, *, row_id: int, direction: int) -> None:
self._move_goal_item("goal_rows", "area_id", row_id, direction)
def add_goal_row(self, *, area_id: int, label: str = "") -> int:
def add_goal_row(
self, *, area_id: int, label: str = "", ref_row_id: int | None = None, place: str = "below"
) -> int:
"""줄 추가 — 기준 줄(ref_row_id)이 있으면 그 줄 위(place="above")/아래("below")에, 없으면 영역 맨 끝에."""
lb = store.validate_goal_row_label(label)
if place not in ("above", "below"):
raise ValueError("place 는 above 또는 below 입니다.")
with self._pool.connection() as conn:
if not conn.execute("SELECT 1 FROM goal_areas WHERE id = %s", (area_id,)).fetchone():
raise KeyError(area_id)
rid = conn.execute(
"INSERT INTO goal_rows (area_id, label, sort_order) VALUES (%s, %s, "
"(SELECT COALESCE(MAX(sort_order), -1) + 1 FROM goal_rows WHERE area_id = %s)) "
"RETURNING id",
(area_id, lb, area_id),
).fetchone()["id"]
return int(rid)
with conn.transaction():
if not conn.execute(
"SELECT 1 FROM goal_areas WHERE id = %s FOR UPDATE", (area_id,)
).fetchone():
raise KeyError(area_id)
if ref_row_id is None:
rid = conn.execute(
"INSERT INTO goal_rows (area_id, label, sort_order) VALUES (%s, %s, "
"(SELECT COALESCE(MAX(sort_order), -1) + 1 FROM goal_rows WHERE area_id = %s)) "
"RETURNING id",
(area_id, lb, area_id),
).fetchone()["id"]
return int(rid)
ids = [int(r["id"]) for r in conn.execute(
"SELECT id FROM goal_rows WHERE area_id = %s ORDER BY sort_order, id", (area_id,)
).fetchall()]
if ref_row_id not in ids:
raise KeyError(ref_row_id)
rid = int(conn.execute(
"INSERT INTO goal_rows (area_id, label, sort_order) VALUES (%s, %s, 0) RETURNING id",
(area_id, lb),
).fetchone()["id"])
i = ids.index(ref_row_id) + (1 if place == "below" else 0)
ids.insert(i, rid)
for n, x in enumerate(ids):
conn.execute("UPDATE goal_rows SET sort_order = %s WHERE id = %s", (n, x))
return rid
def update_goal_row(self, *, row_id: int, label: str) -> None:
lb = store.validate_goal_row_label(label)