Repository navigation
C# 版から失われていた挙動を戻す(Auto Connect、CR 改行、Show CR/LF など) - #9
Merged
Merged
Conversation
C# 版は CR だけの改行も改行として表示していたが、行索引が LF しか見ておらず、 CR で行を終える機器の出力が 1 行に繋がっていた。 - LF・CR・CRLF をそれぞれ 1 つの改行とする(CRLF は 1 つ、LF CR と CR CR は 2 つ) - CR の次が LF かはチャンクをまたいで判定する。チャンク末尾の CR は次のバイトまで 保留し、索引が縮むことはない - ResumeBoundary を LineIndexer にまとめ、保留中の CR も持たせる。切断で保留が 失われても再開位置が行頭として入る Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Windows の USB 機器はフレンドリ名がすでに " (COM5)" で終わるため、一覧が "USB Serial Port (COM5) (COM5)" になっていた。製品名の末尾がそのポート名の 括弧書きなら取り除いてから "製品名 (COM5)" にする。形式は変えないので、 portPath / extract_port_path の解釈と MCP の ports もそのまま。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
C# 版は '-' ' ' ',' '.' '/' で区切り、各トークンを 1 バイト(1〜2 桁)として 読んでいた。新版は空白だけを無視して 2 桁ずつ組にしていたため、`0A-0B` は エラーになり、`12 3 4` は黙って 0x12 0x34 を送っていた(誤送信)。 - 空白・, - . / : で区切り、1〜2 桁のトークンを 1 バイトとする。0x 接頭辞も可 - 3 桁以上の偶数桁のトークンは 2 桁ずつ(`48656C6C6F` は従来どおり) - それ以外(`123` のような奇数桁、16 進でない文字)は推測せずにエラー。どの トークンかを入力欄の下に表示し、その間は Send を押せない(ブロックする alert をやめた) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
C# 版の規則どおり、CR/LF を除くと空になる入力は送信はするが履歴に入れない。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
C# 版は入力ミスを防ぐため送信欄を 16pt(受信欄 12pt)にしていた。 送信欄を 13px から 17px にする。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
C# 版には Show [CRLF] / Show [NUL](既定 OFF)があり、OFF では改行を普通の改行 として、NUL を消して表示していた。新版は常に制御文字を記号で出すため、全行の 末尾に CR LF の記号が並んでいた。 - ASCII 表示に Show CR/LF と Show NUL(既定 OFF、設定は保存)を追加 - Show CR/LF が OFF のとき CR・LF を隠し、TAB は実際のタブで表示する。隠した CR・LF は大きさ 0 の span に残すので、選択範囲のコピーでも改行は消えない (display:none では選択に含まれず、コピー処理が改行を失う) - Show NUL が OFF のとき NUL を表示しない(コピーにも含めない。C# 版と同じ) - 表示の切り替えだけで、受信データ・Save・Copy の全体出力は変わらない Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
C# 版はバイナリ表示でも受信のまとまりごとに時刻を付けていた。新版は Hex 表示で Timestamp を選べなかった。 - Hex 表示でも Timestamp を選べるようにし、16 バイトの行ごとに先頭バイトの受信 時刻を出す(get_display_rows に show_timestamp、行に timestamp) - 切り替えたら行を取り直す(取得済みの行には時刻が無い/有る) - Timestamp ON の Copy は各行に時刻と区切りを付ける。Save は Hex 表示では常に 受信したバイトのまま(handleExport で ASCII 表示に限定) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
C# 版は Copy・Save のあとに自動で閉じるメッセージ("Copied" など)を出し、空の ときは警告していた。新版は成功しても何も出ず、空の Copy は無反応だった。 - "Copied" / "Saved" / "Nothing to copy" / "Nothing to save" を 1.5 秒の トーストで出す(role=status、クリックを妨げない) - 空の Save の alert もトーストにした(alert は JS を止め、再接続の照合も止まる) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
C# 版の Auto Connect は、ポートが開いていなければ選択中のポートを 200 ms ごとに 開こうとしていた(起動時やデバイスを初めて挿したときも接続し、Disconnect で OFF になる)。新版の Auto Reconnect は、接続中に失ったデバイスが戻ったときしか 開かなかった。 - ON の間、ポートが開いていなければ選択中のポートが開け次第開く(起動時・挿した とき・ON にしたとき・ポートを選び直したとき)。起動時は前回のポートを、無くても 選択したまま "(not present)" で待つ - 自動で開くときは常に reopen_port(同じキャプチャに追記)。新しいセッションに するのは Connect ボタンだけ(SYS-F-803) - Disconnect と待機中の Cancel で OFF にする(C# 版と同じ。OFF にしないと 即座に開き直す) - 一覧にあるのに開けない(他のプログラムが使用中など)ときは 5 回失敗した後 1 s 間隔に落とし、"(cannot open the port)" と理由(ツールチップ)を出す - 照合間隔を 500 ms から C# 版と同じ 200 ms に - 設定は新しいキー autoConnect(既定 OFF)。起動時にポートを開くようになったので 旧 Auto Reconnect の ON は引き継がない - 表示は "Connected automatically …"。ブリッジ / MCP の reconnecting の説明も 自動接続の待機を含む文言に(プロトコルの名前は変えない) - docs 21 SYS-F-807 / 23 / 24 / 27、FT232H 治具の説明を更新 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ポートを開いただけでボードがリセットされないよう、DTR と RTS を既定 OFF にする。 DTR ON は Arduino Uno 型(CH340 互換機を含む)をリセットし、DTR OFF のままの RTS ON は ESP32 系の自動リセット回路でチップをリセット状態に保つ。 - DtrEnable / RtsEnable の横に "?" を置き、ホバー(キーボードのフォーカスでも)で 注記を出す。DTR は Uno 型がリセットされること、USB 直結のボード(Leonardo、 Pico、ESP32-S2/S3/C3)は DTR ON にしないと送ってこない場合があること。RTS は ESP32 系で DTR OFF のまま ON にするとリセット状態になること - ポートを開いた直後は DTR を RTS より先に設定する(逆順だと ESP32 系で一瞬 RTS だけが ON になりリセットがかかる)。順序をコメントで固定 - そのほかの既定値は C# 版に合わせる: 送信の改行なし(LF だった)、Send with Enter ON、Line Wrap OFF、タイムスタンプの区切り " > "(選択肢に追加) - 保存済みの設定はそのまま使う(変わるのは新規インストールだけ) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
beta.2 と同じリリースで出すので、CHANGELOG は beta.2 の節に追記する。README の 機能一覧(Auto Connect、Show CR/LF・NUL、両表示のタイムスタンプ、Hex 送信の書き方) と、DTR/RTS の既定値と Arduino での注意を更新。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Restores behavior of the C# version (v0.0.8) that the Tauri/Rust rewrite had lost, found by checking the blog post and the C# source against the current app. Based on
dev, so after this is merged, #8 carries everything and beta.2 is released once. One commit per item:USB Serial Port (COM5) (COM5)0A-0B,1,2,3,0x41). Before,12 3 4was silently sent as12 34. Invalid bytes are named under the input, not in a blocking dialog>Owner decisions: no "User's Note" field; parity / stop bits / flow control stay as the serialport crate supports them; DTR off by default. Designs were reviewed before implementation.
Verification
🤖 Generated with Claude Code