d0d3ac9414a163b759edf2b028a4b50f4057dbc3 braney Fri Jun 12 09:02:21 2026 -0700 hgTracks quickLift: use trash-can icon for per-track remove QA asked for the per-track remove control in a QuickLift group to match the trash-can icon already used to delete custom tracks, instead of the red 'x', so the two behave consistently. Factor the trash-can SVG into a shared printTrashIcon() helper used by both the custom-track delete and the quickLift remove, and drop the red tint so the quickLift icon matches. refs #37535 Co-Authored-By: Claude Opus 4.8 (1M context) diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c index c861e4c7ebc..231a4c3912a 100644 --- src/hg/hgTracks/hgTracks.c +++ src/hg/hgTracks/hgTracks.c @@ -8743,52 +8743,65 @@ } static void printMultiRegionButton() /* Print button that launches multi-region configuration pop-up */ { boolean isPressed = FALSE; if (differentString(virtModeType, "default")) isPressed = TRUE; char buf[256]; safef(buf, sizeof buf, "Configure %s multi-region display mode", isPressed ? "or exit" : ""); hButtonNoSubmitMaybePressed("hgTracksConfigMultiRegionPage", "Multi-region", buf, "popUpHgt.hgTracks('multi-region config'); return false;", isPressed); } +static void printTrashIcon(char *title, char *cssClass, char *dataAttrs) +/* Print a trash-can icon as a clickable
. title is the hover text, + * cssClass selects the click behavior/styling, and dataAttrs holds any + * preformatted data-* attributes that the click handler reads. + * Github uses SVG elements for all icons, apparently that is faster. + * We probably should have a library with all the icons, at least for the part. */ +{ +hPrintf("
" + "" + "" + "
", + title, dataAttrs, cssClass); +} + static void printTrackDelIcon(struct track *track) -/* little track icon after track name. Github uses SVG elements for all icons, apparently that is faster */ -/* we probably should have a library with all the icons, at least for the part */ +/* Trash-can icon after a custom track's name; clicking it deletes the track. */ { - hPrintf("
", track->track); - +char dataAttrs[512]; +safef(dataAttrs, sizeof dataAttrs, "data-track='%s'", track->track); +printTrashIcon("Delete this custom track", "trackDeleteIcon", dataAttrs); } static void printQuickLiftDelIcon(struct track *track, char *sourceDb) -/* little 'x' icon next to a track in a quickLift group; clicking it removes +/* Trash-can icon next to a track in a quickLift group; clicking it removes * the track from the quickLift hub. */ { - hPrintf("
" - "" - "" - "
", - track->track, sourceDb); +char dataAttrs[1024]; +safef(dataAttrs, sizeof dataAttrs, "data-track='%s' data-sourcedb='%s'", track->track, sourceDb); +printTrashIcon("Remove this track from the QuickLift group", "quickLiftDelIcon", dataAttrs); } static void printTrackLink(struct track *track) /* print a link hgTrackUi with shortLabel and various icons and mouseOvers */ { if (sameOk(track->groupName, "user")) printTrackDelIcon(track); char *quickLiftSourceDb = (track->tdb != NULL) ? trackDbSetting(track->tdb, "quickLiftDb") : NULL; /* skip the synthetic "Alignment Differences" track -- it's added at runtime * by hubConnect, not from the hub file, so removing it from the file is a * no-op and it would reappear on the next page load. */ if (quickLiftSourceDb != NULL && (track->tdb->type == NULL || !startsWith("bigQuickLiftChain", track->tdb->type)))