tweakcc-fixed 1.0.1 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -41,6 +41,27 @@ These are not in any upstream PR and are unique to this fork.
41
41
  - **[`c87898c`](https://github.com/BenIsLegit/tweakcc-fixed/commit/c87898c) — Don't overwrite `verbose:X` inside destructuring patterns.**
42
42
  The `verboseProperty` patch was greedy enough to match `{ verbose: localName }` in destructure targets and replace it with `verbose: true`, which is a syntax error. The fix scopes the replacement to property-value positions only.
43
43
 
44
+ - **[`dc84a6c`](https://github.com/BenIsLegit/tweakcc-fixed/commit/dc84a6c) — Preserve CC's theme background and default padding in the `userMessageDisplay` patch.**
45
+ Stock CC 2.1.79+ sets `backgroundColor: "userMessageBackground"` and `paddingRight: 1` on the user-message Box; the replacement Box dropped both, stripping the theme-provided message background and the trailing column of bg that hugs the text. `backgroundColor: "default"` now re-emits the theme token, `paddingX`/`paddingY` accept `'default'` (emitting `paddingRight: 1` to match CC's native look), and the UI gains Default/Custom radios for each padding axis. Default settings flip to `'default'` so ctrl+R and fresh installs match CC's out-of-box appearance.
46
+
47
+ - **[`89555eb`](https://github.com/BenIsLegit/tweakcc-fixed/commit/89555eb) — Make ctrl+R honor the new default fg/bg modes.**
48
+ `restoreToOriginal` was hardcoding `'none'`/`'default'` for the bg/fg modes, which stopped lining up after the default settings shifted in `dc84a6c`. The mode is now derived from `DEFAULT_SETTINGS` so restore actually matches what new installs get.
49
+
50
+ - **[`3114c5b`](https://github.com/BenIsLegit/tweakcc-fixed/commit/3114c5b) — Forward theme fg/bg tokens to the replacement `Text` so "default" colors survive wrapping.**
51
+ When fg/bg is `'default'` the chalk chain emits no color codes, so the inner `Text` fell back to the terminal's default fg — and on narrow/wrapped user messages whole cells rendered without the theme color (matching the report that "default" bg/fg worked on slash commands but not regular messages). The patch now also forwards `color: "text"` and `backgroundColor: "userMessageBackground"` onto the replacement `Text` so the theme colors reach the cells chalk can't paint.
52
+
53
+ - **[`1e28b59`](https://github.com/BenIsLegit/tweakcc-fixed/commit/1e28b59) — Match the shrunken past-tense thinking-verb array in recent CC builds.**
54
+ Apply-time failed with `patch: thinkingVerbs: failed to find past tense verbs pattern`. The past-tense regex required `{50,}` capitalised entries — which matched the pre-2.x ~170-entry list but not the 8-entry `-ed` cooking array CC now ships (observed across 2.1.70–2.1.113): `["Baked","Brewed","Churned","Cogitated","Cooked","Crunched","Sautéed","Worked"]`. The fix anchors each entry on an `ed` suffix and drops the minimum to `{6,}`, which keeps us from colliding with the far-larger present-tense `-ing` array (handled by the earlier pass) or the user's substituted `-ing` verbs. 2.1.113 is a bun-compiled native binary that encodes `"Sautéed"` as the literal escape `"Saut\xE9ed"` rather than raw UTF-8; the existing character class already covers backslash/x/hex-digit/é, so both serialisation forms match without a code change — verified against all four cli.js shapes.
55
+
56
+ - **[`cc12f96`](https://github.com/BenIsLegit/tweakcc-fixed/commit/cc12f96) — Flatten the `{head, hiddenLines, tail}` text prop so long pastes in the user message display don't render as `[object Object]`.**
57
+ CC 2.1.79+ hoisted the long-message collapse from the inner `EjK`-style subcomponent into the caller via `useMemo` — when the original text exceeds ~10,000 chars (typical for pasted blocks) the `text` prop becomes `{head:string, hiddenLines:number, tail:string}` instead of a string. The patch captured that prop as `messageVar` and interpolated it with `` `${$}` `` in a template literal, which stringifies an object to `"[object Object]"` and wiped out the entire user message display for any long paste. The fix replaces the naive interpolation with a runtime ternary that detects the object variant and flattens it to `head + "(N line[s] hidden)" + tail`, mirroring CC's native collapse output; strings, `null`, and `undefined` all pass through unchanged. A small but important secondary fix: the emitted expression contains a `$&&` sequence, and `String.prototype.replace` treats `$&` in a _string_ replacement as the matched substring, which would corrupt the output — using a function replacer bypasses `$`-substitution entirely.
58
+
59
+ - **[`c66f604`](https://github.com/BenIsLegit/tweakcc-fixed/commit/c66f604) — Paint wrapped user-message lines with the configured bg.**
60
+ Reported: with custom User Message Display settings, a message long enough to wrap in the terminal had its highlight only on line 1 — line 2+ rendered against the terminal default bg. Two bugs collided: (1) `boxAttrsObjStr` was finalized right after the padding/border block, _before_ the fg/bg block ran, so every `boxAttrs.push('backgroundColor:...')` was silently discarded (this also broke the default-theme bg added in `3114c5b`, leaving the Box without its `userMessageBackground` token). (2) For a custom `rgb(r,g,b)` the patch only added `.bgRgb()` to the chalk chain — those ANSI bg escapes live inside the text content, and when Ink word-wraps the message the escape on line 1 doesn't reliably re-open on line 2. Fix: finalize `boxAttrsObjStr` _after_ the bg block, and for custom bg also push `backgroundColor:"rgb(r,g,b)"` onto both Box and Text so Ink paints the full padded width across every wrapped line.
61
+
62
+ - **[`9ef9328`](https://github.com/BenIsLegit/tweakcc-fixed/commit/9ef9328) — Rewrite the CC ≥2.1.79 `userMessageDisplay` path as attribute-preserving surgery (finally fixes wrapped-line bg).**
63
+ Even after `c66f604`, line 2+ of a wrapped message STILL rendered without the configured bg. Root cause was structural, not an ordering bug: the patch was replacing CC's entire outer Box+subcomponent tree with its own, dropping every layout attribute CC sets on that Box — most importantly `flexDirection:"column"`. Without it, the Box defaults to row layout and no longer inherits full parent width from CC's row-flex message-list parent, so Ink only paints the Box bg to the content width of line 1. The redesign tries the modern pattern first (the legacy pattern's `{text:VAR}` alternative ALSO matched 2.1.79+ shapes, so the legacy path was silently handling new-CC cases), captures the Box attrs dict as a regex group, and only _mutates_ what the user is customizing: custom `rgb(r,g,b)` replaces CC's bg ternary with a static literal; `null` strips the bg attr; `'default'` leaves CC's ternary intact (so message-actions-mode switching still works); border/padding/`alignSelf` overrides append onto the CSV. The inner `EjK` call is replaced with `createElement(Text, {color, backgroundColor, bold:!0, italic:!0, ...}, template)` using Ink's native Text props instead of chalk ANSI — Ink's layout pass paints bg and re-opens style codes on every wrapped line, which chalk-in-string doesn't reliably do. The legacy (CC ≤2.1.21) path keeps its prior chalk-chain behavior since those versions never had the wrap bug. Object-variant flattening from `cc12f96` moves into a shared helper with the tightened `typeof x==="object"&&x!==null` guard (handles `""`/`0` cleanly). Verified against CC 2.1.112's cli.js: the replacement preserves `flexDirection:"column"`, `marginTop:q?1:0`, and `paddingRight:w?0:1` verbatim; an end-to-end Ink render test confirms every wrapped line now has the bg ANSI re-opened at its start across padding spaces. Supersedes `c66f604`'s Ink-level bg push on both Box and Text (now handled via the preserved/mutated attrs instead).
64
+
44
65
  ## Installation
45
66
 
46
67
  Published to npm as [`tweakcc-fixed`](https://www.npmjs.com/package/tweakcc-fixed). Run without installation: