본문으로 건너뛰기
cccskills
무료GitHub에 공개

walkontable-dev

Modify Handsontable’s Walkontable rendering engine using its architecture and coding rules. The skill covers visible-area calculations, frozen rows and columns, scroll synchronization, browser element measurements, and tests for rendering changes.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

Use when modifying the Walkontable rendering engine in src/3rdparty/walkontable/ - overlay system, viewport calculations, scroll handling, DOM management, or the TableView bridge between core Handsontable and Walkontable

설치 방법 보기

이럴 때 유용합니다

  • Fix rendering issues with frozen rows and columns
  • Change viewport calculations or row and column sizing
  • Review scroll synchronization and redraw timing
  • Refactor dependencies and browser element measurements

포함된 파일(1)

  • SKILL.md11.9 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Walkontable Development Guide

Walkontable is the rendering engine (viewport calculation, DOM rendering, scroll sync, overlays). Rules and traps live in handsontable/src/3rdparty/walkontable/AGENTS.md; architecture in handsontable/src/3rdparty/walkontable/.ai/ARCHITECTURE.md and .ai/CONCERNS.md.

Architecture boundary

Source is TypeScript in src/3rdparty/walkontable/src/, excluded from the main tsconfig.json, with its own build/test pipeline. The bridge to core is TableView in src/tableView.ts. Plugins and core reach Walkontable only through TableView or the public Core API. Inside Walkontable, wrap DOM logic in abstraction modules.

Dependency injection and DOM geometry reads (mandatory, lint-enforced)

Dependency injection

wire.ts is the single composition root: buildContext(wot) returns an EngineContext. Each module has a co-located factory create<Module>Deps(ctx); its type is inferred.

// scroll/scroll.ts: the only place Scroll's deps are declared
export function createScrollDeps(ctx: EngineContext) {
  return { wtSettings: ctx.wtSettings, geometryReader: ctx.geometryReader, getWtTable: ctx.getWtTable /* … */ };
}
export type ScrollDeps = ReturnType<typeof createScrollDeps>;

class Scroll {
  #deps: ScrollDeps;
  constructor(deps: ScrollDeps) { this.#deps = deps; }
}
  • Store deps in private #deps; take a single deps constructor argument (plus at most one per-instance identity arg: table name, overlay type, event parent, corner-overlay sibling refs).
  • Infer the *Deps type with ReturnType<typeof createXDeps>.
  • Add a read-only get deps() over #deps only where JS forces external reach: a base class whose subclasses need it (Overlay), runtime mixins (Table), or a helper read by a collaborator (RowUtils, ColumnUtils).
  • Inject the stable owner (getWtViewport()). Volatile per-draw objects (calculator, filter) go stale; read volatile ranges fresh off the owner (see the rowRangeQuery/columnRangeQuery mixins in table/rangeQuery/virtualRange.ts).
  • Copy an existing module to add one; scroll/scroll.ts is the simplest template.

DOM geometry reads go through the GeometryReader proxy

Layout-forcing reads go through the injected reader: getBoundingClientRect, getClientRects, getComputedStyle, offsetWidth/offsetHeight/offsetTop/offsetLeft/offsetParent, clientWidth/clientHeight, scrollWidth/scrollHeight, and the helpers/dom/element measurement helpers (offset, outerWidth/outerHeight, element innerWidth/innerHeight, getMaximumScrollTop/getMaximumScrollLeft, getScrollbarWidth, getStyle). The reader is the seam a future per-draw CachingGeometryReader replaces.

Scroll-position and window-viewport reads are read directly: scrollX/scrollY/pageXOffset/pageYOffset, element scrollTop/scrollLeft, window innerWidth/innerHeight. For a polymorphic element-or-window scroll position use the raw getScrollLeft/getScrollTop helper (it also survives an iframe realm boundary, where the instanceof Window-gated helper returns undefined).

const rect = this.#deps.geometryReader.getBoundingClientRect(el);
const w = this.#deps.geometryReader.offsetWidth(el);
const top = rootWindow.scrollY;       // direct

Reader handles: this.#deps.geometryReader (most modules), this.deps.geometryReader (overlays/table), wotInstance.domBindings.geometryReader when only the instance is in hand (utils/pointerToCoords.ts, selection/border/border.ts).

Writes (el.scrollTop = n, el.style.x = …) and this.<field> (stored state, even when named clientHeight/scrollTop) are direct.

When the proxy lacks a method for a layout-forcing read, add it to both domMeasure/geometryReader.ts (interface) and domMeasure/liveGeometryReader.ts (live adapter), then use it.

ESLint rule handsontable/no-direct-dom-geometry-read (error) covers all of src/3rdparty/walkontable/src except domMeasure/**. The rule lives in handsontable/.config/plugin/eslint/rules/ and is a pnpm file: dependency that is copied, not symlinked: after editing the rule (or on a checkout that predates it) run pnpm install, or eslint fails with "definition not found".

Key subsystems

  • Overlay system (6 types): frozen rows/columns and scroll sync. Fragile; read .ai/CONCERNS.md before touching overlay positioning or synchronization.
  • Viewport calculation, Renderer (DOM element reuse, painting), Scroll handling (requestAnimationFrame batching).

Single-pass layout and sizing

The engine predicts scrollbars from numbers instead of render, measure, re-render:

  • viewport/boxLayout/: resolveLayout() is a pure function solving the workspace / inner / viewport / hider box decomposition and the two-variable scrollbar fix-point into an immutable LayoutSnapshot. gatherLayoutInput.ts is the one impure adapter. Viewport.beginDrawLayout() resolves the snapshot once per master draw, after the size caches are built and before the calculators run.
  • axisSizing/: intended size of one row/column: AxisSizeSource port (axisSizeSource.ts, defaultSizeSource.ts), prefix-sum caches (positionCache.ts), border-box conversion (boxModel.ts), size getters and oversized-content measurement (sizeGetters.ts, oversizedRows.ts).

singlePassLayout escape hatch. The prediction is used only in element mode with uniform sizes and the singlePassLayout setting on. TableView sets it to false whenever mergeCells is enabled (a virtualized merged cell's height depends on the viewport being computed); window-scrolled tables fall back to measurement too. Any new method that reads getLayout() must branch on singlePassLayout and window mode and fall back to a direct DOM measure otherwise; without that branch, merged-cell and window-scrolled tables break. Viewport.usesLayoutSnapshotForCalculators() is the gate predicate.

Draw orchestration: table/drawCycle.ts; Table.draw() delegates to the class-free runDrawCycle(table, fastDraw).

Known technical debt (details in .ai/CONCERNS.md)

  • DAO layer is replaced by constructor injection + wire.ts. Pass narrow deps objects, never the whole wot god-object.
  • Deep wot decoupling is deferred: overlays still reach the master via this.wot.wtTable/.wtViewport/.wtOverlays. The Clone is a second Walkontable instance holding a handle to the master. Leave both until the planned stage.
  • Filter objects are recreated every render pass.
  • 6 overlay types with complex positioning; changes frequently regress frozen row/column scenarios.

Performance rules

  • Batch scroll events with requestAnimationFrame.
  • Use a forEach loop instead of arr.push(...largeArray) at 10k+ elements.
  • Reuse DOM elements; batch DOM reads before DOM writes.

Testing

Walkontable has its own runner, separate from the main E2E pipeline.

  • Run: npm run test:walkontable --prefix handsontable
  • Location: src/3rdparty/walkontable/test/
  • Test with frozen rows and columns enabled to cover overlay edge cases.
  • A change to viewport calculation, overlay positioning, row/column sizing, or scroll sync gets an engine-tier spec. Existing Jasmine specs under src/3rdparty/walkontable/test/ may be edited; new coverage goes to tests/e2e/walkontable/*.spec.ts with a page object in tests/fixtures/pages/walkontable/ (tier reference: frozen-column-row-heights.spec.ts + FrozenTallCellPage.ts). A page-object method that scrolls ends on a render-state probe (first rendered row, a draw counter) instead of scrollTop, because the redraw is rAF-batched and lands after the scroll position settles. Copy OverlaysPage.scrollToEnd() (ends on the last cell being rendered); FrozenTallCellPage.scrollVerticallyTo() ends on scrollTop, so its spec polls masterFirstRenderedRow() itself after every scroll. Rules: handsontable-playwright-e2e, references/determinism.md.

Key source files

PathPurpose
src/3rdparty/walkontable/src/All Walkontable source
src/tableView.tsBridge to core (the boundary for plugins)
src/3rdparty/walkontable/src/overlay/Overlay system
src/3rdparty/walkontable/src/render/DOM rendering
src/3rdparty/walkontable/src/viewport/boxLayout/Layout snapshot + scrollbar fix-point solver
src/3rdparty/walkontable/src/axisSizing/Size sources, prefix-sum caches, box model
src/3rdparty/walkontable/src/domMeasure/GeometryReader proxy + live adapter
src/3rdparty/walkontable/src/table/drawCycle.tsrunDrawCycle
src/3rdparty/walkontable/src/wire.tsComposition root (buildContext → EngineContext)

Common mistakes

  • Plugin or core code touching Walkontable DOM elements instead of going through TableView.
  • Direct layout-forcing DOM reads instead of the GeometryReader proxy.
  • Hand-written *Deps interface, or passing the whole wot into a module.
  • Running Walkontable tests through the main E2E pipeline.
  • Skipping frozen rows and columns in tests.
  • Calling a #method of MasterTable from a path the base Table constructor reaches. Table's constructor calls alignOverlaysWithTrimmingContainer() before MasterTable's own fields exist, so a #method call there throws Receiver must be an instance of class MasterTable (the brand check fails like a #field read). Guard field reads with the existing fieldsInitialized check (#trimmingCache in this), and put logic that must run on that path in a module-level function that takes the table (alignHolderWithSplitOwners(table, …) in table/regions/masterTable.ts is the pattern).
  • Reading this.trimmingContainer on an overlay to decide something about the other axis. Each region overlay holds the owner of its own axis only (top/bottom → vertical, inline-start → horizontal), and the two can differ; ask wtViewport.isVerticallyScrollableByWindow() / isHorizontallyScrollableByWindow(). Rules and split mode: "Per-axis trimming containers" in handsontable/src/3rdparty/walkontable/AGENTS.md.

TypeScript gotchas

1. Generalize the signature instead of casting

When a function receives a value whose shape varies, make the signature generic instead of casting with as SomeType (or <SomeType>value). For any, take a type parameter; use unknown at boundaries and narrow with a type guard.

function getFirst<T>(items: T[]): T { return items[0]; }
const row = getFirst(rows); // typed as UserRow

1a. DOM narrowing

Narrow a Node | Element | null with isHTMLElement from src/helpers/dom/element.ts wherever you would write x as HTMLElement, x instanceof HTMLElement, or a nodeType === Node.ELEMENT_NODE guard. From Walkontable source the import is ../../../../helpers/dom/element (adjust ../ count to file depth).

if (isHTMLElement(node.nextSibling)) { /* HTMLElement here */ }

2. Declarations are generated

Fix the JSDoc/export in the .ts source and rerun npm run build:types; handsontable/tmp/ stays generated.

3. import type for types

import type { ViewportColumnsCalculator } from './calculator/viewportColumns';

4. Shared types live in core/

TypeLocation
GridSettings, Events, HookKeysrc/core/settings.ts
HotInstancesrc/core/types.ts

Import them with import type; never paste a partial copy of GridSettings/HotInstance into the file you are editing (a local copy drifts from the real signature).

5. Private fields use #; callbacks are arrow-function class fields

class Overlay {
  #cachedWidth: number | null = null;
  #onScroll = (): void => { /* `this` is bound */ };
}

@private JSDoc tags and .bind(this) are forbidden.

6. Cognitive complexity ≤ 15 per function

ESLint fails the build above it; extract a helper.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Develop and modify the Handsontable Angular wrapper with guidance on component lifecycle, settings updates, and NgZone, which controls change detection. It also covers standalone examples, global configuration, and the build and test workflow.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Fix settings updates in the Angular wrapper
  • Review change detection around grid operations
  • Update examples to standalone components
handsontable/handsontable2.2만2026년 10월 19일 업데이트

Open local or public web pages in BrowserStack Live for checks on real mobile devices or desktop browsers. The skill prepares temporary access to a local server, launches the requested session, and shares its dashboard link.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Check a local page on an Android device
  • Open a page in Safari on an iPhone or iPad
  • Inspect behavior in a specific desktop browser
handsontable/handsontable2.2만2026년 10월 19일 업데이트

Prepare user-facing changelog entries for source code changes. The skill determines whether an entry is needed, classifies the change, writes a clear title, and uses the project CLI to create a JSON file tied to the pull request.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Add a changelog entry for a bug fix
  • Classify a new feature or behavior change
  • Explain a breaking change and its replacement
handsontable/handsontable2.2만2026년 10월 19일 업데이트

Explore relationships between functions and files using a prebuilt code graph, a map of code dependencies. Trace bugs, inspect callers and execution paths, and assess the impact of refactoring or proposed changes.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Explore callers and dependencies in unfamiliar code
  • Trace a bug across multiple files
  • Assess the impact of renaming or removing code
handsontable/handsontable2.2만2026년 10월 19일 업데이트

Work with Handsontable row and column positions by distinguishing source data, displayed order, and rendered cells. It guides index conversion and helps investigate misplaced data when sorting, filtering, hiding, or moving rows and columns.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Investigating misplaced rows or columns
  • Converting between source and displayed indexes
  • Combining filters with manual column movement
handsontable/handsontable2.2만2026년 10월 19일 업데이트

Create Handsontable documentation examples for JavaScript, TypeScript, React, Angular, and Vue. The skill explains source files, generated JavaScript, required imports and license settings, embedding examples in guides, and checking that each framework version displays correctly.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Adding a code example to a feature guide
  • Preparing examples for multiple frameworks
  • Generating JavaScript examples from TypeScript
handsontable/handsontable2.2만2026년 10월 19일 업데이트

handsontable의 스킬 모두 보기

이 스킬의 문제 신고