facia-tool icon indicating copy to clipboard operation
facia-tool copied to clipboard

Address unreliable text editing in Breaking News Tool

Open SHession opened this issue 1 month ago • 1 comments

What's changed?

This PR attempts to address #1875. In particular, when text is completely removed from the headline input it should not then reappear with the default, it should stay empty. The placeholder text has also be changed from the CAPI headline to the "Enter headline..." which goes for other text inputs on cards too.

Situation GIF
Before 2025-11-20 10 12 15
After 2025-11-20 15 48 22

Implementation notes

I found implementing this fairly tricky, in particular the edge case of a headline being saved as an empty string. Ideally you shouldn't be able to save the text as empty, but there doesn't seem to be a provision for this in the code.

Currently if a user sets the headline to empty in the clipboard and hits save they will see "No headline!", if they refresh the page it will return to the value from CAPI. If they do this in a collection, the headline is replaced by the CAPI value.

I think this an acceptable solution as I can't see any obvious footguns. I'm open to suggestions on this.

Checklist

General

  • [ ] 🤖 Relevant tests added
  • [x] ✅ CI checks / tests run locally
  • [ ] 🔍 Checked on CODE

Client

  • [x] 🚫 No obvious console errors on the client (i.e. React dev mode errors)
  • [ ] 🎛️ No regressions with existing user interactions (i.e. all existing buttons, inputs etc. work)
  • [ ] 📷 Screenshots / GIFs of relevant UI changes included

SHession avatar Nov 20 '25 10:11 SHession

Tested locally , works well. 👍🏼 . Just checking , in case the headline is fully deleted, and on clicking 'Save edits' it would show 'No headline!'. But this would be reverted back to the original headline on refreshing tha page . Also dragging and dropping the clipboard copy with 'No headline' to any regional container would cause the original headline to reappear. That's the expected behaviour ?

That's correct. The behaviour is slightly quirky, but hopefully an edge case and an general improvement to the expected user behaviour. I'll put together some comms ahead of release to ensure CP are aware of the oddness.

SHession avatar Nov 25 '25 08:11 SHession

Seen on PROD (merged by @SHession 6 minutes and 3 seconds ago) Please check your changes!

gu-prout[bot] avatar Nov 25 '25 15:11 gu-prout[bot]