Skip to content

어포던스: 제품 최전선을 API와 사용법으로 연다 - #457

Merged
developer-1px merged 14 commits into
issue-454-widget-bindingsfrom
issue-456-affordance
Aug 20, 2026
Merged

어포던스: 제품 최전선을 API와 사용법으로 연다#457
developer-1px merged 14 commits into
issue-454-widget-bindingsfrom
issue-456-affordance

Conversation

@developer-1px

@developer-1px developer-1px commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Closes #456

기반: #455

제품이 json-document를 만지는 최전선이 어포던스다. 입구는 API와 쓰는 법이고, 이름은 손동작이다.

Goal Anchor

  • Outcome: 제품이 json-document를 만지는 최전선이 어포던스다. 입구는 API와 쓰는 법이고, 이름은 손동작이다.
  • Done: 어포던스 사용법·API가 공개 입구다. 선반이 고르기·접기·드래그·되돌리기처럼 행동으로 설명된다. 라이브는 usage의 증명이다. 호스트는 마크업과 장르 Intent만 가진다. 키보드·마우스 문법은 제품마다 열리지 않는다.
  • Don't: Listbox/Tree를 가져가는 상품으로 두지 않는다. 데모 카탈로그를 입구로 두지 않는다. Adapter의 chord 번역과 Connector의 구독을 어포던스에 합치지 않는다. 손의 문법을 호스트 정책으로 남겨 두지 않는다.

Canonical Mapping

  • 고르기 = select
  • 접기 = fold
  • 드래그 = drag
  • 되돌리기 = undo/redo

Usage grammar (v1.1–1.5)

호스트는 시점을 고른다. 패키지는 읽는 법을 하나만 허용한다.

applyAffordance(pointerSelect(event), {
  hand: (hand) => {
    if (hand.type === "select") editor.dispatch({ type: "selection.set", itemId, mode: hand.operation });
  },
});

const committed = commitAffordance(dragAffordance(origin, point));
if (committed) {
  applyAffordance(committed, {
    commit: (hand) => { /* write */ },
  });
}
  • Preview는 { hand, cursor? }. commit: truecommitAffordance만 민트한다.
  • 공개 export에 unwrap이 없다.
  • 위젯 증명과 Hands 제품 데모(Order, Object, Canvas, Tree, Document, Sheet, Board/Kanban, Database, History, Topology)가 그 한 줄을 쓴다.

Don't

위젯 키트, useAffordance, Adapter/Connector 합병, useEditing.keyboard.resolve 시그니처 변경, TBD 화면 크롬, Hands 완전 편집기 교체, apply에 phase를 넣기.

Selection 데모의 모드 토글, Clipboard 데모의 replace-only, rich-text caret, Connector/Adapter 랩은 이 PR 밖이다.

검증

  • npm test -w @interactive-os/json-document-affordance (12 passed)
  • npm run typecheck -w @interactive-os/json-document-affordance
  • npm run docs:evaluate
  • npm run typecheck -w @interactive-os/json-document-site
  • npm test -w @interactive-os/json-document-site (32 passed)
  • npx playwright test --config site/playwright.config.ts site/tests/browser/widgets.spec.ts site/tests/browser/editor-slice-demos.spec.ts (16 passed)
  • npx playwright test --config site/playwright.config.ts site/tests/browser/document-demo.spec.ts site/tests/browser/sheet-demo.spec.ts site/tests/browser/database-demo.spec.ts site/tests/browser/editing-demos.spec.ts (included in later 19-pass run with editor-slice)

키보드·마우스 손의 정본을 패키지로 두고, 사이트 입구를 고르기·접기·드래그·되돌리기
사용법으로 바꾼다. 위젯 화면은 증명으로만 남긴다.
유용태 added 13 commits August 20, 2026 21:24
공개 문서의 .md 링크를 사이트 경로로 잇고, Grid·Document가 호스트
keymap이 아니라 pointerSelect와 resolveAffordanceKey를 쓰게 한다.
CSS UI 커서 집합, Pointer Events, APG 키보드 관례로 손을 닫고,
구현 없는 손은 사용법 페이지로만 남긴다.
APG·CSS UI·Pointer Events가 쓰는 말을 그대로 쓰고, URL 슬러그는 유지한다.
패키지 구현은 아직 없다. 호스트가 넘긴 사실만 받아 손을 닫는 API를
페이지마다 가상 usage로 고정한다.
함수 반환값만 보이지 않게, 손은 문서 작업이거나 커서·접힘·뷰포트 같은
호스트 화면 상태가 된다.
모든 손은 AffordanceResult를 돌리고 applyAffordance로 잇는다.
Listbox typeahead와 Canvas drag/marquee/nudge가 그 usage로 동작한다.
호스트는 시점을 고르고, 패키지는 applyAffordance로만 읽는다.
없는 손은 유니온에서 빼고, 위젯 증명은 result.commit을 보지 않는다.
손 함수는 Preview만 돌린다. 제품 데모는 applyAffordance로만 읽는다.
Order·Object·Tree·Document·Sheet·Database와 History·Topology가
pointerSelect를 같은 한 줄로 읽는다.
파이프라인은 Document에서 Affordance까지다. 증명 카피에서 Widget을 뺀다.
@developer-1px
developer-1px merged commit d29d579 into issue-454-widget-bindings Aug 20, 2026
2 checks passed
@developer-1px
developer-1px deleted the issue-456-affordance branch August 20, 2026 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant