An edited post's versions open from its card
The card marks an edited post with a button that opens its versions, newest first (/statuses/:id/history), each with its time, warning and words; PrivaPub now has a remote post's earlier versions from Pleroma's formerRepresentations too. The composer's e2e test opens the history after its edit. The wall test retries smuser's post while Smithereen has not yet had the persona's Accept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw
This commit is contained in:
1 parent
03824babbc
commit
bb68ff8d5e
10 files changed
+91
-8
No files matched your search
@@ -109,11 +109,12 @@
|
||||
<NerdTip Heading="@Localizer["Post"]" Rows="PostRows()" Pending="isReadingProvenance" OnOpen="ReadProvenance"
|
||||
Placement="DTooltipPlacement.Bottom" Align="DTooltipAlign.End">
|
||||
<time datetime="@NerdRow.Time(status.CreatedAt)" class="opacity-80">@status.CreatedAt.GetPassedTime(Localizer)</time>
|
||||
@if (status.EditedAt is not null)
|
||||
{
|
||||
<span class="opacity-60">*</span>
|
||||
}
|
||||
</NerdTip>
|
||||
@if (status.EditedAt is not null)
|
||||
{
|
||||
<button type="button" class="link link-hover opacity-60" data-history title="@Localizer["Edit history"]"
|
||||
@onclick="() => OpenHistory(status)">@Localizer["edited"]</button>
|
||||
}
|
||||
<i aria-hidden="true" class="@VisibilityIcon(status.Visibility) text-base" title="@VisibilityText(status.Visibility)"></i>
|
||||
</span>
|
||||
</header>
|
||||
@@ -369,6 +370,27 @@
|
||||
{
|
||||
<Composer Editing="status" OnPublished="Edited" />
|
||||
}
|
||||
@if (isHistoryOpen)
|
||||
{
|
||||
<DModal IsOpen="true" IsOpenChanged="HistoryClosed" CloseText="@Localizer["Close"]" data-history-list>
|
||||
<Heading>@Localizer["Edit history"]</Heading>
|
||||
<ChildContent>
|
||||
<ol class="flex flex-col gap-4 mt-3">
|
||||
@foreach (var version in Enumerable.Reverse(history))
|
||||
{
|
||||
<li class="flex flex-col gap-1" data-version>
|
||||
<time class="text-xs opacity-70" datetime="@NerdRow.Time(version.CreatedAt)">@version.CreatedAt.ToLocalTime().ToString(SUtility.dateTimeFormatExt)</time>
|
||||
@if (version.SpoilerText is { Length: > 0 } warning)
|
||||
{
|
||||
<p class="inline-flex gap-2 items-center text-sm"><i class="ion-md-warning text-warning"></i>@CustomEmojis.Text(warning, status.Emojis)</p>
|
||||
}
|
||||
<div class="post-content text-sm break-words">@((MarkupString)CustomEmojis.Html(version.Content, status.Emojis))</div>
|
||||
</li>
|
||||
}
|
||||
</ol>
|
||||
</ChildContent>
|
||||
</DModal>
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -429,6 +451,8 @@
|
||||
bool isArticleOpen;
|
||||
bool isReadingProvenance;
|
||||
bool isReadingServer;
|
||||
bool isHistoryOpen;
|
||||
List<StatusEdit> history = [];
|
||||
readonly HashSet<string> revealedMedia = [];
|
||||
|
||||
Status Status => Post.Status;
|
||||
@@ -895,6 +919,14 @@
|
||||
await OnReplied.InvokeAsync(quote);
|
||||
}
|
||||
|
||||
async Task OpenHistory(Status status)
|
||||
{
|
||||
isHistoryOpen = true;
|
||||
history = await StatusService.History(status.Id);
|
||||
}
|
||||
|
||||
void HistoryClosed(bool open) => isHistoryOpen = open;
|
||||
|
||||
void Edited(FeedPost edited)
|
||||
{
|
||||
isEditing = false;
|
||||
|
||||
Reference in new issue
Block a user