foldItemRef function
The short address shown in a digest: #hash when the item shares the
run's base, otherwise the full id.
Implementation
String? foldItemRef(SemanticNode item, String? runBase) {
final id = item.glintId;
if (id == null) return null;
if (runBase != null && glintIdBase(id) == runBase && id.contains('#')) {
return id.substring(id.indexOf('#'));
}
return id;
}