Fossil SCM

Improvements to the no-graph display of timelines.

drh 2025-10-16 17:47 timeline-enhance-2025
Commit 085082f18bc8100291471d8c6d028af5ed5de32c183d328fbd7d5d82010e1016
1 file changed +12 -4
+12 -4
--- src/timeline.c
+++ src/timeline.c
@@ -943,11 +943,13 @@
943943
int omitDescenders; /* True to omit descenders */
944944
int scrollToSelect; /* True to scroll to the selection */
945945
int dwellTimeout; /* Milliseconds to wait for tooltips to show */
946946
int closeTimeout; /* Milliseconds to wait for tooltips to close */
947947
u8 *aiMap; /* The rail map */
948
+ u8 bNoGraph; /* True to show a minimal graph */
948949
950
+ bNoGraph = (tmFlags & TIMELINE_GRAPH)==0;
949951
iRailPitch = atoi(PD("railpitch","0"));
950952
showArrowheads = skin_detail_boolean("timeline-arrowheads");
951953
circleNodes = skin_detail_boolean("timeline-circle-nodes");
952954
colorGraph = skin_detail_boolean("timeline-color-graph-lines");
953955
iTopRow = pGraph->pFirst ? pGraph->pFirst->idx : 0;
@@ -965,11 +967,11 @@
965967
@ "nomo": %d(PB("nomo")),
966968
@ "iTopRow": %d(iTopRow),
967969
@ "omitDescenders": %d(omitDescenders),
968970
@ "fileDiff": %d(fileDiff),
969971
@ "scrollToSelect": %d(scrollToSelect),
970
- @ "nrail": %d(pGraph->mxRail+1),
972
+ @ "nrail": %d(bNoGraph?1:pGraph->mxRail+1),
971973
@ "baseUrl": "%R",
972974
@ "dwellTimeout": %d(dwellTimeout),
973975
@ "closeTimeout": %d(closeTimeout),
974976
@ "hashDigits": %d(hash_digits(1)),
975977
@ "bottomRowId": "btm-%d(iTableId)",
@@ -1027,12 +1029,16 @@
10271029
aiMap = pGraph->aiRailMap;
10281030
for(pRow=pGraph->pFirst; pRow; pRow=pRow->pNext){
10291031
int k = 0;
10301032
cgi_printf("{\"id\":%d,", pRow->idx);
10311033
cgi_printf("\"bg\":\"%s\",", pRow->zBgClr);
1032
- cgi_printf("\"r\":%d,", pRow->iRail>=0 ? aiMap[pRow->iRail] : -1);
1033
- if( pRow->bDescender ){
1034
+ if( bNoGraph ){
1035
+ cgi_printf("\"r\":-1,");
1036
+ }else{
1037
+ cgi_printf("\"r\":%d,", pRow->iRail>=0 ? aiMap[pRow->iRail] : -1);
1038
+ }
1039
+ if( pRow->bDescender && !bNoGraph ){
10341040
cgi_printf("\"d\":%d,", pRow->bDescender);
10351041
}
10361042
if( pRow->mergeOut>=0 ){
10371043
cgi_printf("\"mo\":%d,", aiMap[pRow->mergeOut]);
10381044
if( pRow->mergeUpto==0 ) pRow->mergeUpto = pRow->idx;
@@ -1039,11 +1045,13 @@
10391045
cgi_printf("\"mu\":%d,", pRow->mergeUpto);
10401046
if( pRow->cherrypickUpto>0 && pRow->cherrypickUpto<=pRow->mergeUpto ){
10411047
cgi_printf("\"cu\":%d,", pRow->cherrypickUpto);
10421048
}
10431049
}
1044
- if( pRow->isStepParent ){
1050
+ if( bNoGraph ){
1051
+ cgi_printf("\"u\":0,");
1052
+ }else if( pRow->isStepParent ){
10451053
cgi_printf("\"sb\":%d,", pRow->aiRiser[pRow->iRail]);
10461054
}else{
10471055
cgi_printf("\"u\":%d,", pRow->aiRiser[pRow->iRail]);
10481056
}
10491057
k = 0;
10501058
--- src/timeline.c
+++ src/timeline.c
@@ -943,11 +943,13 @@
943 int omitDescenders; /* True to omit descenders */
944 int scrollToSelect; /* True to scroll to the selection */
945 int dwellTimeout; /* Milliseconds to wait for tooltips to show */
946 int closeTimeout; /* Milliseconds to wait for tooltips to close */
947 u8 *aiMap; /* The rail map */
 
948
 
949 iRailPitch = atoi(PD("railpitch","0"));
950 showArrowheads = skin_detail_boolean("timeline-arrowheads");
951 circleNodes = skin_detail_boolean("timeline-circle-nodes");
952 colorGraph = skin_detail_boolean("timeline-color-graph-lines");
953 iTopRow = pGraph->pFirst ? pGraph->pFirst->idx : 0;
@@ -965,11 +967,11 @@
965 @ "nomo": %d(PB("nomo")),
966 @ "iTopRow": %d(iTopRow),
967 @ "omitDescenders": %d(omitDescenders),
968 @ "fileDiff": %d(fileDiff),
969 @ "scrollToSelect": %d(scrollToSelect),
970 @ "nrail": %d(pGraph->mxRail+1),
971 @ "baseUrl": "%R",
972 @ "dwellTimeout": %d(dwellTimeout),
973 @ "closeTimeout": %d(closeTimeout),
974 @ "hashDigits": %d(hash_digits(1)),
975 @ "bottomRowId": "btm-%d(iTableId)",
@@ -1027,12 +1029,16 @@
1027 aiMap = pGraph->aiRailMap;
1028 for(pRow=pGraph->pFirst; pRow; pRow=pRow->pNext){
1029 int k = 0;
1030 cgi_printf("{\"id\":%d,", pRow->idx);
1031 cgi_printf("\"bg\":\"%s\",", pRow->zBgClr);
1032 cgi_printf("\"r\":%d,", pRow->iRail>=0 ? aiMap[pRow->iRail] : -1);
1033 if( pRow->bDescender ){
 
 
 
 
1034 cgi_printf("\"d\":%d,", pRow->bDescender);
1035 }
1036 if( pRow->mergeOut>=0 ){
1037 cgi_printf("\"mo\":%d,", aiMap[pRow->mergeOut]);
1038 if( pRow->mergeUpto==0 ) pRow->mergeUpto = pRow->idx;
@@ -1039,11 +1045,13 @@
1039 cgi_printf("\"mu\":%d,", pRow->mergeUpto);
1040 if( pRow->cherrypickUpto>0 && pRow->cherrypickUpto<=pRow->mergeUpto ){
1041 cgi_printf("\"cu\":%d,", pRow->cherrypickUpto);
1042 }
1043 }
1044 if( pRow->isStepParent ){
 
 
1045 cgi_printf("\"sb\":%d,", pRow->aiRiser[pRow->iRail]);
1046 }else{
1047 cgi_printf("\"u\":%d,", pRow->aiRiser[pRow->iRail]);
1048 }
1049 k = 0;
1050
--- src/timeline.c
+++ src/timeline.c
@@ -943,11 +943,13 @@
943 int omitDescenders; /* True to omit descenders */
944 int scrollToSelect; /* True to scroll to the selection */
945 int dwellTimeout; /* Milliseconds to wait for tooltips to show */
946 int closeTimeout; /* Milliseconds to wait for tooltips to close */
947 u8 *aiMap; /* The rail map */
948 u8 bNoGraph; /* True to show a minimal graph */
949
950 bNoGraph = (tmFlags & TIMELINE_GRAPH)==0;
951 iRailPitch = atoi(PD("railpitch","0"));
952 showArrowheads = skin_detail_boolean("timeline-arrowheads");
953 circleNodes = skin_detail_boolean("timeline-circle-nodes");
954 colorGraph = skin_detail_boolean("timeline-color-graph-lines");
955 iTopRow = pGraph->pFirst ? pGraph->pFirst->idx : 0;
@@ -965,11 +967,11 @@
967 @ "nomo": %d(PB("nomo")),
968 @ "iTopRow": %d(iTopRow),
969 @ "omitDescenders": %d(omitDescenders),
970 @ "fileDiff": %d(fileDiff),
971 @ "scrollToSelect": %d(scrollToSelect),
972 @ "nrail": %d(bNoGraph?1:pGraph->mxRail+1),
973 @ "baseUrl": "%R",
974 @ "dwellTimeout": %d(dwellTimeout),
975 @ "closeTimeout": %d(closeTimeout),
976 @ "hashDigits": %d(hash_digits(1)),
977 @ "bottomRowId": "btm-%d(iTableId)",
@@ -1027,12 +1029,16 @@
1029 aiMap = pGraph->aiRailMap;
1030 for(pRow=pGraph->pFirst; pRow; pRow=pRow->pNext){
1031 int k = 0;
1032 cgi_printf("{\"id\":%d,", pRow->idx);
1033 cgi_printf("\"bg\":\"%s\",", pRow->zBgClr);
1034 if( bNoGraph ){
1035 cgi_printf("\"r\":-1,");
1036 }else{
1037 cgi_printf("\"r\":%d,", pRow->iRail>=0 ? aiMap[pRow->iRail] : -1);
1038 }
1039 if( pRow->bDescender && !bNoGraph ){
1040 cgi_printf("\"d\":%d,", pRow->bDescender);
1041 }
1042 if( pRow->mergeOut>=0 ){
1043 cgi_printf("\"mo\":%d,", aiMap[pRow->mergeOut]);
1044 if( pRow->mergeUpto==0 ) pRow->mergeUpto = pRow->idx;
@@ -1039,11 +1045,13 @@
1045 cgi_printf("\"mu\":%d,", pRow->mergeUpto);
1046 if( pRow->cherrypickUpto>0 && pRow->cherrypickUpto<=pRow->mergeUpto ){
1047 cgi_printf("\"cu\":%d,", pRow->cherrypickUpto);
1048 }
1049 }
1050 if( bNoGraph ){
1051 cgi_printf("\"u\":0,");
1052 }else if( pRow->isStepParent ){
1053 cgi_printf("\"sb\":%d,", pRow->aiRiser[pRow->iRail]);
1054 }else{
1055 cgi_printf("\"u\":%d,", pRow->aiRiser[pRow->iRail]);
1056 }
1057 k = 0;
1058

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button