Skip to content

Implement copy-on-first-add for project-level list settings - #20

Merged
foxfirecodes merged 1 commit into
mainfrom
yoni/project-list-array-inheritance
Aug 27, 2026
Merged

foxfirecodes merged 1 commit into
mainfrom
yoni/project-list-array-inheritance

Conversation

@yonilerner

@yonilerner yonilerner commented Jun 17, 2026 •

Copy link
Copy Markdown
Owner

Implements the "Copy inherited arrays when editing project-level list
settings" TODO. Adds list-typed (string[]) field editing to
/pi-auto-settings with the inheritance behavior the TODO described:
when a project-level array hasn't been set yet, the first add copies
the inherited (defaults + user-global) entries before appending, so
the project file doesn't silently clobber the list the user sees.

  • settings-store.ts: pure nextArrayForAppend / nextArrayForRemove
    helpers, modifySettingArrayField that composes them with partial-
    merge file IO, and a perProjectPath: null option on loadSettings
    for computing the inherited value (skip per-project layer).
  • settings-ui.ts: kind: "stringList" descriptors for
    sensitivePathPatterns + all seven sandbox arrays; list-view editor
    with a add / d remove / enter remove / esc back. Shows an
    (inheriting N items — first edit copies them) hint when project
    layer is still inheriting.
  • string[][] fields (extraSafeCommandPrefixes,
    sandbox.reviewOnlyCommandPrefixes) intentionally left for a
    follow-up — they need a 2D editor. Added a TODO entry.

Also:

  • TODO.md: removed the three completed Configuration items (all already
    in docs/HISTORY.md); added a note at the top that completed items
    get removed and moved to HISTORY.
  • docs/HISTORY.md: new "List-field editing with copy-on-first-add
    inheritance" section.

This is part 1 of 2 in a stack made with GitButler:

@yonilerner

Copy link
Copy Markdown
Owner Author

Im not sure this PR makes any sense actually. We dont even want list-fields in the settings UI, so if you make a project file, its sorta on you to base it off the global file..

Comment thread extensions/settings-ui.ts
return "saved";
}

/* -------- step 3b: per-field list editor (stringList) -------- */

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't love these "step X" comments :ded: but something we should probably purge holistically from the repo at a later date

Comment thread extensions/settings-ui.ts

let anySaved = false;
let selectedIndex = 0;
for (;;) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

stressing

@foxfirecodes
foxfirecodes marked this pull request as ready for review August 27, 2026 04:31
@foxfirecodes
foxfirecodes merged commit 588baf7 into main Aug 27, 2026
1 check passed
@foxfirecodes
foxfirecodes deleted the yoni/project-list-array-inheritance branch August 27, 2026 04:31
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