Urgent.News

What's breaking now, across thousands of outlets.

Tech

One optional phone number, eleven files, five kinds of empty, and no migration

Yesterday I added an optional phone number to Nakodo. When a creator or a business says yes to a brand, the app introduces them by email, and the brand can now add a number to go with the address. One field, one afternoon, eleven files in the commit, and a good example of where the work in a small feature actually goes. The database part: nothing A campaign's outreach settings are a jsonb column…

Nakodo, an app that introduces creators and businesses to brands, now allows the addition of an optional phone number alongside an address. This feature is introduced through an email, with the brand having the option to include a phone number when they provide an address. The phone number field is made up of eleven files in the commit, with no migration or ALTER TABLE required. The database schema change is a single line in a TypeScript type, as the field is optional and can be null.

The validation of phone numbers is a crucial aspect of this feature, as it helps ensure that the entered numbers are plausible. The validation process involves two regexes: one for checking the characters (like digits, spaces, brackets, dots, and hyphens) and another for counting the digits to ensure the number falls within the valid range.

The rules for accepting a phone number are that it should be plausible and left as written by the brand. Thus, accepted formats include +44 7700 900123, (020) 7946 0018, and 02079460018, while rejecting invalid representations like call the office or ext 4.

The empty field has five different representations: an empty string in the editor, an empty string in the stored jsonb, null in the thread context, a sentence in the read view, and a required prop on the summary card. Each representation of empty serves a specific purpose, with the aim of maintaining clarity and ensuring the absence of a phone number is handled appropriately.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

A memory benchmark draft with 17 axes and no headline number: is it worth running?

I work at a company that builds memory infrastructure, so I'm biased: we compete in the thing this benchmark measures. We wrote a long-term memory benchmark called glasshouse, and I'd like to know if…

  • Glasshouse is a memory benchmark with 17 separate axes, each reported individually.
  • Benchmark includes 2,847 questions, 1.97 million tokens, and 50 photographs in 10 languages.
  • Creator invites others to run the draft benchmark on their own memory systems.

Firefox Screenshots: Built-in Tool, DevTools, Headless CLI, and Playwright

Firefox has a built-in screenshot tool that's often overlooked. Combined with DevTools, you have flexible options for capturing pages exactly as needed.

  • Built-in tool captures visible content, full pages, or regions
  • DevTools offers controlled full page capture, including below-the-fold
  • Headless CLI via Playwright enables programmable screenshot generation

More from Friday 16 October →