Skip to content

Fix unlocking during encrypted previews#2

Merged
HKTITAN merged 2 commits intomainfrom
codex/fix-bugs-in-in-browser-editor-un93vs
Feb 3, 2026
Merged

Fix unlocking during encrypted previews#2
HKTITAN merged 2 commits intomainfrom
codex/fix-bugs-in-in-browser-editor-un93vs

Conversation

@HKTITAN
Copy link
Copy Markdown
Owner

@HKTITAN HKTITAN commented Feb 3, 2026

Motivation

  • Prevent unlocking an encrypted preview from overwriting the current head and ensure preview UI stays read-only and informative after a successful decrypt.

Description

  • Update index.html so unlocking an encrypted preview renders decrypted blocks in preview-mode (read-only), refreshes the preview banner/graph/QR/status, and returns without pushing a new head or changing the saved hash; regular unlocks still update head/version and sync URL metrics (contentVersion, syncUrlMetricsToLocation, pushLocalVersion).
  • Adjust the code structure map in docs/CODE_STRUCTURE.md to reflect the shifted line ranges and renamed functions/sections after the script edits.

Testing

  • No automated tests were executed for this change; manual verification is recommended to confirm preview unlock behavior, save/version flows, and UI updates (history graph, banner, QR, and status bar).

Codex Task

@vercel
Copy link
Copy Markdown

vercel bot commented Feb 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
khemessage Ready Ready Preview, Comment Feb 3, 2026 7:15am

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 21b707c97c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 3710 to +3714
function isAtInputLimit() {
return estimateUrlSizeFromBlocks(blocks) >= URL_THRESHOLDS.danger
const size = (urlMetrics.version === contentVersion)
? urlMetrics.size
: new Blob([location.href]).size
return size >= URL_THRESHOLDS.danger
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Enforce URL limit using current blocks, not stale URL

When contentVersion changes, isAtInputLimit() now falls back to location.href size instead of the current blocks. During typing, contentVersion increments and the URL hash remains the old (smaller) saved hash until the debounce completes, so the limit check can undercount and allow typing/paste to exceed the 8KB threshold before the metrics refresh finishes. This regresses the “block input at 8KB” behavior for fast edits or large pastes because the limit is checked against stale data.

Useful? React with 👍 / 👎.

@HKTITAN HKTITAN merged commit 41a8304 into main Feb 3, 2026
2 of 3 checks passed
@HKTITAN HKTITAN deleted the codex/fix-bugs-in-in-browser-editor-un93vs branch February 3, 2026 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant