Skip to content
This repository has been archived by the owner on Aug 21, 2020. It is now read-only.

Preserve inbound references on rename #76

Open
edrex opened this issue Jan 13, 2016 · 3 comments
Open

Preserve inbound references on rename #76

edrex opened this issue Jan 13, 2016 · 3 comments

Comments

@edrex
Copy link
Contributor

edrex commented Jan 13, 2016

Kicking tires. Lots of progress, looking good!

mGSD's tag-based references benefited from some generic tag-enhancing plugins.

One of particular utility (maybe also by @simonbaird, don't quite remember) checked for inbound (tag) references on (tag tiddler) rename, listed referencing tiddlers, and offered to modify the references to preserve integrity.

It would be nice if gsd5's various reference fields had the same integrity-preserving behavior on rename.

Technical question about TW5 data model: Are the reference fields typed as tiddler references, or are they just string fields? If they are/can be typed as references, this could be implemented by iteration over all tiddlers / fields, filtering for reference field instances. Otherwise, a whitelist of known reference fields would have to be maintained, which would be annoying.

Places this has bit me so far, in 10 minutes of testing:

  • renaming realms
  • renaming projects

best,
Eric

@edrex
Copy link
Contributor Author

edrex commented Jan 13, 2016

Partially answering my own question about field types, it seems that TW5 fields are untyped (they're all just strings).

In this case, a gsd5-bundled plugin could:

  • keep a list of fields to update on rename (possibly with additional info like gsd5_type constraint for referrer/referent but probably not needed)
  • on rename, search for field instances needing update
  • show a prompt listing all proposed updates (maybe Title + Field Label), with option to update or not
  • if user opts to update, make needed updates.

@edrex
Copy link
Contributor Author

edrex commented Jan 13, 2016

Here's the plugin in mGSD/MPTW:
https://github.com/simonbaird/MPTW/blob/master/core/RenameTagsPlugin.js

@edrex
Copy link
Contributor Author

edrex commented Jan 13, 2016

Probably could be invoked by th-saving-tiddler hook.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant