The CLI's `--remove-target --prune` removed a symlink-mode target no matter
where it pointed, while the dashboard removed it only when it still linked
to the extra's source folder. A user who repointed that link at their own
folder could lose it from the CLI. Both now go through one shared
sync.ClearExtraTarget, so the safer rule applies everywhere; the CLI warns
and leaves anything that is not a link to the source instead of failing.
Refs #491
cmdExtrasMode only ran ValidateExtraConfig behind a growing list of
conditions, so each new restriction needed another clause. For a plain
folder extra the full check adds only the mode-name and flatten+symlink
rules, which sync already rejects, so validating unconditionally cannot
refuse a config that syncs today.
The agents and memory extra names were string literals in sync, the
server handlers, the memory store, and the CLI. They now live in
internal/config, and the rename guard moves to ValidateExtraRename so a
future CLI rename reuses it instead of copying the check.
Refs #489
The rules "an extension forces copy mode" and "symlink mode drops
include/exclude" were re-implemented in the create, edit-target, and
quick mode handlers. ExtraTargetConfig.EffectiveMode and Normalize now
hold them in one place, and the handlers call those instead. API
behavior is unchanged: edit-target still clears filters on symlink,
quick mode still rejects symlink when the target has filters, and an
extension still forces copy.
Refs #488
- Pointing a symlink-mode extra at a new source after its old folder was
moved or deleted left the target broken: the old link no longer resolved,
so it was not recognised as ours, and the next sync skipped it as pointing
elsewhere. The link text is now compared with the old source as well.
- A negated include such as "!draft.md" only narrows earlier rules, so on
its own it never matches and was always reported as matching no file.
Negations are no longer checked for matches.
Refs #435
- Sync validation skipped directory extras, so a malformed include such as
"[" written in the config matched nothing and merge sync pruned every
link. Extras with include/exclude now go through ValidateExtraConfig.
- The dashboard's quick Mode menu could switch a filtered target to symlink
and save filters that every later sync rejects. That change is now
validated with the target's filters and refused.
- Changing an extra's source removed the links into the old folder before
saving the config, so a failed save left working targets broken. The
config is saved first.
Refs #435
A directory extra used to sync every file to every target, so a tool that
only wanted a few docs got the whole folder. Each target can now set
gitignore-style include/exclude patterns, matched on the path inside the
source. Merge targets prune links to files that stop matching; copy targets
keep earlier copies, since nothing records which copied files are ours.
Filters are rejected for symlink mode and single-file extras, and sync warns
when an include matches nothing.
The dashboard previously forced users to delete and re-add a target or an
extra to change it. Edit target now changes the folder, file name, mode,
flatten and filters with a live preview; Edit extra renames an extra or
points it at another source folder. A moved target or source drops the
links left at the old place and syncs right away.
CLI: --include/--exclude on extras init, and --add-include, --add-exclude,
--remove-include, --remove-exclude on extras <name>.
Refs #435