Commit Graph
11139 Commits
Author SHA1 Message Date
David RichardsonandGitHub 3aa053e7a8 Merge pull request #3280 from enquora/CPOutlineView-build-warnings-cleanup
Fix CPOutlineView build warnings and audit+improve CPTreeNode
2026-08-19 11:05:17 -06:00
David Richardson 7aebf371e9 Back out CPTreeNodeTest for addition under separate PR
GitHub CI uses existing CPTreeNodeTest and fails when new tests are included.

New tests must be added as a separate PR, independently of the changes in CPTreeNode.j
2026-08-19 10:31:15 -06:00
David Richardson ac8ce3eec3 Fix CPOutlineView build warnings and audit+improve CPTreeNode
CPOutlineView.j used CPTreeNode before AppKit.j imported it. This
triggered build warnings. This commit adds an import.

- Add @import "CPTreeNode.j" to CPOutlineView.j.

While addressing this warning, CPTreeNode was audited and found to have an algorithmic complexity regression and multiple structural inconsistencies in the KVO support code.

The test suite for CPTreeNode was Spartan in the extreme.

All of these have been addressed - see inline notes for details.
CPTreeNode is subject to further audit.
2026-08-19 10:11:20 -06:00
David RichardsonandGitHub 3b09a5bde6 Merge pull request #3277 from enquora/CPStackView-build-warnings-cleanup
Fix CPStackView compile errors and add minimal correctness fixes
2026-08-14 20:12:35 -06:00
David Richardson 01f7f9b601 Fix CPStackView compile errors and add minimal correctness fixes
CPStackView.j emited warnings during builds and tests which constituted
either real errors or indeterminate state.

These included four types that did not exist: CPUserInterfaceLayoutOrientation, CPLayoutAttribute,
CPEdgeInsets, and CPMapTable.

The missing types are now present.

- Add local typedefs for CPUserInterfaceLayoutOrientation and
  CPLayoutAttribute. Numeric values match the equivalent Cocoa
  constants.
- Add CPEdgeInsets as an alias for the existing CGInset struct.
  Add CPEdgeInsetsMake and CPEdgeInsetsEqualToEdgeInsets.
- Import Foundation/CPMapTable.j. CPMapTable already exists in
  Foundation.

This commit also fixes two logic errors found during review.

- arrangedSubviews did not match the true view order after
  insert or remove. Add _rebuildArrangedSubviews and call it
  from every method that changes view order.
- Trailing-gravity layout added one extra spacing gap past the
  last view. This shifted the returned layout boundary. Spacing
  is now added before each view, not after.

This commit adds one new property.

- Add a distribution property with storage and accessors. It
  has no effect on layout yet. This makes the property honest:
  before this change, the type existed but no property did.

The manual test, ./Tests/Manual/CPStackViewTest, used a Narwhal-era
Jakefile and would not build. This has been updated to reflect
usage under the Node toolchain.

This commit adds CPStackView.j to AppKit.j. The file was never
imported. Only the build script's wildcard file list included
it.

This commit adds a header comment to CPStackView.j. The comment
states that the class is a placeholder. It lists known
limitations. It states that a constraint-solver based
replacement is planned.

Why: CPStackView must compile and pass tests before capp-build
can use this tree as a build reference, and a class with unstated
limits invites misuse.
2026-08-14 20:09:17 -06:00
David RichardsonandGitHub 907ff374e6 Merge pull request #3273 from enquora/add-property-copy-test
Add test for @accessors(copy)
2026-08-13 16:51:51 -06:00
David Richardson a786418e19 Add test for @accessors(copy)
@accessors(copy) had no test in ./Tests.
The compiler's copy-accessor setter behaviour was unverified.

Add CopyAccessorTest.j to Tests/Objective-J. It asserts three
properties of the generated setter:
- the stored value is not identical to the assigned object
- the stored value is unaffected by later mutation of the original
- the stored value is equal in content to the original at assignment

This is added both as a matter of good coverage for the existing toolchain and so that new tooling has a reference for a piece of foundational behaviour.
2026-08-13 16:42:57 -06:00
daboe01andGitHub 6448f7ea12 Merge pull request #3272 from daboe01/pageunloadfix
replace unload event listener with pagehide
2026-08-13 14:16:09 +02:00
daboe01 ce2803f354 replace unload event listener with pagehide and add DOM safety checks 2026-08-12 16:58:12 +02:00
David RichardsonandGitHub 7e3d22b10e Merge pull request #3270 from enquora/CPMapTable-fix-build-warning
Fix legacy compiler warnings in CPMapTable
2026-08-12 07:50:43 -06:00
David Richardson 84dab55993 Fix legacy compiler warnings in CPMapTable
Using ES6 destructuring in the `for...of` loop declaration
(`var [key, value] of _map.entries()`) causes the legacy
Objective-J compiler to emit "uninitialized global variable"
warnings for `key` and `value`.

This raises concerns about variable scoping and generates
unacceptable noise in the CI pipeline. To resolve the warnings,
the loop has been restructured to use standard array indexing
inside the loop body.

A TODO has been added to revert to ES6 destructuring once the
legacy compiler is retired.
2026-08-11 13:04:05 -06:00
David RichardsonandGitHub 60a143eb7c Merge pull request #3268 from cappuccino/readme-aristo3-testing
Update README to reflect testing branch for the Aristo3 theme
2026-08-10 20:27:02 -06:00
David Richardson aa961ff518 Update README to reflect testing branch for the Aristo3 theme 2026-08-10 20:17:30 -06:00
David RichardsonandGitHub bbdc7e1fe1 Merge pull request #3266 from enquora/modernize-isNumeric-macro
Remove _IS_NUMERIC macro in favour of concrete function CPIsNumeric()

- Create Foundation/_CPFoundationUtilities.j to house global low-level utilities.
- Implement CPIsNumeric as a concrete JavaScript function, preserving the exact legacy logic.
- Import _CPFoundationUtilities.j in the Foundation.j umbrella manifest.
- Replace _IS_NUMERIC macro calls at all call sites with CPIsNumeric().
2026-08-05 13:50:00 -06:00
David Richardson b62721d79a Remove _IS_NUMERIC macro in favor of concrete funtion CPIsNumeric()
- Create Foundation/_CPFoundationUtilities.j to house global low-level utilities.
- Implement CPIsNumeric as a concrete JavaScript function, preserving the exact legacy logic.
- Import _CPFoundationUtilities.j in the Foundation.j umbrella manifest.
- Replace _IS_NUMERIC macro calls at all call sites with CPIsNumeric().
2026-08-05 13:47:28 -06:00
David RichardsonandGitHub 450db2678a Merge pull request #3265 from enquora/modernize-CPNumberFormatter-remove-cpp-directives
Foundation: remove preprocessor macro from CPNumberFormatter.j
2026-08-04 19:48:17 -06:00
David Richardson 02a5434e4f Foundation: remove preprocessor macro from CPNumberFormatter.j
Replace SET_NEEDS_NUMBER_HANDLER_UPDATE() with inline statements.
Add a comment at each of the 6 call sites to state the reason.
No behavior change.
2026-08-04 19:46:09 -06:00
David RichardsonandGitHub 51b10e2bc4 Merge pull request #3258 from enquora/modernize-CPTimer
Refactor CPTimer: Remove CPP dependencies and mark legacy anti-patterns
2026-08-04 19:09:46 -06:00
David RichardsonandGitHub 8cb3d7771c Merge pull request #3264 from enquora/modernize-_CPArray-cpp
refactor(foundation): expand placeholder redirection macro in CPArray
2026-08-04 18:42:58 -06:00
David Richardson 4ef40ff151 refactor(foundation): expand placeholder redirection macro in CPArray
Remove the pre-processor dependency on FORWARD_TO_CONCRETE_CLASS by  inlining the class cluster instantiation routing logic across all designated initializers to support the new Go-based toolchain architecture.
2026-08-04 18:40:57 -06:00
David RichardsonandGitHub d7e5c2ccac Merge pull request #3259 from enquora/modernize-CPNumber
Refactor CPNumber: Remove CPP macros and modernize syntax
2026-08-04 18:11:59 -06:00
David Richardson f414fae60a Replace tabs with spaces
Tab indentation inadvertenly applied previously.
2026-08-04 18:09:27 -06:00
David RichardsonandGitHub a6c57b7128 Merge pull request #3263 from enquora/modernize-CPException-inline-method-call-string
Refactor METHOD_CALL_STRING macro to Javascript function

Replace the unhygienic METHOD_CALL_STRING() C pre-processor macro 
in CPException.j with a standard JavaScript helper function, 
_CPMethodCallString().

Add a `// MARK: - Exception Utilities` navigation landmark. 

This removes a legacy text-substitution dependency, enabling 
single-pass AST generation for the native compilation pipeline.
2026-08-04 17:52:30 -06:00
David Richardson cbf1d35f24 Refactor METHOD_CALL_STRING macro to Javascript function
Replace the unhygienic METHOD_CALL_STRING() C pre-processor macro
in CPException.j with a standard JavaScript helper function,
_CPMethodCallString().

Add a `// MARK: - Exception Utilities` navigation landmark.

This removes a legacy text-substitution dependency, enabling
single-pass AST generation for the platform-native compilation pipeline.
2026-08-04 17:47:44 -06:00
David Richardson ecf36f12cb docs: Establish v1.5.0 baseline and direct legacy users to 1.4.0
Merge Aristo3 theme and make it default.
Update README to reflect transition to Cappuccino 2.
Change README extension from .markdown to .md for universal editor support.
v1.5.0
2026-08-04 15:00:41 -06:00
daboe01 fa79df4309 Merge remote-tracking branch 'upstream/main' 2026-07-25 19:22:16 +02:00
David Richardson d9d3e5d613 Refactor CPNumber: Remove CPP macros and modernize syntax
Key changes:
- Removed the `CAST_TO_INT` macro and replaced it with native ES6
  `Math.trunc()` for float truncation.
- Replaced `var` with `let` for proper block scoping.
- Simplified boolean coercion in `boolValue` using the `!!` operator.
- Replaced the hostile `throw new Error` in `descriptionWithLocale:`
  with a safe fallback to `self.toString()`.
- Added `FIXME` comments to explicitly document architectural
  anti-patterns, including the global mutable state in `CPNumberUIDs`
  and the unimplemented `decimalValue` method.
2026-07-23 16:37:06 -06:00
David Richardson a745af8ead Refactor CPTimer: Remove CPP dependencies and mark legacy anti-patterns
As part of the ongoing technical debt cleanup, this commit modernizes
CPTimer.j by removing its reliance on the C-preprocessor and updating
syntax to modern JavaScript standards.

Key changes:
- Replaced `#define CPTimerDefaultTimeInterval` with a native `const`.
- Replaced `var` with `const`/`let` for proper block scoping and immutability.
- Replaced the build-time `PLATFORM(DOM)` guard with a runtime
  `typeof(window) !== 'undefined'` check, ensuring Foundation does not
  depend on build-time platform flags.
- Added `FIXME` comments to explicitly document architectural anti-patterns:
  - The invasive global override of `window.setTimeout` and `window.setInterval`.
  - The use of `new Function` for string evaluation (CSP violation).
  - The questionable exposure of `CPTimerDefaultTimeInterval` as a fallback.
2026-07-23 15:26:31 -06:00
David RichardsonandGitHub 87c1727ea0 Merge pull request #3255 from enquora/modernize-pragma-mark
Replace objc directive with native Javascript version // MARK: to facilitate elimination of pre-processing pass.
2026-07-21 16:16:00 -06:00
David Richardson 1a9a42ff54 Replace #pragma mark with // MARK:
Replace objc directive with native Javascript version // MARK: to facilitate elimination of preproccsing pass.
2026-07-21 15:15:53 -06:00
David RichardsonandGitHub 5592056351 Merge pull request #3254 from enquora/cleanup-formatting
Cleanup formatting in CPSet class cluster.
Align variable declarations.
Convert Xcode landmarks from c preprocessor pragmas to objj-native // MARK:
2026-07-21 11:11:53 -06:00
David Richardson 98bfd87446 Convert Xcode code landmarks from Objective-C to native Javascript
While objc `#pragma mark` works in objj files, it requires a preprocessor to handle the directive.

// MARK: is the fully functional and correct Objective-J variant.
2026-07-21 11:05:11 -06:00
David Richardson 3f63be7290 Align variable declarations 2026-07-21 10:56:38 -06:00
daboe01andGitHub b23d0cb8eb Merge pull request #3251 from daboe01/ruleeditor-drag-fix
fixed: CPRuleEditor: crash when dragging nested compound rows
2026-07-11 14:24:54 +02:00
daboe01andGitHub 0da009d1b9 Merge pull request #3246 from daboe01/markdown-manual-test
new: manual test for CPMarkdownParser
2026-07-11 13:51:37 +02:00
daboe01 b1fade86fe formatting 2026-07-11 13:51:04 +02:00
daboe01 04bad947e3 fixed: CPRuleEditor: crash when dragging nested compound rows 2026-07-10 16:14:29 +02:00
David RichardsonandGitHub f2cdb08e76 Merge pull request #3249 from enquora/resolve-duplicate-category-CPSet
Deconstruct _CPSet monolithic layout and relocate KVO proxies
2026-07-08 18:37:24 -06:00
David Richardson da3b0b5e21 fix(Foundation): implement valueForKey: for CPSet KVC compliance
Resolves testKVCCountSetOperators failure in CPSetTest. The previous implementation lacked an override for valueForKey:, causing the runtime to fall back to the default CPObject behavior, which failed to recognize KVC collection operators (e.g., @count).

Delegating valueForKey: to valueForKeyPath: ensures that CPSet correctly routes KVC operations through the existing collection operator logic.
2026-07-08 18:28:49 -06:00
David Richardson a240d312d0 Deconstruct _CPSet monolithic layout and relocate KVO proxies
•	Refactor @implementation _CPKVCSet and CPObject (CPSetKVO) from _CPSet.j to the tail of CPMutableSet.j.
•	Fix legacy compiler parse failures by ensuring the CPMutableSet superclass symbol is fully resolved within the translation unit prior to proxy evaluation.
•	Maintain strict DAG compliance across the modern toolchain pipeline topology.
•	Embed explicit #pragma mark navigation landmarks and enforce Allman brace layout to improve human structural ergonomics.
2026-07-08 17:35:33 -06:00
David RichardsonandGitHub bd48e2055e Merge pull request #3248 from enquora/foundation-resolve-duplicate-methods
Remove duplicate CPIndexSet -isEqual
2026-07-08 10:18:41 -06:00
David Richardson 42c212df64 Remove duplicate CPIndexSet -isEqual
Originally added in error, not realizing another author had just applied and committed the same fix.

Javascript-based tooling unable to catch this.
2026-07-08 10:16:25 -06:00
David RichardsonandGitHub 59e811328f Merge pull request #3247 from enquora/remove-import-cycles-foundation
Break Foundation import cycles for strict graph sorting
2026-07-08 09:16:16 -06:00
David Richardson 317c1a1475 Break Foundation import cycles for strict graph sorting
Disentangle circular dependencies Foundation framework primitives using
forward declarations.
2026-07-08 08:58:53 -06:00
daboe01 a93e67662b new: manual test for CPMarkdownParser 2026-06-26 19:42:42 +02:00
daboe01 14379b1be9 Merge remote-tracking branch 'upstream/main' 2026-06-24 16:53:48 +02:00
daboe01andGitHub 2e8767509e Merge pull request #3245 from daboe01/textview-selection-fix
new: Prefer e.data to capture the exact inserted character(s) from ke…
2026-06-24 16:53:22 +02:00
daboe01 429dfd7467 new: Prefer e.data to capture the exact inserted character(s) from key entry 2026-06-24 16:50:05 +02:00
daboe01 71a7b54edd Merge remote-tracking branch 'upstream/main' 2026-06-21 17:36:04 +02:00
daboe01andGitHub ad05fbe97b Merge pull request #3244 from daboe01/textview-stalenes-fix
Fixed: CPLayoutManager false-positive layout rescue on zero-length-delta edits
2026-06-21 17:35:30 +02:00