Skip to content

Asset editor improvements#224

Merged
sehugg merged 29 commits intosehugg:masterfrom
fredsa:asseteditor
Mar 23, 2026
Merged

Asset editor improvements#224
sehugg merged 29 commits intosehugg:masterfrom
fredsa:asseteditor

Conversation

@fredsa
Copy link
Copy Markdown
Contributor

@fredsa fredsa commented Mar 1, 2026

  • Reformat affected files prior to other commits
  • Fix asset undo (Asset Editor doesn't undo properly #213)
  • Implement asset editor redo
  • Create distinct undo for each asset edit
  • Limit asset editor to undos in current session
  • Fix stacking "no more undo/redo" alerts
  • Ignore ';;' that is a new ';;{…};;' asset block
  • Asset editor displays line number ranges and header
  • Click line number range to jump to highlighted lines
  • Show errors for assets with incorrect number of values
  • Fix bad edits when source has different length values
  • Fix length new data values written
  • Align thumbnails to the top to prevent visual jumps
  • Dismiss highlighted lines on user interaction
  • Replace affected asset range, not entire file contents
  • Asset undo inside source editor shows affected lines
  • Likely fixes [Possible bug] Asset editor gets reset #62

@fredsa fredsa changed the title Asset editor fix undo #213, add redo Asset editor improvements Mar 2, 2026
@fredsa
Copy link
Copy Markdown
Contributor Author

fredsa commented Mar 2, 2026

Updated PR title and the initial comment

@fredsa
Copy link
Copy Markdown
Contributor Author

fredsa commented Mar 2, 2026

Rebased commits on origin/master

@fredsa
Copy link
Copy Markdown
Contributor Author

fredsa commented Mar 2, 2026

Last two commits add:

  • affordance for asset line numbers in asset editor
  • clickable asset editor decorations in source code

@fredsa fredsa force-pushed the asseteditor branch 2 times, most recently from 7635b5d to d44745a Compare March 4, 2026 22:58
@fredsa
Copy link
Copy Markdown
Contributor Author

fredsa commented Mar 4, 2026

Rebased on origin/master

@fredsa fredsa force-pushed the asseteditor branch 2 times, most recently from 2a8a45b to 514820b Compare March 6, 2026 02:42
@fredsa
Copy link
Copy Markdown
Contributor Author

fredsa commented Mar 6, 2026

  • Fix validateAssetData, add max reachable offset
    calculation, fixes NES issues with chr_generic.s
  • Add validateAssetData support for rletag
  • Fix broken asset editing and undo when asset source
    has not been previously opened manually, for example
    when reloading the #asseteditor page directly
  • Fix palette color undo/redo

@fredsa
Copy link
Copy Markdown
Contributor Author

fredsa commented Mar 6, 2026

  • Implement #asseteditor/filename/lineno support,
    and highlight selected asset on navigation

@fredsa
Copy link
Copy Markdown
Contributor Author

fredsa commented Mar 6, 2026

  • place the "asset editor" decoration after header instead at the end of the line

@fredsa fredsa force-pushed the asseteditor branch 3 times, most recently from 660a4df to 406f399 Compare March 9, 2026 01:00
@fredsa
Copy link
Copy Markdown
Contributor Author

fredsa commented Mar 19, 2026

Rebased on origin/master

fredsa added 22 commits March 22, 2026 10:40
- For each detected asset, display its line number
  and header snippet for reference.
- When asset data cannot be found or the number
  of values detected is incorrect, and inline
  error message is displayed instead of a (broken)
  asset editor.
align-items: flex-start
Use bpw or verilog spec to pad correct number of chars.
Do not treat a new asset block
as the end of a previous block
Asset editor replaces text ranges instead of
the entire source file. Undo inside the source
code now scrolls asset editor edits into view,
and selects the text being edited, so that what
is being (un)edited is much clearer. Also, undo
history is no longer burdened by full file edits.
Add calculation of maximum reachable offset.
Fixes errors with `chr_generic.s`
Fix broken asset edit and undo when the asset
source file has not been opened manually, for
example when reloading the #asseteditor page
directly.
- Track selected asset in hash
- Highlight selected asset on navigation
@fredsa
Copy link
Copy Markdown
Contributor Author

fredsa commented Mar 22, 2026

Screenshots:

Untitled image

@sehugg
Copy link
Copy Markdown
Owner

sehugg commented Mar 22, 2026

Very cool! Glad to see Asset Editor getting some love. Lemme take a closer look at everything and merge soon. Have you been using it succesfully in your projects?

@fredsa
Copy link
Copy Markdown
Contributor Author

fredsa commented Mar 22, 2026

Thanks. This PR was a bit of a treasure hunt adventure, to find all different things it supported across platforms.

I've spent a fair bit of time with the undo/redo functionality, and how it interacts with editor edits. One design choice was that when you navigate to the asset editor its undo/redo stack is reset. That way extra undos from the user won't result in surprises (i.e. source code edits unrelated to the asset editor being undone and lost to the sands of time).

Open to more ideas to improve the UX. Please feel free to change the CSS. I really like the filename pill at the top of the asset editor cards. I don't feel that my visual additions to the asset editor and text editor look as good as that aesthetic.

@sehugg sehugg merged commit 4ce59be into sehugg:master Mar 23, 2026
1 check passed
@sehugg
Copy link
Copy Markdown
Owner

sehugg commented Mar 23, 2026

Undo/redo resetting makes sense for this case, glad you figured it out. I'll go ahead and merge and any minor issues can be cleaned up later. Thanks! Looks good!

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.

[Possible bug] Asset editor gets reset

2 participants