Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
7e4833c
Let remix owners sync with the original and keep pull request merges …
Mistium Nov 22, 2026
ae60c5b
Share merge conflict handling across pull requests, branches and remi…
Mistium Nov 22, 2026
eb649ac
Explain pull merge refusals and reload when a head moved
Mistium Nov 22, 2026
d90db3d
Show merge conflict text in a monospace font
Mistium Nov 22, 2026
064ce60
Keep sync on the current branch, cache pull asset refs with the diff,…
Mistium Nov 22, 2026
8d2ab05
Explain a pull request whose target branch was deleted
Mistium Nov 22, 2026
17de862
Keep remix sync sessions across navigation, reload branch merges when…
Mistium Nov 22, 2026
5c6051e
Drop pull diffs started before a merge restart, translate every merge…
Mistium Nov 22, 2026
71de159
Reload a pull request that was closed by someone else
Mistium Nov 22, 2026
585851e
Guard the pull merge button by branch, close sessions on a deleted ta…
Mistium Nov 22, 2026
08b35dc
Explain a pull on another branch in plain text and return to the summ…
Mistium Nov 22, 2026
6c16b93
Say when a pull request's target branch was deleted
Mistium Nov 22, 2026
d6d680f
Refresh the branch gate on refusal and when the viewer returns
Mistium Nov 22, 2026
abc372c
Guard pull actions across navigation, quiet the branch refresh, and l…
Mistium Nov 23, 2026
0a248c3
Address round 9 GUI review feedback
Mistium Nov 23, 2026
12a3ad3
Address round 10 GUI review feedback
Mistium Nov 24, 2026
601e619
Address round 11 GUI review feedback
Mistium Nov 24, 2026
6762f28
Match diff3 9-character conflict markers and test live sprite text head
Mistium Nov 24, 2026
f2510f8
Drop dead pull fileCount fallback before diff loads
Mistium Nov 24, 2026
6ba4160
Keep default branch file view on refreshed gitHead after focus
Mistium Nov 24, 2026
7634c9a
Bypass client GET cache for commits and getPull and guard stale lates…
Mistium Nov 24, 2026
ae2998e
Clear branch merge error on branch management actions and test cache …
Mistium Nov 24, 2026
10e19aa
Share canMaintainProject, clear branch error on merge, and refresh br…
Mistium Nov 24, 2026
b146200
Surface branch gate during conflict sessions and handle 403/404 merge…
Mistium Nov 24, 2026
976a847
Reload branches on 404 merge refusal and refine pull 403 notices
Mistium Nov 24, 2026
a075a01
Show pull error notice when branch gate is hidden and guard null sess…
Mistium Nov 24, 2026
83ec082
Gate branchBlocked on canMerge so close 403 notice is not cleared
Mistium Nov 24, 2026
f708a0f
Unify branchBlocked predicate, refine sync_unavailable and branch 404…
Mistium Nov 24, 2026
9f69504
Match exact server message for no-common-commit sync_unavailable refusal
Mistium Nov 24, 2026
0b5e93c
Guard ProjectBranches async handlers on unmount and reset sync sessio…
Mistium Nov 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "scratch-gui",
"version": "3.13.0",
"version": "3.14.0",
"private": true,
"description": "MistWarp editor, player, and community site",
"author": "MistWarp contributors",
Expand Down
11 changes: 7 additions & 4 deletions src/community/api/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const updateCommit = (id, sha, patch) => request(
);

export default {
commits: id => request(`/projects/${id}/commits`),
commits: id => request(`/projects/${id}/commits`, {cache: false}),
branches: id => request(`/projects/${id}/branches`),
createBranch: (id, name, from) => request(`/projects/${id}/branches`, {
method: 'POST',
Expand Down Expand Up @@ -66,7 +66,7 @@ export default {
updateCommit,
setCommitCoAuthors: (id, sha, coAuthors) => updateCommit(id, sha, {coAuthors}),
pulls: id => request(`/projects/${id}/pulls`),
getPull: (id, index) => request(`/projects/${id}/pulls/${index}`),
getPull: (id, index) => request(`/projects/${id}/pulls/${index}`, {cache: false}),
pullTimeline: (id, index) => request(`/projects/${id}/pulls/${index}/timeline`),
addPullComment: (id, index, content) =>
request(`/projects/${id}/pulls/${index}/comments`, {method: 'POST', body: {content}}),
Expand All @@ -82,8 +82,11 @@ export default {
}),
mergePull: (id, index) => request(`/projects/${id}/pulls/${index}/merge`, {method: 'POST'}),
closePull: (id, index) => request(`/projects/${id}/pulls/${index}/close`, {method: 'POST'}),
uploadPullMerge: (id, {sb3, mergeTree, expectedHead, pullId}) =>
uploadProject(id, sb3, null, null, {mergeTree, expectedHead, pullId}),
uploadPullMerge: (id, {sb3, mergeTree, expectedHead, pullId, sourceHead}) =>
uploadProject(id, sb3, null, null, {mergeTree, expectedHead, pullId, mergeSourceHead: sourceHead}),
syncRemix: id => request(`/projects/${id}/remix/sync`, {method: 'POST', timeoutMs: SLOW_GET_TIMEOUT}),
uploadRemixSync: (id, {sb3, mergeTree, expectedHead, syncHead}) =>
uploadProject(id, sb3, null, null, {mergeTree, expectedHead, syncHead}),
uploadBranchMerge: (id, {sb3, mergeTree, sourceBranch, targetBranch, sourceHead, targetHead}) =>
uploadProject(id, sb3, null, null, {
mergeTree,
Expand Down
115 changes: 115 additions & 0 deletions src/community/components/ForkStatus.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
import PropTypes from 'prop-types';
import React from 'react';
import {Link} from 'react-router-dom';
import {GitFork, RefreshCw} from 'lucide-react';
import {useCommunityIntl as useCommunityText} from '../i18n.jsx';
import {remixDivergenceSentence, remixParentLabel, remixSyncUnknown} from '../remix-origin.js';
import MergeConflicts from './MergeConflicts.jsx';
import Button from './ui/Button.jsx';
import Notice from './ui/Notice.jsx';
import styles from './ForkStatus.module.css';

const ForkStatus = ({canContribute, canSync, contributeHref, gitHead, hasUncommitted, projectId, remixFrom, sync}) => {
const {text: communityText} = useCommunityText();
const {busy, error, notice, session, cancel, chooseBinary, dismissNotice, resolve, updateText} = sync;
const startSync = sync.sync;
const original = remixParentLabel(remixFrom);
const hintId = `fork-sync-hint-${projectId}`;
const showSync = canSync && (remixFrom.behind > 0 || remixSyncUnknown(remixFrom, gitHead)) && !session;
// eslint-disable-next-line max-len
const conflictLead = communityText('This remix and {value1} changed the same files. Edit the text conflicts and choose which version of each asset to keep.', {value1: original});

return (
<div className={styles.forkStatusGroup}>
<div className={styles.forkStatus}>
<p className={styles.forkMessage}>
<GitFork size={15} aria-hidden="true" />
<span>{remixDivergenceSentence(remixFrom, communityText)}</span>
</p>
{canContribute ? (
<Link className={styles.forkAction} to={contributeHref}>
{communityText('Contribute')}
</Link>
) : null}
{showSync ? (
<Button
size="small"
variant="primary"
busy={busy}
busyLabel={communityText('Syncing…')}
disabled={hasUncommitted}
aria-describedby={hasUncommitted ? hintId : null}
onClick={startSync}
>
<RefreshCw size={14} />
{communityText('Sync with original')}
</Button>
) : null}
</div>
{showSync && hasUncommitted ? (
<p className={styles.hint} id={hintId}>
{communityText('Commit your saved changes in the editor before syncing, so they are not replaced.')}
</p>
) : null}
{error && !session ? <Notice variant="error">{error}</Notice> : null}
{notice ? <Notice variant="success" onDismiss={dismissNotice}>{notice}</Notice> : null}
{session ? (
<MergeConflicts
title={communityText('Resolve sync conflicts')}
lead={conflictLead}
conflicts={session.conflicts}
binaryConflicts={session.binaryConflicts}
keepLabel={communityText('Keep this remix')}
useLabel={communityText('Use the original')}
submitLabel={communityText('Save resolutions and sync')}
busy={busy}
busyLabel={communityText('Syncing…')}
error={error}
focusOnMount
headingLevel="h2"
onTextChange={updateText}
onChoose={chooseBinary}
onSubmit={resolve}
actions={(
<Button
disabled={busy}
onClick={cancel}
>
{communityText('Cancel')}
</Button>
)}
/>
) : null}
</div>
);
};

ForkStatus.propTypes = {
canContribute: PropTypes.bool,
canSync: PropTypes.bool,
contributeHref: PropTypes.string,
gitHead: PropTypes.string,
hasUncommitted: PropTypes.bool,
projectId: PropTypes.string.isRequired,
remixFrom: PropTypes.shape({
ahead: PropTypes.number,
behind: PropTypes.number,
head: PropTypes.string,
owner: PropTypes.string,
title: PropTypes.string
}).isRequired,
sync: PropTypes.shape({
busy: PropTypes.bool,
error: PropTypes.string,
notice: PropTypes.string,
session: PropTypes.object,
sync: PropTypes.func,
resolve: PropTypes.func,
cancel: PropTypes.func,
updateText: PropTypes.func,
chooseBinary: PropTypes.func,
dismissNotice: PropTypes.func
}).isRequired
};

export default ForkStatus;
49 changes: 49 additions & 0 deletions src/community/components/ForkStatus.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
.forkStatusGroup {
display: grid;
gap: var(--space-2);
}

.forkStatus {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: var(--space-2) var(--space-3);
padding: var(--space-3) var(--space-4);
border-radius: var(--radius-sm);
background: var(--bg-card);
box-shadow: var(--card-shadow);
color: var(--text-dim);
font-size: var(--fs-sm);
}

.forkMessage {
display: flex;
flex: 1 1 260px;
align-items: flex-start;
gap: var(--space-2);
min-width: 0;
margin: 0;
}

.forkMessage svg {
flex: none;
margin-top: 2px;
color: var(--text-faint);
}

.forkAction {
flex: none;
color: var(--accent-strong);
font-weight: 600;
}

.forkAction:hover {
text-decoration: underline;
}

.hint {
margin: 0;
padding: 0 var(--space-4);
color: var(--text-dim);
font-size: var(--fs-sm);
}
136 changes: 136 additions & 0 deletions src/community/components/MergeConflicts.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
import PropTypes from 'prop-types';
import React, {useEffect, useRef} from 'react';
import {GitMerge} from 'lucide-react';
import Button from './ui/Button.jsx';
import Notice from './ui/Notice.jsx';
import SectionHeading from './ui/SectionHeading.jsx';
import styles from './MergeConflicts.module.css';

let nextConflictId = 0;

const MergeConflicts = ({
actions,
binaryConflicts,
busy,
busyLabel,
conflicts,
error,
focusOnMount,
headingLevel,
keepLabel,
lead,
onChoose,
onSubmit,
onTextChange,
submitLabel,
title,
useLabel
}) => {
const sectionRef = useRef(null);
const idPrefix = useRef(null);
if (idPrefix.current === null) {
nextConflictId += 1;
idPrefix.current = `merge-conflicts-${nextConflictId}`;
}
useEffect(() => {
if (focusOnMount && sectionRef.current) sectionRef.current.focus();
}, []);
const submit = (
<Button variant="primary" busy={busy} busyLabel={busyLabel} onClick={onSubmit}>
<GitMerge size={16} />
{submitLabel}
</Button>
);
return (
<section
ref={sectionRef}
className={styles.conflicts}
tabIndex={focusOnMount ? -1 : null}
aria-label={typeof title === 'string' ? title : null}
>
<SectionHeading
as={headingLevel || 'h3'}
icon={GitMerge}
title={title}
lead={lead}
/>
{conflicts.map(file => (
<label key={file.path}>
<span className={styles.path}>{file.path}</span>
<textarea
className="monospace"
spellCheck={false}
value={file.content}
disabled={busy}
onChange={event => onTextChange(file.path, event.target.value)}
/>
</label>
))}
{binaryConflicts.map((file, position) => (
<div
className={styles.binaryConflict}
key={file.path}
role="group"
aria-labelledby={`${idPrefix.current}-asset-${position}`}
>
<span
className={styles.path}
id={`${idPrefix.current}-asset-${position}`}
>{file.path}</span>
<button
type="button"
aria-pressed={file.choice === 'target'}
className={file.choice === 'target' ? styles.choiceActive : ''}
disabled={busy}
onClick={() => onChoose(file.path, 'target')}
>
{keepLabel}
</button>
<button
type="button"
aria-pressed={file.choice === 'source'}
className={file.choice === 'source' ? styles.choiceActive : ''}
disabled={busy}
onClick={() => onChoose(file.path, 'source')}
>
{useLabel}
</button>
</div>
))}
{error ? <Notice variant="error">{error}</Notice> : null}
{actions ? (
<div className={styles.actions}>
{submit}
{actions}
</div>
) : submit}
</section>
);
};

MergeConflicts.propTypes = {
actions: PropTypes.node,
binaryConflicts: PropTypes.arrayOf(PropTypes.shape({
path: PropTypes.string,
choice: PropTypes.string
})).isRequired,
busy: PropTypes.bool,
busyLabel: PropTypes.node,
conflicts: PropTypes.arrayOf(PropTypes.shape({
path: PropTypes.string,
content: PropTypes.string
})).isRequired,
error: PropTypes.node,
focusOnMount: PropTypes.bool,
headingLevel: PropTypes.oneOf(['h2', 'h3']),
keepLabel: PropTypes.node.isRequired,
lead: PropTypes.node,
onChoose: PropTypes.func.isRequired,
onSubmit: PropTypes.func.isRequired,
onTextChange: PropTypes.func.isRequired,
submitLabel: PropTypes.node.isRequired,
title: PropTypes.node.isRequired,
useLabel: PropTypes.node.isRequired
};

export default MergeConflicts;
Loading