Commit graph

280 commits

Author SHA1 Message Date
chethanuk
c973e581ec
fix(tool): resolve file_read paths against git top-level in monorepos (#309)
Some checks are pending
CI / test (push) Waiting to run
* fix(tool): resolve file_read paths against git top-level in monorepos

ocr review from a monorepo subdirectory failed with "file not found" (#287):
git reports diff and `git show HEAD:<path>` paths relative to the repo root,
but RepoDir was scoped to the invocation subdirectory, producing a double
prefix. resolveWorkingDir now anchors RepoDir at `git rev-parse
--show-toplevel` on the review path (requireGit=true); scan keeps the CWD so
its `git ls-files` walk stays scoped.

The top-level lookup uses a stdout-only git helper so stderr notices can't
pollute the path, and fails loudly if --show-toplevel errors or is empty
(e.g. a bare repo) instead of silently reusing the subdirectory. Adds
regression tests for the subdir hoist, the scan-path scoping, git-show
resolution of root-relative paths, and the bare-repo failure.

* docs(rules): document repo-root rule.json resolution in monorepos

Since #287 anchored RepoDir at the git top-level, ocr review from a
monorepo subdirectory loads the repo-root .opencodereview/rule.json
rather than a subdir-local one. Call out this user-visible behavior at
loadProjectRule so the scope change isn't a surprise (review feedback).
2026-07-07 20:06:28 +08:00
kite
a2e08b77a1
feat(review): add structured category and severity to findings (#311)
Some checks are pending
CI / test (push) Waiting to run
Add two structured fields, category and severity, to every review finding
so CI integrations can sort, group, filter, or gate builds without
re-parsing natural-language comment text.

- Tool schema (tools.json): add category/severity as enum-constrained,
  required properties of code_comment. severity is limited to
  critical/high/medium/low (info dropped, since LLMs struggle to
  distinguish low from info).
- System prompt (task_template.json) is intentionally left untouched to
  avoid the review-quality regression observed on the benchmark suite;
  the tool schema alone drives field population.
- JSON output: category/severity are flat siblings of content/start_line,
  omitted entirely when empty (backward compatible).
- CLI output: render an inline [category - severity] badge before the
  comment, colored by severity.
- Sync docs across all five README locales.
2026-07-07 13:08:41 +08:00
wxwxwxw_orange
39eb0f3984
fix(tui): persist official-tab models and refine saved secret hint (#260)
Some checks are pending
CI / test (push) Waiting to run
* fix(tui): persist official-tab models and refine saved secret hint

Persist user-added models to providers.<name>.models on the official tab.
When an API key or auth token is already saved, show a replace hint with a
prefix/suffix fingerprint (skipped for short keys), use a fixed mask placeholder,
and ensure typing or paste replaces the saved value instead of re-saving it.

* fix(tui): model add/delete UX and config wizard hardening
- Add model add/delete in config provider and config model (official + custom)
- Show d Delete only on model rows; green highlight when selected
- Improve Esc cancel text; track savedInSession to avoid misleading messages
- Reload config on save failure; read registry models fresh after reload
- Export llm.ModelListContains; fix config model persist using registry-only check

* fix(tui): defer provider config until confirm and harden API key UX
Only persist provider/model on wizard confirm; keep in-session picks via
sessionModelPick. Validate API key before quit, clear saved keys when emptied,
and improve official env-var hints and custom edit clear behavior.

* feat(tui): show active model suffix on official provider list
Align Official tab with Custom: display (model) next to the active preset
when cfg.Provider matches and a global model is configured.
2026-07-06 20:38:39 +08:00
hezheng.lsw
964f2166d0
fix(pages): adjust HeroSection terminal section height and bottom padding (#296)
Some checks failed
CI / test (push) Waiting to run
Deploy Pages / build (push) Has been cancelled
Deploy Pages / deploy (push) Has been cancelled
- Increase section height to prevent terminal bottom from being clipped by overflow:hidden
- Adjust terminal body bottom padding to 8px for better spacing
2026-07-06 10:44:44 +08:00
kite
9dfcffda07
fix(pages): address CodeQL XSS alerts in markdown rendering (#300)
* fix(pages): address CodeQL XSS alerts in markdown rendering

Alert #4 (headingId.ts): replace the unreliable single-pass regex used to
strip HTML tags (incomplete multi-character sanitization) with DOMPurify.
This also fixes a pre-existing mismatch where headings containing HTML
entities produced different anchor ids on the TOC vs renderer sides.

Alert #5 (MarkdownRenderer.tsx): mermaid runs with securityLevel:'strict'
and already sanitizes its own SVG output, so re-running DOMPurify over the
whole SVG broke rendering (namespaces, inline <style>, foreignObject
labels). Make securityLevel explicit and inject mermaid's trusted output
directly, annotated with a codeql suppression comment.

* docs(pages): clarify CodeQL XSS suppression justification in MarkdownRenderer

The suppression comment claimed the mermaid SVG is 'not raw user input',
which understates the trust boundary. The SVG is in fact derived from
user-controlled mermaid code; safety relies on mermaid's securityLevel:
'strict' sanitizing the output via DOMPurify. Update the comment to state
this accurately and flag that the boundary depends on that setting.
2026-07-06 10:31:37 +08:00
dependabot[bot]
10f587594b
chore(deps): bump github.com/anthropics/anthropic-sdk-go (#272)
Some checks failed
CI / test (push) Has been cancelled
Deploy Pages / build (push) Has been cancelled
Deploy Pages / deploy (push) Has been cancelled
Bumps the go-dependencies group with 1 update: [github.com/anthropics/anthropic-sdk-go](https://github.com/anthropics/anthropic-sdk-go).


Updates `github.com/anthropics/anthropic-sdk-go` from 1.52.0 to 1.55.1
- [Release notes](https://github.com/anthropics/anthropic-sdk-go/releases)
- [Changelog](https://github.com/anthropics/anthropic-sdk-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/anthropics/anthropic-sdk-go/compare/v1.52.0...v1.55.1)

---
updated-dependencies:
- dependency-name: github.com/anthropics/anthropic-sdk-go
  dependency-version: 1.55.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-03 20:32:24 +08:00
kite
1587630604
feat(pages): add per-chapter routes for docs (#294)
Each docs chapter previously lived at the single /docs route driven by
component state, so chapters had no shareable URL and browser back/forward
did not work. Add a /docs/:slug route and derive activeSlug from the URL
param (falling back to quickstart), navigating via the router on switch.

Also add a dev-time invariant that throws when two sidebar entries share a
slug, since each slug now maps to exactly one URL.
2026-07-03 20:29:29 +08:00
munsunouk
b82fcc31f2
feat: add Astro-specific review rules (#289) 2026-07-03 20:05:34 +08:00
kite
44e4867637
docs(pages): sync restructured MCP guide to en and ja (#293)
Sync the reorganized zh/mcp.md into the English and Japanese versions:
remove the MCP client-side paragraph and the How it works section,
split Configuration into Adding/Removing subsections, drop the manual
JSON edit example, move env to the end of the code block and table, and
align dash spacing. Also fix a double-space typo in the zh version.
2026-07-03 20:04:35 +08:00
kite
4596e2ce2e
docs(pages): add MCP servers guide to the user guide (#292)
Add an MCP tutorial page (en/zh/ja) covering how OCR acts as an MCP
client that pulls tools from external MCP servers into a review:
configuration via mcp_servers, the config fields, CLI usage, tool
filtering, name conflicts, the setup command, and troubleshooting.

Wire the new page into the docs system (index.ts, DocsPage sidebar,
i18n en/zh/ja) and cross-link from the integrations page to clarify the
client vs server distinction.
2026-07-03 19:03:27 +08:00
kite
5e8099f9e3 docs(pages): remove overview page across all languages and clean up references
- Delete en/zh/ja overview.md
- Remove overview imports, DocSlug entry and doc maps in index.ts
- Drop overview sidebar item and switch default slug to quickstart in DocsPage
- Remove overview-related i18n keys from en/zh/ja
- Sync viewer.md heading emphasis removal to en/ja
2026-07-03 18:00:00 +08:00
kite
c9acbcf91b
docs(pages): update CLI docs for install, auto-update, config and quickstart (#290)
Refactor installation instructions, update auto-update mechanism
description, streamline configuration and quickstart docs, and adjust
FAQ across en/ja/zh translations.
2026-07-03 17:37:31 +08:00
kite
d1ef549e93 docs(README): bump Git prerequisite to >= 2.41 and sync localized READMEs
Bump the Git prerequisite version hint from >= 2.38 to >= 2.41, and add
the Prerequisites section to the ja/ko/ru localized READMEs which were
missing it.
2026-07-03 17:37:00 +08:00
skate29
0aa6ac2cbf
docs(README): add new “Prerequisites” section under the existing “How to Use” heading and before the CLI subsection. (#261) 2026-07-03 17:32:47 +08:00
munsunouk
8c9778860d
fix: support Astro files in review filters (#286) 2026-07-03 15:47:14 +08:00
kite
6ded4f3624
docs(pages): remove pipeline and project layout sections from overview (#284) 2026-07-03 14:37:33 +08:00
kite
db254dd9c8
docs(pages): add Japanese (ja) translation for docs content (#282)
Some checks are pending
CI / test (push) Waiting to run
Deploy Pages / build (push) Waiting to run
Deploy Pages / deploy (push) Blocked by required conditions
Translate all 17 docs pages from zh to ja under content/docs/ja/,
translate frontmatter titles, and wire ja into content/docs/index.ts
(replacing the previous English fallback). Sidebar i18n keys already
existed in i18n/ja.ts, so navigation renders Japanese automatically.
2026-07-03 14:23:35 +08:00
ScarletCarpet
64398465d4
feat(viewer): make human readable token usage for session (#278)
* < 1,000: show the raw number (e.g. 842)
* >= 1,000: show as K (e.g. 1.22K)
* >= 1,000,000: show as M (e.g. 1.21M)

hover shows exact number.
2026-07-03 12:01:46 +08:00
hezheng.lsw
022ed75682
feat(pages): add Docs page with search, markdown rendering, and i18n support (#273)
* feat(pages): add Docs page with search, markdown rendering, and i18n support

- Add DocsPage with full-text search modal (⌘K trigger)
- Add MarkdownRenderer with DOMPurify sanitization
- Add bilingual docs content (en/zh) for all sections
- Add shared headingId utility for consistent TOC anchors
- Add search keyboard hints with i18n support
- Update Navbar with Docs navigation link
- Add icon-search.svg asset
- Configure webpack for markdown imports

* fix(pages): address PR #273 code review feedback

- Replace marked.setOptions() with new Marked instance (no global mutation)
- Escape heading ID attribute value to prevent XSS
- Use crypto.randomUUID() for mermaid diagram IDs (no collisions)
- Add cancellation flag for async mermaid renders on unmount
- Move inline <pre> styles to CSS class (only dynamic align-items inline)
- Move @types/dompurify to devDependencies
- Remove @ts-nocheck from docs/index.ts
- Extract getRawContent helper to reduce duplication
- Fix searchDocs fallback consistency (add enDocs fallback)
- Fix heading ID mismatch by stripping markdown links before ID generation
- Separate sidebar chevron (expand) from label (navigate)
- Guard ⌘K shortcut against input/textarea focus interception
2026-07-03 11:45:33 +08:00
paker
589a7249f5
fix(telemetry): support http:// scheme in otlp_endpoint for insecure gRPC (#280)
* fix(telemetry): support http:// scheme in otlp_endpoint for insecure gRPC

Parse the otlp_endpoint scheme before creating the OTLP gRPC exporters:
- http://host:port  -> strip scheme, call WithInsecure() (plaintext gRPC)
- https://host:port -> strip scheme, keep default TLS
- host:port          -> unchanged, keep default TLS (backward compatible)

Scheme matching is case-insensitive. Applies to both the trace and
metric exporters in initOTLPProviders.

Fixes #268

* fix(telemetry): trim trailing slash from otlp_endpoint after scheme strip

Addresses review feedback: a URL-style endpoint with a trailing slash
(e.g. "http://localhost:4317/") left the trailing "/" in the address
passed to WithEndpoint(), which expects a bare host:port with no path
and could cause connection failures.
2026-07-03 11:26:03 +08:00
Mountain Ghost. W
74a2ac1c1c
feat(llm): add z-ai-coding provider for GLM Coding Plan endpoint (#258)
Some checks are pending
CI / test (push) Waiting to run
Deploy Pages / build (push) Waiting to run
Deploy Pages / deploy (push) Blocked by required conditions
* feat(llm): add z-ai-coding provider for GLM Coding Plan endpoint

Z.AI (智谱) subscribers to the GLM Coding Plan must route requests through
the dedicated coding endpoint (https://open.bigmodel.cn/api/coding/paas/v4)
for them to be billed against the subscription quota. The existing z-ai
provider points at the generic pay-as-you-go endpoint
(https://open.bigmodel.cn/api/paas/v4), so Coding Plan keys silently drain
the wallet balance instead of consuming the plan quota, surfacing as a
spurious "1113 余额不足" error even when the plan is barely used.

Add a dedicated z-ai-coding provider following the existing *-tokenplan
pattern (dashscope/dashscope-tokenplan, tencent-tokenhub/hy-tokenplan).
It reuses Z_AI_API_KEY — the same key authenticates against both endpoints,
so selecting this provider is all that's needed to activate the plan. The
model list is restricted to the models officially supported by the Coding
Plan to avoid selecting a non-plan model that falls back to wallet billing.

- internal/llm/providers.go: register z-ai-coding preset
- extensions/vscode/src/shared/providers.ts: mirror the preset (kept in
  sync with the Go registry per the file header)
- internal/llm/providers_test.go: update the sorted provider list assertion

Co-Authored-By: Oz <oz-agent@warp.dev>

* docs(pages): add Z.AI GLM Coding Plan config tip to docs page

Subscribers to the Z.AI (Zhipu) GLM Coding Plan must route requests through
the dedicated coding endpoint (https://open.bigmodel.cn/api/coding/paas/v4)
to bill against the plan quota. The default z-ai preset points at the generic
pay-as-you-go endpoint, so coding-plan keys silently drain the wallet and
surface a spurious "1113 余额不足" error — a recurring trap for new users.

Add a provider-specific callout at the end of the Docs config section showing
the one-line fix that works today on any released version:

  ocr config set providers.z-ai.url https://open.bigmodel.cn/api/coding/paas/v4

This complements the z-ai-coding provider added in the previous commit: the
provider gives a native first-class option going forward, while this doc tip
rescues users already running released builds. Copy/localized for zh/en/ja.

Co-Authored-By: Oz <oz-agent@warp.dev>

* fix(llm): address review feedback for z-ai-coding provider

- Switch z-ai-coding to a dedicated Z_AI_CODING_API_KEY env var instead
  of reusing Z_AI_API_KEY, matching the tokenplan-provider convention so
  pay-as-you-go and Coding Plan keys can be configured independently
- Remove comment blocks from the z-ai-coding presets (Go and TS) to keep
  the registry as plain data consistent with the other entries
- Revert pages/ changes (i18n + DocsPage.tsx); provider docs are out of
  scope for a provider-registration PR

Co-Authored-By: Oz <oz-agent@warp.dev>

---------

Co-authored-by: mountainwu <mountainwu@kuainiugroup.com>
Co-authored-by: Oz <oz-agent@warp.dev>
2026-07-02 19:23:17 +08:00
Gongyl01
0d635537e3
docs(pages): add landing page development guide (#270) 2026-07-02 16:36:54 +08:00
kite
d83a758a6d docs(pages): update page title to "AI Code Review" 2026-07-02 13:27:50 +08:00
kite
90a926e964 docs(pages): move MCP setup timeout info into field table
Move the 5-minute timeout note from the standalone mcpNote paragraph
into the setup field description in the MCP Server table, so users
see the timeout constraint directly alongside the field definition.
2026-07-02 13:23:17 +08:00
Yinka Metrics
d70dbfa02b
docs(pages): add MCP Server docs section (#262)
Some checks are pending
CI / test (push) Waiting to run
Deploy Pages / build (push) Waiting to run
Deploy Pages / deploy (push) Blocked by required conditions
* docs: add MCP server docs section

* docs: address mcp review feedback
2026-07-02 13:17:42 +08:00
Fedor
7497d5ac6e
docs(examples): add GitFlic CI auto-review example (#201)
* docs(examples): add GitFlic CI auto-review example

Add examples/gitflic_ci/, a CI-layer integration that reviews GitFlic
merge requests with OpenCodeReview and posts the findings as MR
discussions. Like the GitHub and GitLab examples, the posting glue lives
outside the core binary.

post_review.py (standard library only) reads `ocr review --format json`
and posts inline discussions plus a fallback note and a summary. GitFlic's
Discussions API requires an old-side line for inline comments, which the
new-side-only review output lacks, so the script recomputes it from the
same merge-base diff the review ran on. Ships with a stdlib unittest suite
whose line-mapping cases are ported from the review's diff logic.

* docs(readme): list the GitFlic CI example in the localized READMEs

* fix(examples): address GitFlic CI review feedback from PR #201

Apply the five review comments left on the PR:
- gitflic-ci.yaml: guard `ocr config set llm.model` behind a non-empty
  check so the documented-optional OCR_LLM_MODEL no longer breaks the
  config step when it is unset
- gitflic-ci.yaml: skip posting when `ocr review` produced no output
  (the step ends with `|| true`) instead of feeding empty/partial JSON
  to post_review.py
- post_review.py: redact the token from HTTP error snippets so it cannot
  leak into CI logs if GitFlic echoes the request back in an error body
- post_review.py: read the review-result file via a `with` block so the
  handle is closed explicitly
- examples/README.md: add the missing trailing newline
2026-07-02 10:41:39 +08:00
Lei Zhang
64e008fcb4
ci: upgrade node version to 24 (#240) 2026-07-02 10:33:37 +08:00
Eldar Shlomi
fef4314d46
fix(agent): recover from panics in per-file review and comment-pool goroutines (#171) (#182)
Some checks are pending
CI / test (push) Waiting to run
A panic in a single file's review goroutine (dispatchSubtasks) or in a CommentWorkerPool task previously crashed the whole ocr process. Recover in both: the per-file panic is isolated like an error return (counted in subtaskFailed + recorded as a subtask_error warning with stack trace + telemetry, using the parent ctx since fileCtx is already cancelled on unwind), and a panicking comment-pool task is contained so healthy tasks still complete.

Rebased onto current main: the pool moved to internal/llmloop, so the pool-side recover + the panic-isolation test now live in internal/llmloop/pool.go and pool_test.go; the per-file recover stays in internal/agent/agent.go. Also documents CommentWorkerPool.Await's concurrency contract (Submit must not race Await).
2026-07-01 23:23:12 +08:00
kite
44fabbaa68 docs(pages): update i18n docs for unified Provider system
Some checks are pending
CI / test (push) Waiting to run
Deploy Pages / build (push) Waiting to run
Deploy Pages / deploy (push) Blocked by required conditions
Update documentation strings across en/ja/zh to reflect the new
provider-based configuration: add full scan review mode, list built-in
providers (Anthropic, OpenAI, DashScope, DeepSeek, Z.AI), and replace
legacy config keys with provider-scoped keys including extraHeaders.
2026-07-01 19:57:03 +08:00
Lei Zhang
0dac8ac376
fix(ci): prevent duplicate review posts on retry in ocr-review workflow (#250)
* fix(ci): add idempotency check to prevent duplicate review posts on retry

When the batch createReview fails with a 5xx/408/network error, the
request may still have landed on the server. Before retrying per-comment,
the workflow now:

- Tags each review/comment/summary with a per-run HTML comment ID derived
  from runId + runAttempt + content hash.
- Queries existing reviews and review comments to detect whether the batch
  actually landed, and only retries the comments that are missing.
- Before retrying an individual comment whose request may have reached
  GitHub, cools down (honoring rate-limit headers) then checks whether the
  comment already exists, treating it as success instead of posting a
  duplicate.
- Skips posting the summary comment when one with the same run tag already
  exists.
- Adds read-API retry/pacing helpers (withRetry/readWithPacing/readAllPages)
  with shorter spacing than writes (OCR_READ_SUCCESS_DELAY /
  OCR_READ_LOW_REMAINING_SPACING) since reads are cheaper but still consume
  the primary rate limit.

Degrades gracefully to the original fallback (accepting duplicate risk)
when the idempotency read calls themselves fail.

* fix(ci): harden idempotency checks in ocr-review workflow

Address code review findings on the GitHub Actions PR auto-review
workflow (applied to both .github/workflows and examples copies):

- readAllPages: cap pagination at maxPages=50 (default) to prevent
  unbounded loops, and validate the argument is a positive integer.
- getPostedCommentIds: anchor the ID regex to the HTML comment wrapper
  (<!-- ocr-... -->) with a capture group to avoid false positives from
  user-generated content.
- isCommentAlreadyPosted: return null (unknown) instead of false when
  the read API fails, so callers do not silently risk duplicates; accept
  a postedIdsCache to reuse a single paginated walk across retries.
- hasIssueCommentWithId: return null (unknown) on read API failure, and
  match the summary tag with an anchored regex for consistency.
- Call sites: handle null by skipping retry/posting to avoid duplicates
  while surfacing the failure in the summary.

* fix(ci): validate env config and document intentional behaviors

Address code review findings on the ocr-review workflow (applied to
both .github/workflows and examples copies):

- parseNonNegInt: add a validation helper for env-var parsing so
  negative or non-numeric values (e.g. OCR_MAX_RETRIES=-5) fall back to
  defaults instead of bypassing the `|| default` guard (a negative
  parseInt result is truthy). All seven retry/pacing config values now
  use it.
- readAllPages: document that the 50-page cap is an intentional safety
  valve against unbounded loops, not a normal mode; callers that depend
  on completeness already degrade safely to null (unknown), so a
  truncated walk does not silently produce duplicates.
- commentId: document that the 12-hex-char (48-bit) hash collision
  scope is a single PR (listReviewComments is PR-scoped) and a single
  run produces only tens to hundreds of comments, making the
  birthday-bound collision probability negligible (~1e-7 at 10k).

* docs(github_actions): sync README with retry/idempotency features in ocr-review.yml

- Add OCR_READ_SUCCESS_DELAY and OCR_READ_LOW_REMAINING_SPACING variables
  for read API pacing used by the idempotency check
- Document the three GitHub rate-limit retry strategies (primary reset,
  retry-after header, secondary no-header backoff)
- Add 'Idempotency: avoiding duplicate review comments' section describing
  how the workflow detects already-landed comments via per-run HTML tags
  and skips retrying when the read API is unavailable

* fix(ci): use full sha256 hash for review comment idempotency IDs

Drop the .slice(0, 12) truncation in commentId() and use the full 64-char
(256-bit) sha256 hex digest. The truncated 12-char hash carried a tiny but
nonzero collision risk whose failure mode was a silently dropped inline
comment (the idempotency check would mistake two distinct comments for
duplicates). The full hash makes the collision probability effectively
zero with no meaningful downside; the ID regex already used [a-f0-9]+ so
it accepts the longer IDs unchanged.

* fix(ci): use random per-comment IDs and defer body assembly in review workflow

Replace the content-derived commentId() (sha256 of path/line/content) with
a random per-comment ID (crypto.randomBytes) and restructure the inline-
comment flow around an item struct that carries { comment, id, lines }.

This fixes two issues in the idempotency check:

1. ID was recomputed on every failure check. Each inline comment is now
   assigned one random ID up front and carried on the item struct, so the
   retry/idempotency logic reads item.id directly. The comment body (which
   embeds the ID) is assembled only at API-call time in toReviewPayload(),
   eliminating repeated hash computation.

2. Content-derived IDs collided for distinct comments sharing the same
   path/line/content. A random ID guarantees two such comments get
   different IDs, so the idempotency check no longer mistakes the second
   for a duplicate of the first and silently drops it on retry.

formatComment/commentId are removed (no callers remain) and replaced with
newCommentId/resolveLines/toReviewPayload/buildBody. The matching regex
already used [a-f0-9]+ so it accepts the new random tokens unchanged.
README ID-format placeholder updated from <hash> to <token>.

* docs(ci): correct misleading readAllPages truncation comment

The comment claimed 'a truncated walk does not silently produce
duplicates' because callers 'degrade safely by returning null on read
failures.' That reasoning only holds when the read API THROWS (rate
limit, 5xx): isCommentAlreadyPosted/hasIssueCommentWithId then return
null (unknown) and the caller skips retrying. A truncated walk does not
throw — it returns a partial set silently, so isCommentAlreadyPosted
returns false (definitively 'not posted') for comments beyond the cap,
and the retry loop reposts them, producing duplicates.

Rewrite the comment to state the cap is an intentional safety valve and
to explicitly distinguish truncation (partial data, can duplicate) from
thrown read failures (null/unknown, safe). No behavior change.

* fix(ci): drop stale postedIdsCache to prevent duplicate inline comments

isCommentAlreadyPosted reused a single listReviewComments snapshot
(postedIdsCache) across all per-comment retries. As comments landed
during the loop, the snapshot went stale; a 5xx-landed comment checked
against the stale snapshot would be reported as 'not posted' and
retried, posting a duplicate.

Remove the cache and walk fresh on every check. The extra reads are
paced via readAllPages/readWithPacing (with retry honoring retry-after
and x-ratelimit-reset) and degrade to null — skip retry — if the read
API ultimately fails, so they cannot produce duplicates. The cache
provided no real benefit in this path: checked comments are either
genuine misses (correctly false) or just-landed (a fresh walk catches
them), so hits essentially never occurred.
2026-07-01 19:38:10 +08:00
kite
6adcb1ecd4
feat: add standard MCP tool support (#212)
* feat(mcp): add Model Context Protocol server support

Add MCP client and provider packages that allow integrating external
MCP tool servers into the review loop. Includes config commands for
managing MCP servers, stdio subprocess integration tests, and
comprehensive test coverage.

* refactor(mcp): rename loop variable in contentToText to avoid shadowing Client receiver

* fix(mcp): use platform-specific shell for setup command

The MCP server setup command was hardcoded to use `sh -c`, which
fails on Windows. Extract a `shellCommand` helper behind build tags
to use `cmd /c` on Windows and `sh -c` elsewhere.

* docs(mcp): add MCP server documentation to all README locales
2026-07-01 19:10:16 +08:00
hezheng.lsw
8e049189f7
feat: update brand assets (#257)
* feat(pages): redesign landing page UI with i18n support

- Redesign all sections based on design file: Navbar, Hero, Highlights, UseCases, Features, Benchmark, QuickStart, Footer
- Add scroll fade-in animation with IntersectionObserver
- Implement full i18n (English/Chinese) with language toggle button
- Add SVG icons and image assets
- Style refinements: table borders, step containers, button styles, spacing

* feat(pages): redesign Docs page with i18n, responsive sidebar, and aligned copy interaction

- Redesign DocsPage UI based on reference HTML design
- Add i18n support for all Docs content (en/zh/ja)
- Fix right sidebar CONTENTS nav with fixed positioning
- Add container backgrounds (4% opacity, 16% border)
- Hide CONTENTS sidebar on mobile instead of alternative UI
- Align copy icon and toast interaction with QuickStart section
- Add new SVG icon assets for docs page
- Add Japanese language support
- Add ColorBends animated background component
- Add responsive hooks and FadeInSection animation
- Add Benchmark, Features, QuickStart standalone pages
- Update Navbar, Footer, and LandingPage components

* refactor: cleanup design drafts, rename Chinese assets, UI improvements

- Remove unused design draft folders (html-files, html-files (1), inpt, doc)
- Rename Chinese-named image files (容器-4_*.svg → provider-*.svg)
- Add language switcher icon to Navbar with dynamic character display
- Align Footer padding with Navbar (32px desktop, 16px mobile)
- Fix CONTENTS sidebar position on wide screens
- Add i18n support for Docs CONTENTS title
- Fix clipboard copy fallback for HTTP/LAN environments
- Adjust Toast padding, benchmark medal sizes
- Swap highlight stats positions (Adoption Rate ↔ Active Users)
- Update stat4 value to 25.10% and stat5 caption to Battle-tested
- Unify Hero buttons size with Navbar Get Started button

* refactor: rename icon assets with semantic English names and cleanup unused files

- Rename all svg_*.svg icons to semantic names based on usage context:
  - icon-feature-*.svg for feature section icons
  - icon-usecase-*.svg for use case section icons
  - icon-chevron-*.svg, icon-copy.svg, icon-play.svg for UI controls
  - icon-github.svg, icon-language.svg, icon-sort.svg, icon-terminal-prompt.svg
- Remove unused assets: 5 unreferenced svg icons, image_9e7821.png, provider-8.svg
- Remove debug screenshots: debug-screenshot.png, debug-wide.png
- Remove .vsix build artifact and add *.vsix to .gitignore
- Update all import paths in components accordingly

* fix: address PR review feedback - bugs and improvements

- Fix copy-paste bug: step3Label1 had wrong text in all 3 languages
  - en: 'Interactive Setup (Recommended)' → 'Review Commands'
  - zh: '交互式设置(推荐)' → '运行审查命令'
  - ja: '対話式セットアップ(推奨)' → 'レビュー実行'
- Fix inconsistent indentation (4 spaces → 2 spaces) in i18n files
- Add .catch() handler for navigator.clipboard.writeText() in QuickStartSection
- Check document.execCommand('copy') return value before showing toast
- Extract fallbackCopy helper to deduplicate clipboard logic
- Remove unused useCallback import from HighlightsSection
- Move @types/three from dependencies to devDependencies
- Add i18n key 'hero.terminal' for hardcoded Terminal label

* fix: revert vscode .gitignore change and remove duplicate root SVGs

- Revert extensions/vscode/.gitignore to upstream state (remove *.vsix rule)
- Remove root-level brandicon.svg, claude code icon.svg, codex icon.svg
  (identical copies already exist in pages/src/assets/images/ with proper names)

* fix: reorder highlights stats to match design reference

- Reorder stats: 20K+ Active Users → > 30% Adoption Rate → 1M+ Tasks → 1/9 Token Cost → 25.10% AACR-BENCH
- Update stat1 value from 30K+ to 20K+
- Sync all three languages (en/zh/ja)

* chore: remove unused debug screenshots

* chore: remove unused image_9e7821.png

* feat(pages): consolidate icons, add scroll-to-top, responsive titles

- Merge provider-1~7.svg into single icon-ocr-source.svg
- Add ScrollToTop component for tab navigation reset
- Add tablet breakpoint (36px) to section titles for responsive scaling

* refactor(pages): extract shared responsive title hook, fix indentation

- Create useSectionTitleStyle hook to eliminate nested ternaries
- Replace duplicated responsive logic in 4 section components
- Fix fragment children indentation in App.tsx

Addresses code review feedback from PR #241

* feat(pages): add install badge with shimmer effect and copy functionality

- Add install badge above hero title with download/copy icons
- Implement text shimmer animation (left-to-right, 5s cycle)
- Add clipboard copy with secure context check and fallback
- Set download icon color to #2bde5e
- Set badge background to rgba(0,0,0,0.8)
- Fix mobile responsive width for badge

* fix(pages): address PR #254 code review feedback

- Add prefers-reduced-motion media query for shimmer animation
- Extract install command to INSTALL_CMD constant (DRY)
- Use t() i18n function for toast messages (hero.copied/hero.copyFailed)
- Show error feedback when copy operation fails
- Refactor handleCopy to use async/await instead of .then/.catch

* fix(pages): align hero install badge toast style with QuickStart section

- Use consistent toast visual: rgba(255,255,255,0.1) bg, 0.2 border, 0.85 text
- Match padding (5px 14px), borderRadius (6px), fontSize (12px)
- Position at top: 88px (below navbar)

* fix(pages): separate green download icon for hero badge, restore docs icon

- Restore doc-download.svg to original white (#FFFFFF, opacity 0.8) for Docs page
- Create doc-download-green.svg (#2bde5e) for Hero install badge
- Update HeroSection import to use green variant

* fix(pages): restore doc-download.svg to white for Docs page

- Restore doc-download.svg fill to #FFFFFF with opacity 0.8
- Hero badge uses separate doc-download-green.svg (#2bde5e)

* feat: update brand assets - replace navbar logo, favicon and logo-core.svg

* feat(docs): replace icons with semantic @agentscope-ai/icons components

- Branch Diff → SparkContrastView2Line (comparison)
- Single Commit → SparkHistoryLine (history)
- Requirement Context → SparkDocumentLine (document)
- JSON Output → SparkCode02Line (code format)
- Agent Mode → SparkAgentLine (agent)
- Preview → SparkVisibleLine (visibility)
- Scan → SparkScanLine (scan)
- Scan Path → SparkTargetLine (target)
- Scan File → SparkFileCodeLine (code file)

* refactor: replace logo.svg content directly instead of adding favicon.svg

Remove redundant favicon.svg, update logo.svg with new brand icon content.
No reference changes needed in index.html.

* fix: simplify logo-core.svg for GitHub README rendering

Remove mask, clipPath and mix-blend-mode that are not supported
by GitHub's SVG sanitizer, causing the icon to be invisible.
2026-07-01 19:09:42 +08:00
hezheng.lsw
b2a6f9bf2b
fix(pages): restore doc-download icon color for Docs page (#256)
* feat(pages): redesign landing page UI with i18n support

- Redesign all sections based on design file: Navbar, Hero, Highlights, UseCases, Features, Benchmark, QuickStart, Footer
- Add scroll fade-in animation with IntersectionObserver
- Implement full i18n (English/Chinese) with language toggle button
- Add SVG icons and image assets
- Style refinements: table borders, step containers, button styles, spacing

* feat(pages): redesign Docs page with i18n, responsive sidebar, and aligned copy interaction

- Redesign DocsPage UI based on reference HTML design
- Add i18n support for all Docs content (en/zh/ja)
- Fix right sidebar CONTENTS nav with fixed positioning
- Add container backgrounds (4% opacity, 16% border)
- Hide CONTENTS sidebar on mobile instead of alternative UI
- Align copy icon and toast interaction with QuickStart section
- Add new SVG icon assets for docs page
- Add Japanese language support
- Add ColorBends animated background component
- Add responsive hooks and FadeInSection animation
- Add Benchmark, Features, QuickStart standalone pages
- Update Navbar, Footer, and LandingPage components

* refactor: cleanup design drafts, rename Chinese assets, UI improvements

- Remove unused design draft folders (html-files, html-files (1), inpt, doc)
- Rename Chinese-named image files (容器-4_*.svg → provider-*.svg)
- Add language switcher icon to Navbar with dynamic character display
- Align Footer padding with Navbar (32px desktop, 16px mobile)
- Fix CONTENTS sidebar position on wide screens
- Add i18n support for Docs CONTENTS title
- Fix clipboard copy fallback for HTTP/LAN environments
- Adjust Toast padding, benchmark medal sizes
- Swap highlight stats positions (Adoption Rate ↔ Active Users)
- Update stat4 value to 25.10% and stat5 caption to Battle-tested
- Unify Hero buttons size with Navbar Get Started button

* refactor: rename icon assets with semantic English names and cleanup unused files

- Rename all svg_*.svg icons to semantic names based on usage context:
  - icon-feature-*.svg for feature section icons
  - icon-usecase-*.svg for use case section icons
  - icon-chevron-*.svg, icon-copy.svg, icon-play.svg for UI controls
  - icon-github.svg, icon-language.svg, icon-sort.svg, icon-terminal-prompt.svg
- Remove unused assets: 5 unreferenced svg icons, image_9e7821.png, provider-8.svg
- Remove debug screenshots: debug-screenshot.png, debug-wide.png
- Remove .vsix build artifact and add *.vsix to .gitignore
- Update all import paths in components accordingly

* fix: address PR review feedback - bugs and improvements

- Fix copy-paste bug: step3Label1 had wrong text in all 3 languages
  - en: 'Interactive Setup (Recommended)' → 'Review Commands'
  - zh: '交互式设置(推荐)' → '运行审查命令'
  - ja: '対話式セットアップ(推奨)' → 'レビュー実行'
- Fix inconsistent indentation (4 spaces → 2 spaces) in i18n files
- Add .catch() handler for navigator.clipboard.writeText() in QuickStartSection
- Check document.execCommand('copy') return value before showing toast
- Extract fallbackCopy helper to deduplicate clipboard logic
- Remove unused useCallback import from HighlightsSection
- Move @types/three from dependencies to devDependencies
- Add i18n key 'hero.terminal' for hardcoded Terminal label

* fix: revert vscode .gitignore change and remove duplicate root SVGs

- Revert extensions/vscode/.gitignore to upstream state (remove *.vsix rule)
- Remove root-level brandicon.svg, claude code icon.svg, codex icon.svg
  (identical copies already exist in pages/src/assets/images/ with proper names)

* fix: reorder highlights stats to match design reference

- Reorder stats: 20K+ Active Users → > 30% Adoption Rate → 1M+ Tasks → 1/9 Token Cost → 25.10% AACR-BENCH
- Update stat1 value from 30K+ to 20K+
- Sync all three languages (en/zh/ja)

* chore: remove unused debug screenshots

* chore: remove unused image_9e7821.png

* feat(pages): consolidate icons, add scroll-to-top, responsive titles

- Merge provider-1~7.svg into single icon-ocr-source.svg
- Add ScrollToTop component for tab navigation reset
- Add tablet breakpoint (36px) to section titles for responsive scaling

* refactor(pages): extract shared responsive title hook, fix indentation

- Create useSectionTitleStyle hook to eliminate nested ternaries
- Replace duplicated responsive logic in 4 section components
- Fix fragment children indentation in App.tsx

Addresses code review feedback from PR #241

* feat(pages): add install badge with shimmer effect and copy functionality

- Add install badge above hero title with download/copy icons
- Implement text shimmer animation (left-to-right, 5s cycle)
- Add clipboard copy with secure context check and fallback
- Set download icon color to #2bde5e
- Set badge background to rgba(0,0,0,0.8)
- Fix mobile responsive width for badge

* fix(pages): address PR #254 code review feedback

- Add prefers-reduced-motion media query for shimmer animation
- Extract install command to INSTALL_CMD constant (DRY)
- Use t() i18n function for toast messages (hero.copied/hero.copyFailed)
- Show error feedback when copy operation fails
- Refactor handleCopy to use async/await instead of .then/.catch

* fix(pages): align hero install badge toast style with QuickStart section

- Use consistent toast visual: rgba(255,255,255,0.1) bg, 0.2 border, 0.85 text
- Match padding (5px 14px), borderRadius (6px), fontSize (12px)
- Position at top: 88px (below navbar)

* fix(pages): separate green download icon for hero badge, restore docs icon

- Restore doc-download.svg to original white (#FFFFFF, opacity 0.8) for Docs page
- Create doc-download-green.svg (#2bde5e) for Hero install badge
- Update HeroSection import to use green variant

* fix(pages): restore doc-download.svg to white for Docs page

- Restore doc-download.svg fill to #FFFFFF with opacity 0.8
- Hero badge uses separate doc-download-green.svg (#2bde5e)
2026-07-01 17:05:54 +08:00
kite
2a5c894635
docs(pages): deduplicate scan preview section and add review preview card (#255)
Merge the redundant scan --preview standalone section into its existing
card with richer copy, and add a matching Dry-Run Preview card to the
ocr review advanced usage section. Updates en/zh/ja i18n files.
2026-07-01 16:41:24 +08:00
Preetham Noel P
2301ee00cc
docs(pages): add ocr scan documentation page (#251)
* docs(pages): add ocr scan documentation page

Adds a dedicated Scan page covering when to use ocr scan vs ocr
review, basic usage, --preview dry-run, batching strategies,
--no-plan/--no-dedup/--no-summary toggles, --max-tokens-budget,
and the full flag reference — cross-checked against
cmd/opencodereview/scan_cmd.go. Wires the /scan route into App.tsx,
adds a Scan nav link, and adds scan.* i18n keys for en/zh/ja.

Closes #242

* refactor(pages): move ocr scan docs into the Docs page

Folds the ocr scan documentation into a new section within
DocsPage.tsx instead of a standalone /scan page, matching how
ocr review is structured. Removes ScanPage.tsx, the /scan route,
and the Scan nav link.

Also addresses the automated review findings: reuses DocsPage's
existing Toast/CodeBlock/IconBox (no more duplication), adds alt=""
to IconBox, i18n-izes the 'ocr review'/'ocr scan' comparison labels,
and adds a console.warn when clipboard copy fails.

i18n keys renamed from scan.* to docs.scan* to match the existing
docs.review* naming convention.
2026-07-01 16:25:23 +08:00
hezheng.lsw
22dcd9969a
feat(pages): add install badge with shimmer effect and copy functionality (#254)
* feat(pages): redesign landing page UI with i18n support

- Redesign all sections based on design file: Navbar, Hero, Highlights, UseCases, Features, Benchmark, QuickStart, Footer
- Add scroll fade-in animation with IntersectionObserver
- Implement full i18n (English/Chinese) with language toggle button
- Add SVG icons and image assets
- Style refinements: table borders, step containers, button styles, spacing

* feat(pages): redesign Docs page with i18n, responsive sidebar, and aligned copy interaction

- Redesign DocsPage UI based on reference HTML design
- Add i18n support for all Docs content (en/zh/ja)
- Fix right sidebar CONTENTS nav with fixed positioning
- Add container backgrounds (4% opacity, 16% border)
- Hide CONTENTS sidebar on mobile instead of alternative UI
- Align copy icon and toast interaction with QuickStart section
- Add new SVG icon assets for docs page
- Add Japanese language support
- Add ColorBends animated background component
- Add responsive hooks and FadeInSection animation
- Add Benchmark, Features, QuickStart standalone pages
- Update Navbar, Footer, and LandingPage components

* refactor: cleanup design drafts, rename Chinese assets, UI improvements

- Remove unused design draft folders (html-files, html-files (1), inpt, doc)
- Rename Chinese-named image files (容器-4_*.svg → provider-*.svg)
- Add language switcher icon to Navbar with dynamic character display
- Align Footer padding with Navbar (32px desktop, 16px mobile)
- Fix CONTENTS sidebar position on wide screens
- Add i18n support for Docs CONTENTS title
- Fix clipboard copy fallback for HTTP/LAN environments
- Adjust Toast padding, benchmark medal sizes
- Swap highlight stats positions (Adoption Rate ↔ Active Users)
- Update stat4 value to 25.10% and stat5 caption to Battle-tested
- Unify Hero buttons size with Navbar Get Started button

* refactor: rename icon assets with semantic English names and cleanup unused files

- Rename all svg_*.svg icons to semantic names based on usage context:
  - icon-feature-*.svg for feature section icons
  - icon-usecase-*.svg for use case section icons
  - icon-chevron-*.svg, icon-copy.svg, icon-play.svg for UI controls
  - icon-github.svg, icon-language.svg, icon-sort.svg, icon-terminal-prompt.svg
- Remove unused assets: 5 unreferenced svg icons, image_9e7821.png, provider-8.svg
- Remove debug screenshots: debug-screenshot.png, debug-wide.png
- Remove .vsix build artifact and add *.vsix to .gitignore
- Update all import paths in components accordingly

* fix: address PR review feedback - bugs and improvements

- Fix copy-paste bug: step3Label1 had wrong text in all 3 languages
  - en: 'Interactive Setup (Recommended)' → 'Review Commands'
  - zh: '交互式设置(推荐)' → '运行审查命令'
  - ja: '対話式セットアップ(推奨)' → 'レビュー実行'
- Fix inconsistent indentation (4 spaces → 2 spaces) in i18n files
- Add .catch() handler for navigator.clipboard.writeText() in QuickStartSection
- Check document.execCommand('copy') return value before showing toast
- Extract fallbackCopy helper to deduplicate clipboard logic
- Remove unused useCallback import from HighlightsSection
- Move @types/three from dependencies to devDependencies
- Add i18n key 'hero.terminal' for hardcoded Terminal label

* fix: revert vscode .gitignore change and remove duplicate root SVGs

- Revert extensions/vscode/.gitignore to upstream state (remove *.vsix rule)
- Remove root-level brandicon.svg, claude code icon.svg, codex icon.svg
  (identical copies already exist in pages/src/assets/images/ with proper names)

* fix: reorder highlights stats to match design reference

- Reorder stats: 20K+ Active Users → > 30% Adoption Rate → 1M+ Tasks → 1/9 Token Cost → 25.10% AACR-BENCH
- Update stat1 value from 30K+ to 20K+
- Sync all three languages (en/zh/ja)

* chore: remove unused debug screenshots

* chore: remove unused image_9e7821.png

* feat(pages): consolidate icons, add scroll-to-top, responsive titles

- Merge provider-1~7.svg into single icon-ocr-source.svg
- Add ScrollToTop component for tab navigation reset
- Add tablet breakpoint (36px) to section titles for responsive scaling

* refactor(pages): extract shared responsive title hook, fix indentation

- Create useSectionTitleStyle hook to eliminate nested ternaries
- Replace duplicated responsive logic in 4 section components
- Fix fragment children indentation in App.tsx

Addresses code review feedback from PR #241

* feat(pages): add install badge with shimmer effect and copy functionality

- Add install badge above hero title with download/copy icons
- Implement text shimmer animation (left-to-right, 5s cycle)
- Add clipboard copy with secure context check and fallback
- Set download icon color to #2bde5e
- Set badge background to rgba(0,0,0,0.8)
- Fix mobile responsive width for badge

* fix(pages): address PR #254 code review feedback

- Add prefers-reduced-motion media query for shimmer animation
- Extract install command to INSTALL_CMD constant (DRY)
- Use t() i18n function for toast messages (hero.copied/hero.copyFailed)
- Show error feedback when copy operation fails
- Refactor handleCopy to use async/await instead of .then/.catch

* fix(pages): align hero install badge toast style with QuickStart section

- Use consistent toast visual: rgba(255,255,255,0.1) bg, 0.2 border, 0.85 text
- Match padding (5px 14px), borderRadius (6px), fontSize (12px)
- Position at top: 88px (below navbar)
2026-07-01 15:48:12 +08:00
kite
52a51f86f8 test(diff): add tests for gitignore pattern matching and mode getters 2026-07-01 14:27:07 +08:00
kite
be470bb8ee fix(i18n): improve Chinese hero title wording
Some checks are pending
CI / test (push) Waiting to run
Deploy Pages / build (push) Waiting to run
Deploy Pages / deploy (push) Blocked by required conditions
Remove redundant "经" prefix for a more concise and impactful title.
2026-07-01 13:22:01 +08:00
kite
d84d76b6dc fix(session): isolate test sessions to test-sessions subdirectory
Some checks are pending
CI / test (push) Waiting to run
Prevent make test from polluting ~/.opencodereview/sessions/ with
thousands of var-folders-* directories by redirecting test session
writes to ~/.opencodereview/test-sessions/.

Introduce a package-level sessionSubDir variable (default "sessions")
and an exported UseTestSessions() function that switches it to
"test-sessions". Each test package that creates sessions calls
UseTestSessions() from init() in an init_test.go file.
2026-06-30 13:23:21 +08:00
kite
e3813ceeda docs: add timeout_sec and OCR_LLM_TIMEOUT to configuration reference
Some checks are pending
CI / test (push) Waiting to run
2026-06-30 11:29:06 +08:00
kite
c076b8e17f docs(llm): clarify timeout override semantics and resolution-path coverage 2026-06-30 11:25:21 +08:00
MurphyYi
eae863502b
fix: add configurable HTTP timeout for LLM API calls (#238)
* fix: add configurable HTTP timeout for LLM API calls

The LLM HTTP client had no user-configurable request timeout. When the
LLM API becomes unresponsive (e.g., rate limiting, network issues), the
ocr process hangs indefinitely with 0% CPU, holding an ESTABLISHED TCP
connection that never completes.

Changes:
- Add Timeout field to ResolvedEndpoint struct
- Add OCR_LLM_TIMEOUT environment variable (value in seconds)
- Add timeout_sec field to config.json llm and provider sections
- Pass timeout from ResolvedEndpoint to ClientConfig in NewLLMClient

The default timeout remains 5 minutes when not explicitly configured.
Users can now set a shorter timeout via:
  - Environment: OCR_LLM_TIMEOUT=120
  - Config file: {"llm": {"timeout_sec": 120}}

Fixes #237

* fix: address Copilot review feedback

- Make OCR_LLM_TIMEOUT a global override (works with any endpoint strategy)
- Add proper overflow detection for timeout values (check before multiply)
- Add validateTimeoutSec helper with negative/overflow guards
- Add comprehensive tests for timeout parsing, validation, and forwarding
- Reject negative timeout_sec in config files with explicit error

* fix: address review feedback for timeout configuration

- parseTimeoutEnv now returns errors instead of silent fallback for invalid values (negative, non-integer, overflow)
- Reuse validateTimeoutSec in parseTimeoutEnv to eliminate duplicated validation logic
- Remove redundant comment in tryOCREnv
- Add missing tests:
  - TestResolveEndpoint_ProviderConfigTimeoutSec
  - TestResolveEndpoint_ProviderConfigNegativeTimeoutSec
  - TestResolveEndpoint_EnvTimeoutOverridesConfigTimeout
  - TestResolveEndpoint_EnvTimeoutOverridesProviderTimeout
  - TestResolveEndpoint_InvalidEnvTimeoutWithConfig
  - TestResolveEndpoint_NegativeEnvTimeoutWithConfig
2026-06-30 11:22:24 +08:00
kite
62972cbcf8 refactor(pages): improve hero terminal display with semantic colors, reorder lines, and add cursor blink
Some checks failed
CI / test (push) Waiting to run
Deploy Pages / build (push) Has been cancelled
Deploy Pages / deploy (push) Has been cancelled
- Reorder terminal lines: move Summary above the separator line
- Change command from range mode (--from/--to) to workspace mode (ocr review)
- Apply semantic color scheme: brand, command, path, success, action, dim
- Remove unused terminal prompt icon and hasIcon field
- Add blinking cursor animation for the last terminal line
- Reduce line number container width after icon removal
2026-06-29 22:52:29 +08:00
kite
403335ef5a docs: add official website link to READMEs and update screenshots
Some checks are pending
CI / test (push) Waiting to run
Deploy Pages / build (push) Waiting to run
Deploy Pages / deploy (push) Blocked by required conditions
Add official website URL to the "What is Open Code Review?" section
across all localized READMEs. Update highlights and benchmark
screenshots for en/zh, add Japanese versions (highlights-ja.png,
benchmark-ja.png), and add id="highlights" to HighlightsSection
for screenshot tool targeting.
2026-06-29 17:20:39 +08:00
kite
86d474c5d7 feat(i18n): auto-detect browser language for default locale selection
Use navigator.languages to detect the user's preferred language and
automatically select the matching locale (zh/ja/en) on first visit,
falling back to English when no match is found.
2026-06-29 16:43:04 +08:00
kite
dc30b81ad6 fix(i18n): correct ocr viewer description from "review results" to "session logs"
The ocr viewer command is a session history viewer, not a results browser.
Updated the description in all three locales (en, zh, ja) to accurately
reflect its purpose.
2026-06-29 16:19:46 +08:00
hezheng.lsw
3e01d0db17
feat(pages): consolidate icons, add scroll-to-top, responsive titles (#241)
* feat(pages): redesign landing page UI with i18n support

- Redesign all sections based on design file: Navbar, Hero, Highlights, UseCases, Features, Benchmark, QuickStart, Footer
- Add scroll fade-in animation with IntersectionObserver
- Implement full i18n (English/Chinese) with language toggle button
- Add SVG icons and image assets
- Style refinements: table borders, step containers, button styles, spacing

* feat(pages): redesign Docs page with i18n, responsive sidebar, and aligned copy interaction

- Redesign DocsPage UI based on reference HTML design
- Add i18n support for all Docs content (en/zh/ja)
- Fix right sidebar CONTENTS nav with fixed positioning
- Add container backgrounds (4% opacity, 16% border)
- Hide CONTENTS sidebar on mobile instead of alternative UI
- Align copy icon and toast interaction with QuickStart section
- Add new SVG icon assets for docs page
- Add Japanese language support
- Add ColorBends animated background component
- Add responsive hooks and FadeInSection animation
- Add Benchmark, Features, QuickStart standalone pages
- Update Navbar, Footer, and LandingPage components

* refactor: cleanup design drafts, rename Chinese assets, UI improvements

- Remove unused design draft folders (html-files, html-files (1), inpt, doc)
- Rename Chinese-named image files (容器-4_*.svg → provider-*.svg)
- Add language switcher icon to Navbar with dynamic character display
- Align Footer padding with Navbar (32px desktop, 16px mobile)
- Fix CONTENTS sidebar position on wide screens
- Add i18n support for Docs CONTENTS title
- Fix clipboard copy fallback for HTTP/LAN environments
- Adjust Toast padding, benchmark medal sizes
- Swap highlight stats positions (Adoption Rate ↔ Active Users)
- Update stat4 value to 25.10% and stat5 caption to Battle-tested
- Unify Hero buttons size with Navbar Get Started button

* refactor: rename icon assets with semantic English names and cleanup unused files

- Rename all svg_*.svg icons to semantic names based on usage context:
  - icon-feature-*.svg for feature section icons
  - icon-usecase-*.svg for use case section icons
  - icon-chevron-*.svg, icon-copy.svg, icon-play.svg for UI controls
  - icon-github.svg, icon-language.svg, icon-sort.svg, icon-terminal-prompt.svg
- Remove unused assets: 5 unreferenced svg icons, image_9e7821.png, provider-8.svg
- Remove debug screenshots: debug-screenshot.png, debug-wide.png
- Remove .vsix build artifact and add *.vsix to .gitignore
- Update all import paths in components accordingly

* fix: address PR review feedback - bugs and improvements

- Fix copy-paste bug: step3Label1 had wrong text in all 3 languages
  - en: 'Interactive Setup (Recommended)' → 'Review Commands'
  - zh: '交互式设置(推荐)' → '运行审查命令'
  - ja: '対話式セットアップ(推奨)' → 'レビュー実行'
- Fix inconsistent indentation (4 spaces → 2 spaces) in i18n files
- Add .catch() handler for navigator.clipboard.writeText() in QuickStartSection
- Check document.execCommand('copy') return value before showing toast
- Extract fallbackCopy helper to deduplicate clipboard logic
- Remove unused useCallback import from HighlightsSection
- Move @types/three from dependencies to devDependencies
- Add i18n key 'hero.terminal' for hardcoded Terminal label

* fix: revert vscode .gitignore change and remove duplicate root SVGs

- Revert extensions/vscode/.gitignore to upstream state (remove *.vsix rule)
- Remove root-level brandicon.svg, claude code icon.svg, codex icon.svg
  (identical copies already exist in pages/src/assets/images/ with proper names)

* fix: reorder highlights stats to match design reference

- Reorder stats: 20K+ Active Users → > 30% Adoption Rate → 1M+ Tasks → 1/9 Token Cost → 25.10% AACR-BENCH
- Update stat1 value from 30K+ to 20K+
- Sync all three languages (en/zh/ja)

* chore: remove unused debug screenshots

* chore: remove unused image_9e7821.png

* feat(pages): consolidate icons, add scroll-to-top, responsive titles

- Merge provider-1~7.svg into single icon-ocr-source.svg
- Add ScrollToTop component for tab navigation reset
- Add tablet breakpoint (36px) to section titles for responsive scaling

* refactor(pages): extract shared responsive title hook, fix indentation

- Create useSectionTitleStyle hook to eliminate nested ternaries
- Replace duplicated responsive logic in 4 section components
- Fix fragment children indentation in App.tsx

Addresses code review feedback from PR #241
2026-06-29 15:44:41 +08:00
kite
d22bd7fa3d fix(i18n): correct inaccurate translations in zh and ja locales
- zh: navbar.benchmark '排行榜' → '基准测试' to match benchmark section
- zh: footer.copyright fix year placement to follow convention
- zh: docs.configKeyExtraBody '供应商' → '提供商' for terminology consistency
- ja: highlights.stat4Caption add missing particle 'との'
- ja: benchmark.colPrecision '精度' → '適合率' (standard ML term for precision)
2026-06-29 15:15:51 +08:00
hezheng.lsw
08e7846a37
refactor: cleanup design drafts, rename Chinese assets, UI improvements (#239)
* feat(pages): redesign landing page UI with i18n support

- Redesign all sections based on design file: Navbar, Hero, Highlights, UseCases, Features, Benchmark, QuickStart, Footer
- Add scroll fade-in animation with IntersectionObserver
- Implement full i18n (English/Chinese) with language toggle button
- Add SVG icons and image assets
- Style refinements: table borders, step containers, button styles, spacing

* feat(pages): redesign Docs page with i18n, responsive sidebar, and aligned copy interaction

- Redesign DocsPage UI based on reference HTML design
- Add i18n support for all Docs content (en/zh/ja)
- Fix right sidebar CONTENTS nav with fixed positioning
- Add container backgrounds (4% opacity, 16% border)
- Hide CONTENTS sidebar on mobile instead of alternative UI
- Align copy icon and toast interaction with QuickStart section
- Add new SVG icon assets for docs page
- Add Japanese language support
- Add ColorBends animated background component
- Add responsive hooks and FadeInSection animation
- Add Benchmark, Features, QuickStart standalone pages
- Update Navbar, Footer, and LandingPage components

* refactor: cleanup design drafts, rename Chinese assets, UI improvements

- Remove unused design draft folders (html-files, html-files (1), inpt, doc)
- Rename Chinese-named image files (容器-4_*.svg → provider-*.svg)
- Add language switcher icon to Navbar with dynamic character display
- Align Footer padding with Navbar (32px desktop, 16px mobile)
- Fix CONTENTS sidebar position on wide screens
- Add i18n support for Docs CONTENTS title
- Fix clipboard copy fallback for HTTP/LAN environments
- Adjust Toast padding, benchmark medal sizes
- Swap highlight stats positions (Adoption Rate ↔ Active Users)
- Update stat4 value to 25.10% and stat5 caption to Battle-tested
- Unify Hero buttons size with Navbar Get Started button

* refactor: rename icon assets with semantic English names and cleanup unused files

- Rename all svg_*.svg icons to semantic names based on usage context:
  - icon-feature-*.svg for feature section icons
  - icon-usecase-*.svg for use case section icons
  - icon-chevron-*.svg, icon-copy.svg, icon-play.svg for UI controls
  - icon-github.svg, icon-language.svg, icon-sort.svg, icon-terminal-prompt.svg
- Remove unused assets: 5 unreferenced svg icons, image_9e7821.png, provider-8.svg
- Remove debug screenshots: debug-screenshot.png, debug-wide.png
- Remove .vsix build artifact and add *.vsix to .gitignore
- Update all import paths in components accordingly

* fix: address PR review feedback - bugs and improvements

- Fix copy-paste bug: step3Label1 had wrong text in all 3 languages
  - en: 'Interactive Setup (Recommended)' → 'Review Commands'
  - zh: '交互式设置(推荐)' → '运行审查命令'
  - ja: '対話式セットアップ(推奨)' → 'レビュー実行'
- Fix inconsistent indentation (4 spaces → 2 spaces) in i18n files
- Add .catch() handler for navigator.clipboard.writeText() in QuickStartSection
- Check document.execCommand('copy') return value before showing toast
- Extract fallbackCopy helper to deduplicate clipboard logic
- Remove unused useCallback import from HighlightsSection
- Move @types/three from dependencies to devDependencies
- Add i18n key 'hero.terminal' for hardcoded Terminal label

* fix: revert vscode .gitignore change and remove duplicate root SVGs

- Revert extensions/vscode/.gitignore to upstream state (remove *.vsix rule)
- Remove root-level brandicon.svg, claude code icon.svg, codex icon.svg
  (identical copies already exist in pages/src/assets/images/ with proper names)

* fix: reorder highlights stats to match design reference

- Reorder stats: 20K+ Active Users → > 30% Adoption Rate → 1M+ Tasks → 1/9 Token Cost → 25.10% AACR-BENCH
- Update stat1 value from 30K+ to 20K+
- Sync all three languages (en/zh/ja)

* chore: remove unused debug screenshots

* chore: remove unused image_9e7821.png
2026-06-29 14:42:43 +08:00
kite
0881ad87b8 fix(ci): use --replace-all for git safe.directory to prevent self-hosted runner failure
Some checks are pending
CI / test (push) Waiting to run
On self-hosted runners, _github_home/.gitconfig persists across jobs.
The ocr-review workflow used --add which accumulated multiple safe.directory
values over time. Once multiple values existed, other workflows using plain
git config (without --add/--replace-all) failed with "cannot overwrite
multiple values with a single value".

Unify all workflows to use --replace-all, which clears previous values and
writes exactly one entry regardless of prior state.
2026-06-29 11:37:23 +08:00