Skip to content

Feature(symbol-palette): add local handwritten symbol recognition + enhanced symbol list - #90

Open
Musicminion wants to merge 2 commits into
server-profrom
feat-symbol-recognition
Open

Musicminion wants to merge 2 commits into
server-profrom
feat-symbol-recognition

Conversation

@Musicminion

@Musicminion Musicminion commented Sep 28, 2026 •

Copy link
Copy Markdown
Member
  • Add browser-side recognition using a model trained by ayaka-notes for ayakaleaf-pro
  • Add a handwriting input panel to the symbol palette
  • Add a script to generate the symbol sprite atlas

Description

Add handwritten LaTeX symbol recognition to the symbol palette. Users can draw a symbol and select a matching command, with recognition running locally in the browser across 1,622 symbol classes.

Validated with 14 local frontend tests and browser regression checks for clock and empty-set recognition.

image

Related issues / Pull Requests

We also want to fix: #19

Contributor Agreement

- add browser-side recognition using a model trained by ayaka-notes
- add a handwriting input panel to the symbol palette
- add a script to generate the symbol sprite atlas
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-28T13:13:17.232404Z cd46708 PR opened
🔒 Security Review ✅ Completed 2026-09-28T13:14:37.189495Z cd46708 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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

Copy link
Copy Markdown

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: cd467087d0

ℹ️ 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".

export function rasterizeStrokes(strokes, config) {
const size = config.imageSize
const renderSize = size * config.supersample
const canvas = new OffscreenCanvas(renderSize, renderSize)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Provide a canvas fallback for Safari 15

The web package explicitly targets Safari 15, where OffscreenCanvas is unavailable. On that supported browser, every drawing reaches this constructor, throws, and is converted by the worker into “Recognition unavailable,” even though the draw control remains visible. Use a worker-compatible fallback, preprocess on a regular canvas on the main thread, or hide the feature when the required API is absent.

Useful? React with 👍 / 👎.

Comment on lines +16 to +20
const width = maxX - minX || 1
const height = maxY - minY || 1
const scale = coordinateSpace / Math.max(width, height)
const offsetX = (coordinateSpace - width * scale) / 2
const offsetY = (coordinateSpace - height * scale) / 2

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 Center single-point strokes during normalization

When the user makes a tap without pointer movement—for example, when drawing a dot—both extents are replaced with 1, making the scale equal to the entire coordinate space and both offsets zero. The only point is consequently rasterized near the upper-left margin rather than centered, so dot-like symbols are fed to the model in the wrong location. Handle a stroke whose overall width and height are both zero as a centered point.

Useful? React with 👍 / 👎.

@Musicminion Musicminion changed the title Feature(symbol-palette): add local handwritten symbol recognition Feature(symbol-palette): add local handwritten symbol recognition + enhanced symbol list Sep 28, 2026
- expand Unicode symbol catalog from 117 to 1188 entries
- correct Unicode mappings for circ, setminus and varnothing
- center single-point strokes during recognition preprocessing
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.

Feature: enhance math symbol palette

1 participant