Skip to content

feat(ctr): image upload support#406

Merged
ashquarky merged 6 commits intodevfrom
work/shot-final-stretch
Mar 10, 2026
Merged

feat(ctr): image upload support#406
ashquarky merged 6 commits intodevfrom
work/shot-final-stretch

Conversation

@ashquarky
Copy link
Member

Resolves #XXX

Changes:

  • Adds UI for uploading screenshots on CTR. Users can choose either the top or bottom screen, with a large preview pane and a clear button. Implements the various hackery required for making the upload actually happen.
  • Adjusts backend to handle uploads as form files, which is CTR's method of doing so.
  • Minor client JS fixes:
    • Use classList polyfill everywhere and remove old impl
    • Fix select/unselect bug on follow button (this needs a full rework, like empathy got, but problems for later
    • Fix missing PJAX links and refresh calls that could result in doing full page loads (and losing history) when switching tabs.

Release announcement absolutely must credit @760ceb3b9c0ba4872cadf3ce35a7a494 and @Enderspearl184, whose research into LLS and the applet made this possible at all. Their info is the only reason we know how uploading works.

Depends on #403 - draft until that lands.

@ashquarky ashquarky requested a review from mrjvs March 6, 2026 12:36
@suprstarrd
Copy link
Contributor

Here's the corrected link for "various hackery"

@suprstarrd
Copy link
Contributor

Resolves #320

@Rhlp-Engineering
Copy link

Rhlp-Engineering commented Mar 8, 2026

wowie! yay! thanks! this will be cool, il be able to show off my minecraft stuff!

@ashquarky ashquarky linked an issue Mar 9, 2026 that may be closed by this pull request
7 tasks
Base automatically changed from work/upload-controls to dev March 9, 2026 13:08
@ashquarky ashquarky force-pushed the work/shot-final-stretch branch from e95881d to d75c38a Compare March 9, 2026 13:15
@ashquarky ashquarky marked this pull request as ready for review March 9, 2026 13:16
Copy link
Contributor

@mrjvs mrjvs left a comment

Choose a reason for hiding this comment

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

I can't test properly, but it looks good in browser.
Couple comments, nothing major

padding: 5px;
#shot-preview {
float: right;
width: 200px; /* to do */
Copy link
Contributor

Choose a reason for hiding this comment

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

todo?

Copy link
Member Author

Choose a reason for hiding this comment

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

Honestly can't remember what this was. probably maintaining aspect-ratio (later solved with background-size: contain)

Comment on lines +96 to +107
<div id="shot-preview" data-shot-preview="1"></div>

<div className="shot-picker">
<input type="radio" name="shot-type" className="shot top" data-shot="1" data-lls="shot-top"></input>
<input type="radio" name="shot-type" className="shot btm" data-shot="0" data-lls="shot-btm"></input>
<div id="shot-clear">
<div className="sprite sp-clear centred"></div>
<input type="radio" name="shot-type" data-shot-clear="1"></input>
</div>
</div>

<input type="file" name="shot" data-shot-upload="1" disabled></input>
Copy link
Contributor

Choose a reason for hiding this comment

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

I've seen you type out <tag></tag> multiple times. Just wanna remind you that you can selfclose them like this: <tag/>.

Mostly preference though, just wanted to say it just incase you don't know about it.

Copy link
Member Author

Choose a reason for hiding this comment

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

I do, VSCode just defaults to the syntax

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe we can have an ESLint rule for this?

@ashquarky ashquarky requested a review from mrjvs March 10, 2026 00:32
@ashquarky ashquarky merged commit 009f0e3 into dev Mar 10, 2026
11 checks passed
@ashquarky ashquarky deleted the work/shot-final-stretch branch March 10, 2026 02:01
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.

[Feature]: Image uploads for CTR

4 participants