Skip to content

chore: remove 32 unreferenced public/ assets (3.6 MB); key SplitEditor rows by stable id - #1189

Open
ykargeee-bit wants to merge 1 commit into
Lead-Studios:mainfrom
ykargeee-bit:feature/remove-unreferenced-public-files-and-fix-split-editor
Open

ykargeee-bit wants to merge 1 commit into
Lead-Studios:mainfrom
ykargeee-bit:feature/remove-unreferenced-public-files-and-fix-split-editor

Conversation

@ykargeee-bit

Copy link
Copy Markdown
Contributor

Summary

Two housekeeping tasks: deleting unreferenced assets from public/, and fixing
SplitEditor's row keying.

public/ cleanup (#1154)

Of the 35 files under public/, only two groups are referenced anywhere in
src/, the configs, or the content. The other 32 are deleted — 3.6 MB
that is fetched and copied into the build on every deploy, and served as-is.

Kept

File Why
manifest.json manifest: '/manifest.json' in src/app/layout.tsx, required by
ext.config.js, and the reason the app is installable
icons/icon-192x192.png, icons/icon-512x512.png the src entries of the manifest's icons array

Deleted

  • images/events/ — detail.png, detail2.png, event.png (1.3 MB). Left
    over from the pre-reset app;
    ext.config.js images.remotePatterns points
    at images.unsplash.com, cdn.veritix.io and
    es.cloudinary.com, and
    nothing references a local image.
  • Proxima Nova/ — 4 .ttf +
    eadme.html (0.6 MB). No @font-face rule
    and no ont-family declaration exists anywhere in the repo
    ; the app uses

ext/font/google with Inter. These fonts load nothing.

  • Demo_Fonts/ — 11 Fontspring-DEMO-poly-*.otf (0.27 MB). Same reason.
  • 14 loose root files — �uth-layout-img.svg (337 KB), �vatarfemale.png
    (340 KB), pngguru.png (475 KB), concert.png, steptodown.jpg,
    steptodownticket.jpg, eventaillustration.png, djparty.png,
    placeholder-event.svg, ellipse-19.svg, ellipse-20.svg, ile.svg,
    globe.svg, window.svg.

Method

The audit searched, for each filename, all 277 non-public/ files; then
separately checked for literal public/ references, @font-face /
ont-family declarations,
ext/font usage, app-level
icon / opengraph-image /
obots / sitemap conventions, and local
/ url() sources. After deleting, the check was re-run: no
remaining file mentions any removed name.

One correction to the issue's count: it says 34 unreferenced files. At
�efad4cb (HEAD) there are 35 files in public/, and 3 of them must be kept
(manifest.json + 2 icons), leaving 32 to delete — which matches the
3.6 MB figure exactly. The two extra in the issue's count were likely already
removed between 35706d4 and the current HEAD.

SplitEditor (#1094)

Two of the three items in #1094 were already fixed on main by
53c8967 (2026-10-17, "make SplitEditor editable"). At 35706d4 the file was
61 lines with
eadOnly inputs and no onChange call; at HEAD it is 96 lines
with controlled inputs, onChange called from handleChange, and
Add recipient / Remove controls. Verified by diffing both revisions.

The remaining item — key rows by a stable id — is implemented here.

Rows were keyed by array index:

` sx
{rows.map((row, index) => (

`

React reconciles a position, not a row. Removing a row therefore left the
surviving inputs bound to the row that shifted into their place — typing into
"wallet 2" could edit "wallet 1" once an earlier recipient was removed.

owId() now keys by the wallet address, falling back to the index only for
rows too empty to identify themselves, so it stays unique without forcing
callers to thread an id through their state:

sx function rowId(row: SplitRow, index: number): string { const wallet = row.walletAddress.trim(); return wallet ? wallet- : ow-; }

Testing

src/tests/split-editor.test.tsx (new, 8 tests, vitest + testing-library):

  • editing a wallet address and editing a share both call onChange with the
    full updated row array (controlled inputs);
  • Add recipient appends an empty row; Remove drops the target row;
  • Remove is absent when only one row remains;
  • the running total reports Total: 100.00% (balanced) and
    must equal 100% for an unbalanced split;
  • regression test for the keying fix — after removing a row the surviving
    row keeps its own value, and editing it does not touch any other recipient.

Note:
owId is not exported, so the keying test asserts observable behaviour
(typing into the surviving input edits that input) rather than the key string,
which keeps the test honest about the contract rather than the implementation.

Security

No security impact. Nothing was added, moved, or made executable — this is a
pure deletion of dead assets plus a client-side React keying fix. The deleted
files were already public and unauthenticated, and the surviving
manifest.json / icons/ are unchanged.

Bundle impact

Removing 3.6 MB of static assets shrinks the public output copied into every
deployment. No source that referenced them exists, so nothing should change at
runtime;
ext build will confirm.

Closes #1094
Closes #1154

…table id

Removes 32 unreferenced files (3.6 MB) from public/, leaving manifest.json and
icons/ in place, and keys SplitEditor rows by a stable id instead of their
array index.

The public/ audit found that of the 35 files present, only two groups are
referenced anywhere in src/, the configs, or the content:

* manifest.json -- linked from src/app/layout.tsx (manifest: '/manifest.json')
  and next.config.js, and named in the CHANGELOG as what makes the app
  installable.
* icons/icon-192x192.png and icons/icon-512x512.png -- the src entries of the
  manifest's icons array.

Everything else has zero references. Searched for each basename across the 277
non-public files, for literal 'public/' references, for @font-face/font-family
declarations, for app-level icon/og/robots/sitemap conventions, and for local
<img>/url() sources.

Two things the search turned up that explain why these are dead:

* The 11 Fontspring-DEMO-poly-*.otf files and the 4 Proxima Nova .ttf files
  load nothing: the app uses next/font/google (Inter), and there is not a
  single @font-face rule or font-family declaration in the repo.
* The 5 images/events/*.png files are leftovers; next.config.js images
  remotePatterns point at images.unsplash.com, cdn.veritix.io and
  res.cloudinary.com, and nothing local.

After the deletion, re-ran the reference check: no remaining file mentions any
of the removed names.

SplitEditor: rows were keyed by index. React reconciles a position rather than a
row, so removing a row left the surviving inputs bound to the row that shifted
into their place -- typing into 'wallet 2' could edit 'wallet 1' once an
earlier recipient was removed. rowId() now keys by the wallet address and falls
back to the index only for rows too empty to identify themselves.

Note on issue Lead-Studios#1094: two of its three items were already satisfied on main by
53c8967 (2026-10-17) -- inputs are controlled with no readOnly prop, onChange
is called from handleChange, and Add recipient / Remove controls exist. Verified
against 35706d4 (61 lines, broken) vs HEAD (96 lines, working). The remaining
item, stable row keying, is what this commit implements.
@drips-wave

drips-wave Bot commented Oct 19, 2026

Copy link
Copy Markdown

@ykargeee-bit Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: remove 34 unreferenced files (3.6 MB) from public/ fix: SplitEditor renders both inputs readOnly and never calls onChange

1 participant