Skip to content

Add mountMockAreas and note native-link Enter handling - #1

Merged
oskarfreye merged 1 commit into
mainfrom
cursor/mount-mock-areas-f06b
Nov 2, 2026
Merged

oskarfreye merged 1 commit into
mainfrom
cursor/mount-mock-areas-f06b

Conversation

@oskarfreye

@oskarfreye oskarfreye commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Export mountMockAreas from @draht/hex/adapters. Pass a university level (for example { ref: { kind: 'university', id: 'uni' }, title: 'Uni' }) and it returns a KnowledgeSeed whose root is that level, with each fictional mock area's parent set to it. Person levels under those areas, and the cells and links that belong to the areas and persons, are copied. MOCK_KNOWLEDGE and the level you pass in are not mutated. The mock university and the cells on its grid stay out, so the root grid is empty for the app's own cells; the areas are children of the root (listChildren, breadcrumbs).
  • README: gridAction is not needed for activate on native links when Enter is removed from the keymap. This matches the code. lookupBinding tries code first, then key, and the default entry is named Enter, so dropping that entry makes keyIntent return null for the Enter key and for Numpad Enter (code: 'NumpadEnter', key: 'Enter'). A listener that calls preventDefault and gridAction only when keyIntent is non-null leaves the key to the browser, which follows the link. Space stays an activate binding, and a native link does not follow on Space, so Space still goes through gridAction. The note sits with the keymap rules and next to the gridAction activate description.

Test plan

  • bun run check: TypeScript 6.x typecheck, TypeScript 5.9 typecheck, and bun test (110 pass, 0 fail), including the new mountMockAreas tests and a keymap test that Enter and Numpad Enter are unbound once the Enter entry is removed

No version bump and no publish.

Open in Web Open in Cursor 

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Summary by CodeRabbit

  • New Features

    • Added support for mounting mock areas beneath a supplied university, with their descendant data included and the university’s root grid left available for custom cells.
    • Exposed this capability through the adapters entry point.
  • Documentation

    • Clarified navigation behavior and how removing Enter from a custom keymap affects native link activation. Space remains an activation key unless removed separately.

mountMockAreas re-parents the fictional mock areas under a caller-supplied
university so consumers can drop the hand-written seed wiring. The README
notes that gridAction is not on the activate path for native links once
Enter is removed from the keymap.

Co-authored-by: Oskar Freye <oskar@freye.tech>
@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 339b5895-5021-46c8-8665-223df9aef7fc
Commits

Reviewing files that changed from the base of the PR and between 1f52001 and 1fe8e63.

Files selected for processing: 6
  • ARCHITECTURE.md
  • README.md
  • src/adapters/index.ts
  • src/adapters/memory-knowledge/mount-mock-areas.ts
  • test/grid-keyboard.test.ts
  • test/knowledge-adapters.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Walkthrough

Adds mountMockAreas to create a knowledge seed rooted at a supplied university, with selected mock areas and descendants. Also documents and tests how removing Enter from a keymap affects native link activation.

Changes: Mock Area Mounting

Layer / File(s) Summary
Mount API and seed construction
src/adapters/memory-knowledge/mount-mock-areas.ts, src/adapters/index.ts
Adds and exports mountMockAreas. It rejects roots that are not universities, clones the supplied root, reparents mock areas, and includes cells and links based on the selected levels and cells.
Mount behavior validation and documentation
test/knowledge-adapters.test.ts, README.md, ARCHITECTURE.md
Tests the mounted seed contents, navigation, root validation, and input immutability. Documents the function and its output.

Native Link Keyboard Guidance

Layer / File(s) Summary
Enter key guidance and keymap test
test/grid-keyboard.test.ts, README.md
Documents that removing Enter from the keymap allows native link activation without calling gridAction. Tests that Enter and Numpad Enter return no intent while Space remains bound.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Merge Risk: Minimal · up to 1fe8e

No merge-blocking issue remains identified.

Security architecture risk: Minimal · up to 1fe8e

The new API constructs an isolated copy of fictional sample data beneath a caller-supplied university. The reviewed changes introduce no external endpoint, privileged operation or persistent-state transition, and no material security risk was identified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The added authority is limited to constructing an in-process seed for the caller. The helper does not access another tenant, external service, credential or durable store; any later application exposure depends on the consuming application.

Trust Boundaries and Controls

  • observed — The university-kind check is structural validation, not authentication or authorization. Caller-controlled root data is copied into the returned seed. The existing repository already accepts arbitrary caller-supplied seeds and clones them, so this helper does not bypass a repository access-control gate.
Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly identifies both main changes: adding mountMockAreas and documenting native-link Enter handling.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 4 files. (2 skipped: 2 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@oskarfreye
oskarfreye merged commit e64dc43 into main Nov 2, 2026
3 checks passed
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.

2 participants