Skip to content

[WJ-1266][WJ-1267] Implement Page Lock UI#2935

Open
loop-index wants to merge 4 commits into
developfrom
page-locks
Open

[WJ-1266][WJ-1267] Implement Page Lock UI#2935
loop-index wants to merge 4 commits into
developfrom
page-locks

Conversation

@loop-index

Copy link
Copy Markdown
Contributor

Implemented a LockPane to manage page locks.

Wikidot Layout:
image
Wikijump Layout:
image

@loop-index loop-index changed the title Implement Page Lock UI [WJ-1266][WJ-1267] Implement Page Lock UI May 31, 2026

@emmiegit emmiegit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Comment thread framerail/src/lib/server/load/page.ts
const newerLock = lockHistory[index - 1]
const deletedAt = new Date(lock.deleted_at).getTime()
const newerCreatedAt = new Date(newerLock.created_at).getTime()
if (Math.abs(newerCreatedAt - deletedAt) < 5000) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
if (Math.abs(newerCreatedAt - deletedAt) < 5000) {
if (Math.abs(newerCreatedAt - deletedAt) < 5000) { // 5 seconds

export async function pageLockHistory(
reqContext: RequestContext
): Promise<PageLockModel[]> {
return client.request("page_lock_get_history", {}, reqContext)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Deepwell api functions should use explicit page reference instead of only inferring from context, since when accessing the site's default page, the params.slug will be null and the page reference cannot be inferred.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fair point for now, but ideally the request context should always be able to get the right "page" it's on unless absolutely not applicable (ie. forum pages, inter-site pages like user profile...) I'll think a bit more to make it work, will send in a commit to change.

@Zokhoi Zokhoi Jun 2, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should also consider that the context system with page slug would be more appropriate for a web client, and less so for an api client, so if we were to create a public api backed by deepwell in the future, it would still be better to use explicit page references.

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.

3 participants