Skip to content

Stretch layout, JSON scroll views, TextView completion and Select fixes - #65

Merged
jdolan merged 11 commits into
mainfrom
feature/stretch-and-scroll-content
Sep 26, 2026
Merged

jdolan merged 11 commits into
mainfrom
feature/stretch-and-scroll-content

Conversation

@jdolan

@jdolan jdolan commented Sep 25, 2026

Copy link
Copy Markdown
Owner

Layout and control changes for the Quetoo in-game material editor (jdolan/quetoo#1084).

Changes

  • ScrollView content view in JSON: a JSON layout can declare contentView. A JSON ScrollView now gets its scroll bar through a View::init override.
  • stretch: a new @styled attribute. A StackView gives its remaining main-axis space to the subviews that stretch.
  • Visibility relayout: if a style changes the visibility of a view, the superview lays out again. Before this change, hidden and shown views overlapped.
  • TabViewController: its view gets the class tabViewController, so that a stylesheet can style it. Before, an element style set contain, and a stylesheet could not override it.
  • TextView Tab completion: TextViewDelegate::completionsForPrefix completes to the longest common prefix, and then Tab and Shift+Tab cycle through the matches. It includes tests.
  • Select::removeAllOptions: the function now removes all options. Before, it removed only every second option, so a Select that was cleared and filled again kept stale options.
  • A fix for a Gentoo compile error, and the new tests in the Xcode project.

Tests

make check: all 9 suites pass.

🤖 Generated with Claude Code

jdolan and others added 9 commits September 24, 2026 22:04
ScrollView binds "contentView" from JSON and installs it with setContentView,
as Panel does for its accessory view. ScrollView also overrides View::init, so a
ScrollView that JSON creates gets its scroll bar. Before this, only the
initWithFrame path created one, and a JSON ScrollView asserted on its first
content view.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A StackView gives each subview the size of its content along its axis, and
the fill distributions scale every subview alike. A subview styled with
stretch now shares whatever space the StackView's bounds leave, so that one
child, such as a page beneath a row of tabs, can fill a StackView that its
superview sizes. Existing layouts do not change.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
View::setVisibility asks the superview for layout, but a visibility that a
Stylesheet sets is bound directly by View::applyStyle, which did not. A view
that a class change made visible drew at its stale frame, over its siblings,
until something else laid out its StackView.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The view's contain mask was set in its element style, which outranks every
Stylesheet, so no layout could make it fill its superview. It now wears the
tabViewController class, which the default stylesheet sizes to contain.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
TextViewDelegate::completionsForPrefix returns the completions for the text before the cursor.
Tab completes to the longest prefix they share, and then Tab and Shift+Tab cycle through them. A
lone completion is not cycled, so the next Tab asks again, e.g. for a completed directory's
contents. Editing, moving the cursor or losing focus ends cycling.

When there is nothing to complete, Tab ends editing and advances the key responder as before.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The options were removed while the array was enumerated, which skipped every other option, so a
Select that was cleared and filled again kept stale options.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

Three moderate layout/input issues and one documentation issue remain unresolved.

Review effort: Lite
Findings: None

What changed in this PR

Updates the Quetoo material editor’s layout, scrolling, text completion, selection controls, styling, and test integration.

Changes:

  • Adds StackView stretching and visibility relayout.
  • Adds JSON ScrollView content views and TextView completion cycling.
  • Fixes Select option removal and TabViewController styling.
  • Updates tests, build targets, schemes, and generated stylesheet assets.
File Summary
Tests/​ObjectivelyMVC/​View.c Adds layout, visibility, and JSON tests.
Tests/​ObjectivelyMVC/​TextView.c Adds completion tests.
Tests/​ObjectivelyMVC/​Makefile.am Registers TextView tests.
Tests/​ObjectivelyMVC/​.gitignore Ignores the TextView test binary.
Sources/​ObjectivelyMVC/​WindowController.c Integrates TextView Tab handling. Moderate issue: keypad Tab traversal is not handled.
Sources/​ObjectivelyMVC/​View.h Declares stretch.
Sources/​ObjectivelyMVC/​View.c Binds stretch and visibility relayout. Moderate issue: changing stretch does not invalidate the superview layout.
Sources/​ObjectivelyMVC/​TextView.h Adds completion API and state. Nit: PR issue reference appears unrelated.
Sources/​ObjectivelyMVC/​TextView.c Implements completion and cycling.
Sources/​ObjectivelyMVC/​TabViewController.c Adds the controller styling class.
Sources/​ObjectivelyMVC/​StackView.c Distributes remaining space to stretched children. Moderate issue: finite max-size clamping can leave incorrect spacing.
Sources/​ObjectivelyMVC/​Select.c Removes all options correctly.
Sources/​ObjectivelyMVC/​ScrollView.h Documents JSON content views.
Sources/​ObjectivelyMVC/​ScrollView.c Supports JSON content views and initialization.
Sources/​ObjectivelyMVC/​Image.c Adds compile compatibility include.
ObjectivelyMVC.xcodeproj/​xcshareddata/​xcschemes/​ObjectivelyMVC-TextView.xcscheme Adds the TextView test scheme.
ObjectivelyMVC.xcodeproj/​xcshareddata/​xcschemes/​ObjectivelyMVC-Text.xcscheme Adds the Text test scheme.
ObjectivelyMVC.xcodeproj/​xcshareddata/​xcschemes/​ObjectivelyMVC-Image.xcscheme Adds the Image test scheme.
ObjectivelyMVC.xcodeproj/​project.pbxproj Registers test targets and sources.
Assets/​stylesheet.css.h Regenerates embedded stylesheet data.
Assets/​stylesheet.css Adds TabViewController styling.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

jdolan and others added 2 commits September 25, 2026 20:52
A stretched subview that its max size clamped still advanced the stack by its full share, which
left a gap. It now advances by its real size, and the unused share goes to the next stretched
subview. A style change to stretch now lays out the superview again.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
TextView already completes with keypad Tab, but WindowController moved focus only for Tab.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@jdolan

jdolan commented Sep 26, 2026

Copy link
Copy Markdown
Owner Author

Addressed the Copilot overview findings:

  • Stretch with a max size: fixed in b38e2c3. A clamped stretch subview advances by its real size, and the unused share goes to the next stretched subview. New test: stretchChildAtMaxSizeLeavesRemainderToNext.
  • A style change to stretch now lays out the superview: fixed in b38e2c3.
  • Keypad Tab moves the key responder: fixed in 04429cd.
  • The TextView.h issue reference: I found no issue reference in TextView.h, so nothing changed.

@jdolan
jdolan merged commit a9c44a2 into main Sep 26, 2026
4 checks passed
@jdolan
jdolan deleted the feature/stretch-and-scroll-content branch September 26, 2026 01:02
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