diff --git a/Assistant/WebApp/DashBoard.hs b/Assistant/WebApp/DashBoard.hs index 9b21e23854..84ab6ecd83 100644 --- a/Assistant/WebApp/DashBoard.hs +++ b/Assistant/WebApp/DashBoard.hs @@ -25,6 +25,7 @@ import qualified Git import Text.Hamlet import qualified Data.Map as M import Control.Concurrent +import qualified Data.Text as T {- A display of currently running and queued transfers. - @@ -42,6 +43,16 @@ transfersDisplay warnNoScript = do isrunning info = not $ transferPaused info || isNothing (startedTime info) +{- Long filenames can mess up the transfer display, due to the + - browser not word-wrapping them because it thinks this_is/all_one_word. + - + - To deal with this, insert zero-width spaces every 10 characters. + -} +segmentFilePath :: FilePath -> T.Text +segmentFilePath = T.intercalate zspace . T.chunksOf 10 . T.pack + where + zspace = T.singleton '\8203' + {- Simplifies a list of transfers, avoiding display of redundant - equivilant transfers. -} simplifyTransfers :: [(Transfer, TransferInfo)] -> [(Transfer, TransferInfo)] diff --git a/debian/changelog b/debian/changelog index fae68c806d..75d81ff76e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -23,6 +23,7 @@ git-annex (4.20130315) UNRELEASED; urgency=low repository when in indirect mode. * webapp: Improved alerts displayed when syncing with remotes, and when syncing with a remote fails. + * webapp: Force wrap long filenames in transfer display. -- Joey Hess Fri, 15 Mar 2013 00:10:07 -0400 diff --git a/templates/dashboard/transfers.hamlet b/templates/dashboard/transfers.hamlet index 8f3b94c61d..8230406e32 100644 --- a/templates/dashboard/transfers.hamlet +++ b/templates/dashboard/transfers.hamlet @@ -11,9 +11,9 @@

$maybe file <- associatedFile info - #{file} + #{segmentFilePath file} $nothing - #{key2file $ transferKey transfer} + #{segmentFilePath $ key2file $ transferKey transfer} $case transferDirection transfer $of Upload →