[document] remove force addition mode and the text size limit

Performance should be fine now for larger abstracts.
parent baca05ec
...@@ -32,11 +32,6 @@ import Toestand as T ...@@ -32,11 +32,6 @@ import Toestand as T
------------------------------------------------------------------------- -------------------------------------------------------------------------
textSizeLimit :: Int
textSizeLimit = 4500
-------------------------------------------------------------------------
type Props = type Props =
...@@ -78,9 +73,7 @@ layoutCpt = here.component "layout" cpt where ...@@ -78,9 +73,7 @@ layoutCpt = here.component "layout" cpt where
state'@{ ngramsLocalPatch } /\ state <- state'@{ ngramsLocalPatch } /\ state <-
R2.useBox' $ initialState { loaded } R2.useBox' $ initialState { loaded }
mode' /\ mode <- R2.useBox' AFT.AdditionMode mode' /\ mode <- R2.useBox' AFT.EditionMode
forceAdditionMode' /\ forceAdditionMode <- R2.useBox' false
let dispatch = coreDispatch path state let dispatch = coreDispatch path state
{ onPending, result } <- useAutoSync { state, action: dispatch } { onPending, result } <- useAutoSync { state, action: dispatch }
...@@ -116,17 +109,6 @@ layoutCpt = here.component "layout" cpt where ...@@ -116,17 +109,6 @@ layoutCpt = here.component "layout" cpt where
-- | Hooks -- | Hooks
-- | -- |
-- (?) Limit large document feature with empirical length value
-- see #423
useFirstEffect' do
let len = maybe 0 (length) doc.abstract
if (len `greaterThan` textSizeLimit)
then
T.write_ true forceAdditionMode
*> T.write_ AFT.AdditionMode mode
else
T.write_ false forceAdditionMode
*> T.write_ AFT.EditionMode mode
-- | Behaviors -- | Behaviors
-- | -- |
...@@ -166,9 +148,7 @@ layoutCpt = here.component "layout" cpt where ...@@ -166,9 +148,7 @@ layoutCpt = here.component "layout" cpt where
B.formSelect B.formSelect
{ value: show mode' { value: show mode'
, callback: onModeChange , callback: onModeChange
, status: forceAdditionMode' ? , status: Enabled
Idled $
Enabled
} }
[ [
H.option H.option
...@@ -180,14 +160,6 @@ layoutCpt = here.component "layout" cpt where ...@@ -180,14 +160,6 @@ layoutCpt = here.component "layout" cpt where
[ H.text "Add and edit terms" ] [ H.text "Add and edit terms" ]
] ]
] ]
,
R2.when forceAdditionMode' $
B.wad
[ "color-warning", "font-size-100", "mx-2", "inline-block" ]
[
H.text $ "limited term feature due to abstract length: (" <> show textSizeLimit <> " chars)"
]
, ,
R2.when withAutoUpdate $ R2.when withAutoUpdate $
-- (?) purpose? would still working with current code? -- (?) purpose? would still working with current code?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment