Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A4A: Updates to get Site Details pane fully functional #90182

Open
wants to merge 5 commits into
base: trunk
Choose a base branch
from

Conversation

rcoll
Copy link
Member

@rcoll rcoll commented May 1, 2024

Proposed Changes

  • This PR removes the custom tags and tag field implementation in A4A, and instead uses the WordPress FormTokenField component that is native to both WordPress and Calypso.
  • We also decided to go ahead and get site notes wired up and working.

Testing Instructions

Load the site tags field for an A4A site (inside site details pane) and check:

  • Existing tags load with the page.
  • New tags get submitted in the network request.
  • Removing tags actually removes them.
  • A reload maintains the actual state of the site tags.

Also, while you're there, you might as well test the notes field also:

  • Submitting a note works, shows up immediately, and persists upon refresh.
  • Styles/design of the notes are roughly okay.
Screenshot 2024-05-02 at 5 45 48 PM

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

@rcoll rcoll added the A4A label May 1, 2024
@rcoll rcoll requested a review from heydemoura May 1, 2024 23:55
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label May 1, 2024
@rcoll rcoll self-assigned this May 1, 2024
@rcoll rcoll added [Status] In Progress and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels May 2, 2024
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label May 2, 2024
@matticbot
Copy link
Contributor

matticbot commented May 2, 2024

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

App Entrypoints (~34 bytes removed 📉 [gzipped])

name                   parsed_size           gzip_size
entry-stepper               -166 B  (-0.0%)      -34 B  (-0.0%)
entry-main                  -166 B  (-0.0%)      -34 B  (-0.0%)
entry-subscriptions         -146 B  (-0.0%)      -24 B  (-0.0%)
entry-login                 -146 B  (-0.0%)      -24 B  (-0.0%)
entry-domains-landing       -146 B  (-0.0%)      -24 B  (-0.0%)
entry-browsehappy           -146 B  (-0.1%)      -24 B  (-0.1%)

Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used.

Sections (~9455 bytes added 📈 [gzipped])

name                    parsed_size           gzip_size
a8c-for-agencies-sites     +20671 B  (+1.4%)    +5923 B  (+1.5%)
import-flow                   -20 B  (-0.0%)       -3 B  (-0.0%)
devdocs                       -20 B  (-0.0%)       +2 B  (+0.0%)
backup                        -14 B  (-0.0%)     -705 B  (-0.2%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Async-loaded Components (~96 bytes removed 📉 [gzipped])

name                                                                         parsed_size           gzip_size
async-load-design-wordpress-components-gallery                                     +58 B  (+0.0%)      -86 B  (-0.0%)
async-load-automattic-global-styles-src-components-global-styles-variations        -20 B  (-0.0%)       -4 B  (-0.0%)
async-load-automattic-design-preview                                               -20 B  (-0.0%)       -6 B  (-0.0%)

React components that are loaded lazily, when a certain part of UI is displayed for the first time.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@rcoll rcoll changed the title A4A: Use FormTokenField instead of custom tags component A4A: Updates to get Site Details pane fully functional May 2, 2024
Comment on lines 26 to 32
const maybeSubmit = ( e: any ) => {
if ( 'Enter' === e.key ) {
e.preventDefault();
onCreateNote( fieldState );
setFieldState( '' );
}
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's a textarea wouldn't people want to insert newlines?

@jeffgolenski
Copy link
Member

Just a couple notes (see what I did there?). Tested on live branch. Behavior is weird when jumping between sites. Avatar, name, date not showing up.

tags-notes-testinmg.mp4

@atanas-dev atanas-dev assigned atanas-dev and unassigned rcoll May 13, 2024
@atanas-dev
Copy link
Member

I'll take over and push some updates to address feedback with a minimal time investment.

@atanas-dev
Copy link
Member

@jeffgolenski @rcoll I've refactored the patch - can you folks please give it another test? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A4A [Status] In Progress [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants