Fossil SCM

Add timeline web UI to set tag filter and match style. Still not 100%. (1) Now that more than one text entry is on the page, pressing enter does not trigger a submit [Firefox ESR 10.0.12], (2) electing "Related" causes Tag Filter to blank, (3) entering a tag filter while "Related" is selected causes "Related" to be deselected, (4) possibly too much clutter, and (5) definitely too much clutter if combined with any future expansions. (1) is due to the lack of a submit button. (2) and (3) are a bad interaction between the t=/r= dichotomy and the design of style_submenu_entry(). (4) maybe could be addressed by changing "Related"/"Branch Only" and "Without Files"/"With Files" to checkbuttons, but style_submenu_checkbox() was never actually implemented. (Probably also want "Unhide" to be a checkbox. For (5) I have in mind letting the admin define a project-specific list of preset filters.

andygoth 2016-11-04 16:21 andygoth-timeline-ms
Commit d4a6d3c1ec0ed8322c49fe0d180f2a2966c1df67
1 file changed +10 -3
+10 -3
--- src/timeline.c
+++ src/timeline.c
@@ -1477,15 +1477,15 @@
14771477
zThisTag = zBrName;
14781478
}
14791479
14801480
/* Interpet the tag style string. */
14811481
if( zThisTag ){
1482
- if( fossil_stricmp(zMatchStyle, "GLOB")==0 ){
1482
+ if( fossil_stricmp(zMatchStyle, "glob")==0 ){
14831483
matchStyle = MS_GLOB;
1484
- }else if( fossil_stricmp(zMatchStyle, "LIKE")==0 ){
1484
+ }else if( fossil_stricmp(zMatchStyle, "like")==0 ){
14851485
matchStyle = MS_LIKE;
1486
- }else if( fossil_stricmp(zMatchStyle, "REGEXP")==0 ){
1486
+ }else if( fossil_stricmp(zMatchStyle, "regexp")==0 ){
14871487
matchStyle = MS_REGEXP;
14881488
}
14891489
}
14901490
14911491
/* Construct the tag match expression. */
@@ -1954,10 +1954,13 @@
19541954
}
19551955
if( zSearch ){
19561956
blob_appendf(&desc, " matching \"%h\"", zSearch);
19571957
}
19581958
if( g.perm.Hyperlink ){
1959
+ static const char *const azMatchStyles[] = {
1960
+ "exact","Exact", "glob","Glob", "like","Like", "regexp","Regexp"
1961
+ };
19591962
double rDate;
19601963
zDate = db_text(0, "SELECT min(timestamp) FROM timeline /*scan*/");
19611964
if( (!zDate || !zDate[0]) && ( zAfter || zBefore ) ){
19621965
zDate = mprintf("%s", (zAfter ? zAfter : zBefore));
19631966
}
@@ -1995,10 +1998,14 @@
19951998
}
19961999
style_submenu_entry("n","Max:",4,0);
19972000
timeline_y_submenu(disableY);
19982001
style_submenu_binary("v","With Files","Without Files",
19992002
zType[0]!='a' && zType[0]!='c');
2003
+ style_submenu_entry("t", "Tag Filter:", -8, 0);
2004
+ style_submenu_multichoice("ms",
2005
+ sizeof(azMatchStyles) / sizeof(*azMatchStyles) / 2,
2006
+ azMatchStyles, 0);
20002007
}
20012008
blob_zero(&cond);
20022009
}
20032010
if( PB("showsql") ){
20042011
@ <pre>%h(blob_sql_text(&sql))</pre>
20052012
--- src/timeline.c
+++ src/timeline.c
@@ -1477,15 +1477,15 @@
1477 zThisTag = zBrName;
1478 }
1479
1480 /* Interpet the tag style string. */
1481 if( zThisTag ){
1482 if( fossil_stricmp(zMatchStyle, "GLOB")==0 ){
1483 matchStyle = MS_GLOB;
1484 }else if( fossil_stricmp(zMatchStyle, "LIKE")==0 ){
1485 matchStyle = MS_LIKE;
1486 }else if( fossil_stricmp(zMatchStyle, "REGEXP")==0 ){
1487 matchStyle = MS_REGEXP;
1488 }
1489 }
1490
1491 /* Construct the tag match expression. */
@@ -1954,10 +1954,13 @@
1954 }
1955 if( zSearch ){
1956 blob_appendf(&desc, " matching \"%h\"", zSearch);
1957 }
1958 if( g.perm.Hyperlink ){
 
 
 
1959 double rDate;
1960 zDate = db_text(0, "SELECT min(timestamp) FROM timeline /*scan*/");
1961 if( (!zDate || !zDate[0]) && ( zAfter || zBefore ) ){
1962 zDate = mprintf("%s", (zAfter ? zAfter : zBefore));
1963 }
@@ -1995,10 +1998,14 @@
1995 }
1996 style_submenu_entry("n","Max:",4,0);
1997 timeline_y_submenu(disableY);
1998 style_submenu_binary("v","With Files","Without Files",
1999 zType[0]!='a' && zType[0]!='c');
 
 
 
 
2000 }
2001 blob_zero(&cond);
2002 }
2003 if( PB("showsql") ){
2004 @ <pre>%h(blob_sql_text(&sql))</pre>
2005
--- src/timeline.c
+++ src/timeline.c
@@ -1477,15 +1477,15 @@
1477 zThisTag = zBrName;
1478 }
1479
1480 /* Interpet the tag style string. */
1481 if( zThisTag ){
1482 if( fossil_stricmp(zMatchStyle, "glob")==0 ){
1483 matchStyle = MS_GLOB;
1484 }else if( fossil_stricmp(zMatchStyle, "like")==0 ){
1485 matchStyle = MS_LIKE;
1486 }else if( fossil_stricmp(zMatchStyle, "regexp")==0 ){
1487 matchStyle = MS_REGEXP;
1488 }
1489 }
1490
1491 /* Construct the tag match expression. */
@@ -1954,10 +1954,13 @@
1954 }
1955 if( zSearch ){
1956 blob_appendf(&desc, " matching \"%h\"", zSearch);
1957 }
1958 if( g.perm.Hyperlink ){
1959 static const char *const azMatchStyles[] = {
1960 "exact","Exact", "glob","Glob", "like","Like", "regexp","Regexp"
1961 };
1962 double rDate;
1963 zDate = db_text(0, "SELECT min(timestamp) FROM timeline /*scan*/");
1964 if( (!zDate || !zDate[0]) && ( zAfter || zBefore ) ){
1965 zDate = mprintf("%s", (zAfter ? zAfter : zBefore));
1966 }
@@ -1995,10 +1998,14 @@
1998 }
1999 style_submenu_entry("n","Max:",4,0);
2000 timeline_y_submenu(disableY);
2001 style_submenu_binary("v","With Files","Without Files",
2002 zType[0]!='a' && zType[0]!='c');
2003 style_submenu_entry("t", "Tag Filter:", -8, 0);
2004 style_submenu_multichoice("ms",
2005 sizeof(azMatchStyles) / sizeof(*azMatchStyles) / 2,
2006 azMatchStyles, 0);
2007 }
2008 blob_zero(&cond);
2009 }
2010 if( PB("showsql") ){
2011 @ <pre>%h(blob_sql_text(&sql))</pre>
2012

Keyboard Shortcuts

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