%

\def\leaderfill{\leaders\hbox to 1em{\hss. \hss}\hfill}

\defineitemgroup[ContentsList]
\setupitemgroup[ContentsList][each]
		[broad,packed,autointro,repeat][]
\setupitemgroup[ContentsList][1][n][margin=1pc]

\define[2]\ChapterTitle{%
  % simplified
  \reference[\namedstructurevariable{chapter}{reference}]{\strut}%
  \structurevariable{title} {\tfx by \structureuservariable{author}}
}

\define[3]\ChapterTocEntry{% parameters are not used
  \startitem%
    % simplified, IRL we use several user variables
    \structurelistuservariable{author}: #2
    %#1/#2/#3 = chapter no./title/pagina
		%\namedstructurelistvariable{chapter}{title}??
    \leaderfill\color[blue]{\currentlistentrypagenumber}
  \stopitem%
}

\setuphead[chapter][
    style=\rm,
		command=\ChapterTitle,
    ]

\definelist[chapter][%
		alternative=command,
    interaction=all,
    criterium=all,
		command=\ChapterTocEntry,
		before=,
		after=,
]

\starttext

\startContentsList
%\sym{}Preface\leaderfill\at{Preface} % Preface unnumbered

\startitem
Test entry\leaderfill 123
\stopitem

\startitem
Test entry\leaderfill 124
\stopitem
%\blank[1em]

\placelist[chapter]

\startitem
Test entry\leaderfill 125
\stopitem

\stopContentsList


\startchapter[title=First,reference=tufte1][author=Edward Tufte]
\input tufte
\stopchapter

\startchapter[title=Second,reference=knuth][author=Donald Knuth]
\input knuth
\stopchapter

\startchapter[title=Third,reference=tufte2][author=Edward Tufte]
\input tufte
\stopchapter

\stoptext
