OpenFn / OpenFn/lightning

Warn before closing a form with unsaved changes

Open
#780 15 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature enhancement
Dominant language
Elixir
Stars
296
Forks
86
Avg merge
1d 13h
Merged PRs (30d)
50

Description

Starting with the job builder because it's the most high-impact, we need an elegant and generic way to detect when a form has unsaved changes (maybe through the validate hook?) then then display a warning before the user closes.

This is particularly important on the job builder since clicking anywhere else on the canvas will close the form. See @josephjclark 's old https://github.com/OpenFn/Lightning/issues/280

  • When making changes to a job, a user's changes aren't saved until the "save" button is pressed (this itself is arguably a little bit anachronistic).
  • If the user refreshes the page, navigates away or goes "back" (easily done with a misplaced gesture), all changes will be lost without warning.
  • This is particularly painful when writing job code.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the job builder form and its close/cancel click handling, then review how its changeset and validate hook expose unsaved changes. Check the referenced Phoenix LiveView link behavior for the client event. Done means refresh, navigation, back, and closing the form warn users before unsaved job changes are lost.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.