Skip to content
This repository was archived by the owner on Aug 14, 2026. It is now read-only.

fix(skein-ui): fix insert-parent blank command and Enter key reliability + add UI tests - #72

Open
hlship wants to merge 1 commit into
masterfrom
worktree-fix-skein-ui-tests
Open

fix(skein-ui): fix insert-parent blank command and Enter key reliability + add UI tests#72
hlship wants to merge 1 commit into
masterfrom
worktree-fix-skein-ui-tests

Conversation

@hlship

@hlship hlship commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Changes

Bug Fixes

1. Insert parent silently fails on Linux browsers

  • Added blank command guard in do-insert-parent that sets modal error instead of silently returning [nil session]
  • Added inline error display in the insert-parent modal form so users see "Command cannot be blank."
  • Root cause: $form-data["command"] was empty during form submission on Linux, causing normalize-input to produce a blank string → insert-parent! returned [nil session] silently → modal dismissed without feedback

2. Enter key only works ~50% of the time for command input

  • Added explicit data-on:keydown handler for Enter key on the new-command-input
  • Added nil/blank guard in process-new-command that prevents sending meaningless commands to the process
  • Root cause: component relied solely on data-on:change (blur event) which is unreliable when $value isn't populated by Hyper (observed on Linux browsers)

New Tests (29 total, bringing total to 138)

  • app_test.clj: Blank-command guard assertions, node-color-class CSS class verification
  • insert_parent_test.clj: Blank/whitespace/duplicate command edge cases for insert-parent!
  • tree_pane_test.clj: Comprehensive node-color-class tests covering all status × descendant combinations × spine positions

Other

  • Made node-color-class public (was defn-) to enable testing from outside the namespace

…ity + add UI tests

Fixes two reported bugs:

1. Insert parent silently fails when -data is empty (browser-specific,
   especially on Linux). Added inline error display in the modal and a guard
   that sets :error on the modal cursor instead of silently returning
   [nil session].

2. Enter key only works ~50% of the time for command input. The component
   relied solely on data-on:change (blur event) which is unreliable on Linux.
   Added explicit data-on:keydown handler for Enter key, and added a nil/blank
   guard to process-new-command that prevents sending meaningless commands
   to the process.

Additions:

- 29 new tests using hyper/test patterns and direct function testing:
  - blank-command-guard-rejects-blank-inputs (asserts the core fix)
  - non-blank-command-is-allowed
  - insert-parent-blank-command-is-silent (documents the bug pattern)
  - insert-parent-with-blank-command-returns-unchanged-session
  - insert-parent-with-whitespace-command-returns-unchanged-session
  - insert-parent-with-valid-command-succeeds
  - insert-parent-with-duplicate-on-parent-returns-error
  - normalize-input-* (4 tests for the guard)
  - blank-predicates-pass-the-guard
  - trim-collapses-interior-whitespace
  - node-color-class* (13 tests covering all CSS class combinations)

Make node-color-class public (was defn-) to allow testing.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant