WIP: Trimming now hooked up to new text dialog

UI still looks ugly -- some CSS work needed -- but it works, at least
for the single test I've run so far. More testing needed, and the UI
needs to be hooked up to the "edit existing text" dialog as well as
the new text dialog.