Ticket #2289 (closed bug: obsolete)

Opened 15 years ago

Last modified 13 years ago

text-undo-misbehavior - There are some odd thigns about text undo.

Reported by: todor Owned by:
Priority: major Milestone: X3
Component: uncategorized Version: 2.0
Keywords: Cc: mira
Category: unknown Effort:
Importance: 89 Ticket_group: text
Estimated Number of Hours: 0 Add Hours to Ticket: 0
Billable?: yes Total Hours: 0
Analysis_owners: todor Design_owners: diana
Imp._owners: diana Test_owners:
Analysis_reviewers: diana Changelog: Changelog
Design_reviewers: meddle Imp._reviewers: meddle, todor
Test_reviewers: Analysis_score: 3
Design_score: 4 Imp._score: 3.5
Test_score: 0

Description (last modified by kyli) (diff)

  • Undo of backspace is not behaving as expected.
  • No matter how fast you write when you undo the first letter stays most of the times.
  • Undo of writing removes random number words (sometimes undo removes letters sometimes several words).
  • Select text and delete it, try to undo it.
  • Redo doesn't work sometimes, often.
  • Undo of styles doesn't work.
  • The right behavior is the one used by word and many other text editors.
  • When user presses on Ctrl+Z the whole word must be removed, if the user however makes changes to some word Ctrl+Z removes only the new changes (see ms word).

Attachments

2289.patch (54.7 KB) - added by diana 15 years ago.

Change History

comment:1 Changed 15 years ago by dido

  • Importance set to 89

comment:2 Changed 15 years ago by deyan

  • Description modified (diff)

Batch update from file active_tickets.csv

comment:3 Changed 15 years ago by kyli

  • Ticket_group set to text
  • Description modified (diff)
  • Changelog set to [wiki:Changelog]

comment:4 Changed 15 years ago by diana

  • Design_owners set to diana
  • Status changed from new to s1b_analysis_finished
  • Imp._owners set to diana
  • Analysis_reviewers set to diana
  • Analysis_score changed from 0 to 3

The analysis is not good enough - the behaviour is not specified.

------Dummy Part------

  • In org.sophie2.base.connectivity module add new package: org.sophie2.base.connectivity.actions for the AutoActions of the module.
  • In org.sophie2.base.connectivity.actions add new public final class CreateDirAction extends AutoAction - an AutoAction that adds a sub directory to a ResourceRefList with child resources.
  • In CreateDirAction add: public CreateDirAction(Message description, boolean significant,ResourceRefR4 childRef, ResourceRefList subDirectories) - Default constructor. Creates a new CreateDirAction instance.
  • In ResourceDirectoryH: createDir use the previously created class.
  • In org.sophie2.base.model.book module add new package: org.sophie2.base.model.book.actions for the AutoActions of the module.
  • In org.sophie2.base.model.book.actions add new public final class LockUnlockBorderAction extends AutoAction - an AutoAction class for locking/unlocking the border.
  • In LockUnlockBorderAction add new method: LockUnlockBorderAction(Message description, boolean significant,

ImmColor borderColor, ImmInsets borderInsets, Boolean input) - The default constructor. Creates a new instance of LockUnlockBorderAction class.

  • In org.sophie2.base.model.book.actions add new public final class ToggleBackgroundLock extends AutoAction - an AutoAction class for locking/unlocking the background.
  • In ToggleBackgroundLock add new method: public ToggleBackgroundLock(Message description, boolean significant, BackgroundType type,

ImmColor color, ResourceRefR4 image, ImmGradient gradient, Float opacity, Boolean input) - The default constructor. Creates a new instance of
ToggleBackgroundTemplatingAction class.

  • In org.sophie2.base.model.book.actions add new public final class ToggleBackgroundTemplatingAction extends AutoAction - an AutoAction class for changing the template mode of the background.
  • In ToggleBackgroundTemplatingAction add new method: public ToggleBackgroundTemplatingAction(Message description,

boolean significant, BackgroundType type, ImmColor color, ResourceRefR4 image, ImmGradient gradient, Float opacity) -
The default constructor. Creates a new instance of ToggleBackgroundTemplatingAction class.

  • In org.sophie2.base.model.book.actions add new public final class ToggleBorderTemplatingAction extends AutoAction - an AutoAction class for changing the template mode of the border.
  • In ToggleBorderTemplatingAction class add new method: public ToggleBorderTemplatingAction(Message description, boolean significant,

ImmInsets newInsets, ImmColor newColor) - The default constructor. Creates a new instance of ToggleBorderTemplatingAction class.

  • In StyledElementH: setBorderLocked use an instance of LockUnlockBorderAction class instead of the anonymous AutoAction class.
  • In StyledElementH: setBackgroundLocked use an instance of ToggleBackgroundLock class instead of the anonymous AutoAction class.
  • In StyledElementH: setBackgroundUseTemplate use an instance of ToggleBackgroundTemplatingAction class instead of the anonymous AutoAction class.
  • In StyledElementH: setBorderUseTemplate use an instance of ToggleBorderTemplatingAction class instead of the anonymous AutoAction class. ------Ticket Part-----
  • In BaseTextModel class change the modifier of the RwProp<TextChange> lastChange() to public in order to use it in HotTextLogic class.
  • In TextView class : EventIds change the following:
    • Change the CHANGE_TEXT to CHANGE_TEXT_FORCED.
    • Add new EventId CHANGE_TEXT - fired only for the undo/redo (to make the final significance of the action).
  • In TextModelLogic class change the following:
    • ON_SELECT - if the textModel is null or is not editable do not allow selection.
    • ON_INSERT - the same;
    • ON_DELETE - check if the deleted char is word break force the significance. Both ON_DELETE and ON_INSERT fire CHANGE_TEXT event

while the other ones fires CHANGE_TEXT_FORCED.

  • fireChangeText takes one more parameter - Place place - the Place where deleting/inserting. Used when the CHANGE_TEXT is handled

to decide wether to change the significance of the action.

  • add new method : private static EventR3 createChangeSignificanceEvent(TextChange change, Message description, EventR3 cause,

boolean forceSignificance, Place place) - creates a TEXT_CHANGE event.

  • private static EventR3 createTextEvent(TextChange change, Message description, EventR3 cause, boolean forceSignificance, Place place, TextView.EventIds id) - creates a text event with the given TextView.EventIds.
  • In HotTextLogic add ON_CHANGE_TEXT : handles the TextView.EventIds.CHANGE_TEXT and changes the significance f the action if needed. Fires CHANGE_TEXT_FORCED event. The logic is as follows:
    • If inserted a whitespace - a significant action is made and the significance parameter is true.
    • If the last change and the current chande are insert and delete or vise versa a significant action is made and the significance parameter is true.
    • If inserting/ deleting letters one after another the significance is false.


comment:5 Changed 15 years ago by diana

  • Status changed from s1b_analysis_finished to s2a_design_started

Changed 15 years ago by diana

comment:6 Changed 15 years ago by diana

  • Status changed from s2a_design_started to s3b_implementation_finished

comment:7 Changed 15 years ago by meddle

  • Status changed from s3b_implementation_finished to s3c_implementation_ok
  • Design_score changed from 0 to 4
  • Design_reviewers set to meddle
  • Imp._score changed from 0 to 3.5
  • Imp._reviewers set to meddle, todor

Merged into the trunk at [9166] and [9167].

  • Good implementation.
  • Some of the AutoActions you pulled out are "dead code" (see http://sophie2.org/trac/wiki/AutoActions) so I deleted them, sorry :(
  • You wrote significant end change, but mira wrote this in the AutoActionsUtil long ago, so I replaced it :)
  • And the test is not bad.

comment:8 Changed 13 years ago by meddle

  • Status changed from s3c_implementation_ok to closed
  • Resolution set to obsolete

Closing all the tickets before M Y1

Note: See TracTickets for help on using tickets.