Open Bug 2061587 Opened 3 months ago Updated 6 days ago

Implement location row MVP

Categories

(Calendar :: Calendar Frontend, task)

task
Points:
3

Tracking

(Not tracked)

ASSIGNED

People

(Reporter: arschmitz, Assigned: vineet)

References

(Blocks 4 open bugs)

Details

(Whiteboard: [calendar-ui-create-edit])

Attachments

(1 external file)

Summary:

Add a Location row where the user can type a place or address. Keep changes in the draft—the event’s unsaved values—until the user selects Save.

Links:

Acceptance criteria:

  • Show Location in the main dialog. Use the shared row from Bug 2061586.

  • For a new event, Location starts off and empty.

  • For an existing event with a location, show Location as on and fill the input with the saved text.

  • Turning Location on shows the text input.

  • Typing changes only the draft, not the saved event.

  • Turning Location off marks the row as disabled and keeps both the input text and draft text. Selecting Save then removes any previously saved location.

  • Turning Location on without entering text does not save placeholder text or a null value.

  • Turning Location back on marks it as enabled and shows the retained text.

Required implementation details:

  • Store the on/off value and location text in the existing Redux draft. Redux holds shared application state. Do not add a separate state section, or “slice,” just for Location.
  • Keep these values as plain data. Do not store address-service results, selected-address objects, calIEvent objects, calendar objects, page elements, or temporary editor state in the draft.
  • Use storeObserver to receive the initial location values and later updates. Register a stable set of selectors—the functions that choose which state values the row needs. Do not read the store from getters.
  • Send toggle and text changes through updateSection({ section: "location", patch }). Each patch must change only Location.
  • The Location code owns conversion between event data and draft values.
  • Use the row enabled state added in Bug 2061214. The Save helper writes nonempty text only when Location is enabled. It removes the saved location when the row is disabled or the user has made its text empty. It does not clear retained input or draft text.
  • Only the existing create/edit Save operation changes the saved event.
  • When the dialog switches to another event or a new create/edit session, clear unfinished local input. Ignore late input events from the old session.
  • Load the initial location values and finish any resulting row expansion before PositionedDialog.show(). Loading must not make the dialog grow after its position is set.
  • After the dialog opens, toggle changes use its existing resize and scroll rules. The Location row must not position or resize the dialog itself.

Minimum test coverage:

  • Check that a new event starts with Location off and empty.
  • Check that an existing location appears before the dialog is shown.
  • Check toggle expansion and text changes in the draft.
  • Check that turning Location off keeps both input and draft text, and turning it on restores the text. Save with Location off must omit it for a new event and remove it from an existing event. Check that failed Save keeps the row state and text.
  • Check that an enabled but empty Location saves no placeholder or null value.
  • Check conversion between draft text and the saved event’s location.
  • Check that late input from an old session cannot change the current draft.
  • Check that initial row expansion finishes before showing the dialog.
  • Run axe automated accessibility checks where supported.

Out of scope:

  • Searching for addresses, showing suggestions, storing details for a selected address, and opening an address link.
  • Choosing an address service or managing its requests and late responses.
  • Bug 2061589 owns that work if product approves it.
Blocks: 2061589

TB-Tools story description:

Summary:

Add a Location row where the user can type a place or address. Keep changes in the draft—the event’s unsaved values—until the user selects Save.

Links:

Acceptance criteria:

  • Show Location in the main dialog. Use the shared row from Bug 2061586.
  • For a new event, Location starts off and empty.
  • For an existing event with a location, show Location as on and fill the input with the saved text.
  • Turning Location on shows the text input.
  • Typing changes only the draft, not the saved event.
  • Turning Location off marks the row as disabled and keeps both the input text and draft text. Selecting Save then removes any previously saved location.
  • Turning Location back on marks it as enabled and shows the retained text.
  • Turning Location on without entering text does not save placeholder text or a null value.

Required implementation details:

  • Store the on/off value and location text in the existing Redux draft. Redux holds shared application state. Do not add a separate state section, or “slice,” just for Location.
  • Keep these values as plain data. Do not store address-service results, selected-address objects, calIEvent objects, calendar objects, page elements, or temporary editor state in the draft.
  • Use storeObserver to receive the initial location values and later updates. Register a stable set of selectors—the functions that choose which state values the row needs. Do not read the store from getters.
  • Send toggle and text changes through updateSection({ section: "location", patch }). Each patch must change only Location.
  • The Location code owns conversion between event data and draft values.
  • Use the row enabled state added in Bug 2061214. The Save helper writes nonempty text only when Location is enabled. It removes the saved location when the row is disabled or the user has made its text empty. It does not clear retained input or draft text.
  • Only the existing create/edit Save operation changes the saved event.
  • When the dialog switches to another event or a new create/edit session, clear unfinished local input. Ignore late input events from the old session.
  • Load the initial location values and finish any resulting row expansion before PositionedDialog.show(). Loading must not make the dialog grow after its position is set.
  • After the dialog opens, toggle changes use its existing resize and scroll rules. The Location row must not position or resize the dialog itself.

Minimum test coverage:

  • Check that a new event starts with Location off and empty.
  • Check that an existing location appears before the dialog is shown.
  • Check toggle expansion and text changes in the draft.
  • Check that turning Location off keeps both input and draft text, and turning it on restores the text. Save with Location off must omit it for a new event and remove it from an existing event. Check that failed Save keeps the row state and text.
  • Check that an enabled but empty Location saves no placeholder or null value.
  • Check conversion between draft text and the saved event’s location.
  • Check that late input from an old session cannot change the current draft.
  • Check that initial row expansion finishes before showing the dialog.
  • Run axe automated accessibility checks where supported.

Out of scope:

  • Searching for addresses, showing suggestions, storing details for a selected address, and opening an address link.
  • Choosing an address service or managing its requests and late responses.
  • Bug 2061589 owns that work if product approves it.
Points: --- → 3
Type: enhancement → task
Assignee: nobody → vineet
Blocks: 2080883

Note that this is no longer blocked by https://bugzilla.mozilla.org/show_bug.cgi?id=2061586 as the toggleable-row component has been created and merged in.

Status: NEW → ASSIGNED
Attachment #9687897 - Attachment description: WIP: Bug 2061587- Implement location row MVP. → WIP: Bug 2061587 - Implement location row in calendar event dialog
Attachment #9687897 - Attachment description: WIP: Bug 2061587 - Implement location row in calendar event dialog → Bug 2061587 - Implement location row in calendar event dialog
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: