Skip to content

feat(docs): style fenced markdown code blocks#724

Open
TurboTheTurtle wants to merge 1 commit into
openclaw:mainfrom
TurboTheTurtle:codex/gogcli-676-code-fence-style
Open

feat(docs): style fenced markdown code blocks#724
TurboTheTurtle wants to merge 1 commit into
openclaw:mainfrom
TurboTheTurtle:codex/gogcli-676-code-fence-style

Conversation

@TurboTheTurtle

@TurboTheTurtle TurboTheTurtle commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Render fenced Markdown code blocks with Roboto Mono and dark-green text in the local Docs writer.
  • Preserve existing paragraph shading and soft-line-break handling for fenced blocks.
  • Update formatter, write, and find-replace tests.

Fixes #676.

Scope note

This intentionally covers the local Docs API renderer used by append, tab-replace, range update, and markdown find-replace paths. Whole-document docs write --replace --markdown still uses Drive import, so maintainers should decide whether that remains separate issue scope.

Validation

  • make ci

Proof

Local tests verify the generated Docs API requests include weightedFontFamily=Roboto Mono and foregroundColor=#188038. I did not run live Google Docs rendering proof in this environment.

@clawsweeper

clawsweeper Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed June 10, 2026, 3:14 AM ET / 07:14 UTC.

Summary
This PR changes the local Google Docs Markdown renderer to style fenced code blocks with Roboto Mono and #188038 foreground color, plus request-generation tests for formatter, write, and find-replace paths.

Reproducibility: yes. from source inspection: current main's MarkdownToDocsRequests emits Courier New and only weightedFontFamily for fenced code blocks. I did not run a live Google Docs reproduction.

Review metrics: 2 noteworthy metrics.

  • Changed surface: 4 files affected: 1 implementation file, 3 test files. The behavioral change is narrow and concentrated in Docs Markdown request generation.
  • Style fields changed: 2 text-style fields changed for fenced code blocks. The PR changes both font family and foreground color, which is the visible compatibility surface before merge.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🐚 platinum hermit
Result: blocked until stronger real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Add redacted live Google Docs readback or terminal proof for a fenced block appended through the changed path.
  • Confirm maintainers accept the scoped local-renderer style change while whole-document replace remains Drive-imported.

Proof guidance:

  • [P1] Needs stronger real behavior proof before merge: The PR has tests and generated request JSON, but no live Google Docs rendering/readback proof; the contributor should add redacted terminal output, logs, screenshot/recording, or copied live output, then update the PR body for re-review or ask a maintainer to comment @clawsweeper re-review if it does not rerun.

Risk before merge

  • [P1] No after-fix live Google Docs rendering or raw readback proof is present; generated request JSON does not prove the service applies and returns the style as intended.
  • [P1] Merging changes existing local-rendered fenced-code output from Courier New/default foreground to Roboto Mono/#188038 for append and related local Markdown paths.
  • [P1] Whole-document docs write --replace --markdown remains on the Drive import path, so the PR does not fully unify every Markdown rendering path unless maintainers accept that scope.

Maintainer options:

  1. Require live Docs readback proof (recommended)
    Ask for redacted output from a disposable Google Doc showing an appended fenced block reads back with Roboto Mono and a non-default foreground color before merge.
  2. Accept scoped style parity
    Maintainers can intentionally merge the local-renderer default-style change while leaving whole-document Drive-import behavior as separate issue scope.
  3. Pause for style direction
    Pause or close this PR if hard-coding this code-block font and color is not the desired Docs Markdown style contract.

Next step before merge

  • [P1] Manual review should request live Docs proof and decide whether Roboto Mono/#188038 is the desired default local-renderer fenced-code style.

Security
Cleared: The diff only changes Go Docs request generation and related tests; it does not touch dependencies, scripts, CI, credentials, or supply-chain surfaces.

Review details

Best possible solution:

Land the scoped local-renderer style change only after redacted live Docs readback proves it and maintainers accept the hard-coded style while treating Drive-import whole-document replace as separate scope.

Do we have a high-confidence way to reproduce the issue?

Yes from source inspection: current main's MarkdownToDocsRequests emits Courier New and only weightedFontFamily for fenced code blocks. I did not run a live Google Docs reproduction.

Is this the best way to solve the issue?

Mostly yes: the implementation is the narrow local-renderer change for the requested style, but merge should wait for live Docs proof and maintainer acceptance of the hard-coded style scope.

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against b34e3033913a.

Label changes

Label justifications:

  • P3: This is a low-risk Docs Markdown rendering polish/feature PR with limited blast radius and no urgent runtime failure.
  • merge-risk: 🚨 compatibility: Merging changes the default visible styling of local-rendered fenced code blocks for existing Docs Markdown workflows.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The PR has tests and generated request JSON, but no live Google Docs rendering/readback proof; the contributor should add redacted terminal output, logs, screenshot/recording, or copied live output, then update the PR body for re-review or ask a maintainer to comment @clawsweeper re-review if it does not rerun.
Evidence reviewed

What I checked:

  • Repository policy read: AGENTS.md was read fully; its PR review-mode guidance applied, and I did not switch branches or edit files. (AGENTS.md:1, b34e3033913a)
  • Current main behavior: Current main's MDCodeBlock path applies only WeightedFontFamily Courier New and uses the field mask weightedFontFamily, so it does not implement the requested Roboto Mono/#188038 styling. (internal/cmd/docs_formatter.go:102, b34e3033913a)
  • PR implementation: The PR diff adds Roboto Mono/#188038 constants, sets ForegroundColor on fenced-code text style, and expands the field mask to weightedFontFamily,foregroundColor. (internal/cmd/docs_formatter.go:116, 00bab201d3a6)
  • PR test coverage: The PR updates formatter, write, and find-replace tests and adds a shared assertion for field mask, font family, weight, and foreground RGB. (internal/cmd/docs_formatter_test.go:373, 00bab201d3a6)
  • Proof remains local request proof: The PR body says live Google Docs rendering proof was not run, and the later contributor comment provides green checks, focused local tests, and generated request JSON rather than live Docs readback. (00bab201d3a6)
  • Linked issue was reframed: The linked issue discussion corrected the original append/replace divergence and reframed the remaining request as a style feature for fenced code blocks.

Likely related people:

  • steipete: Current line blame and recent GitHub history point to steipete for active Docs Markdown formatter and write-path maintenance. (role: recent area contributor; confidence: high; commits: 71a8504d0add, e51f6be9dc38, 3afae4f197cf; files: internal/cmd/docs_formatter.go, internal/cmd/docs_edit.go, internal/cmd/docs_mutation.go)
  • sebsnyk: The native markdown bullets/code-block work and the linked fenced-code style report are tied to this contributor path. (role: introduced adjacent behavior; confidence: medium; commits: b646e886f6dd, f0dbde21f892; files: internal/cmd/docs_formatter.go, internal/cmd/docs_formatter_test.go, internal/cmd/docs_write_markdown_test.go)
  • TurboTheTurtle: Beyond this PR, TurboTheTurtle has recent merged history in the same Docs Markdown formatter/test area. (role: recent adjacent contributor; confidence: medium; commits: fba331c9aa31; files: internal/cmd/docs_formatter.go, internal/cmd/docs_formatter_test.go, internal/cmd/docs_write_markdown_test.go)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. labels Jun 10, 2026
@TurboTheTurtle TurboTheTurtle force-pushed the codex/gogcli-676-code-fence-style branch from 615fe44 to fd89f24 Compare June 10, 2026 05:11
@TurboTheTurtle TurboTheTurtle force-pushed the codex/gogcli-676-code-fence-style branch from fd89f24 to 00bab20 Compare June 10, 2026 05:12
@TurboTheTurtle

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 10, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 10, 2026
@TurboTheTurtle

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 10, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. labels Jun 10, 2026
@TurboTheTurtle

TurboTheTurtle commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

Sanitized proof for this PR:

  • PR head tested: 00bab20
  • GitHub checks are green: test, image, worker, windows, and darwin-cgo-build
  • Focused local tests passed:
go test -v ./internal/cmd -run 'TestMarkdownToDocsRequests_AppendBulletsAndCode|TestDocsWrite_MarkdownAppendUsesDocsFormatting|TestDocsWrite_MarkdownAppendStartsStyledBlocksOnFreshParagraph' -count=1
  • Additional local raw request proof for a fenced Markdown code block:
{"fields":"weightedFontFamily,foregroundColor","fontFamily":"Roboto Mono","fontWeight":400,"range":{"startIndex":1,"endIndex":19},"rgbHex":"#188038"}

This verifies the generated Docs API text-style request for fenced Markdown code blocks includes Roboto Mono and #188038.

@TurboTheTurtle

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 10, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

Re-review progress:

@TurboTheTurtle TurboTheTurtle marked this pull request as ready for review June 10, 2026 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs write --append --markdown: code-fence styling diverges from --replace --markdown (Courier New + black vs Roboto Mono + colored)

1 participant