Skip to content

⚡ 追加: 複数のキャラクター画像を利用できる機能#385

Open
yutorize wants to merge 9 commits into
develop-2.00from
codex-2m2nnb
Open

⚡ 追加: 複数のキャラクター画像を利用できる機能#385
yutorize wants to merge 9 commits into
develop-2.00from
codex-2m2nnb

Conversation

@yutorize

Copy link
Copy Markdown
Owner

Motivation

  • Allow sheets to store multiple images per character and let users choose which image is the main display image.
  • Preserve existing behavior for single-image installations by defaulting to one image and remaining backward-compatible.
  • Provide per-image upload, deletion, compression and archival so images can be managed independently.

Description

  • Add new configuration image_maxcount with a default of 1 in config-default.pl to control maximum stored images per sheet.
  • Update front-end (_core/lib/edit.js) to support multiple image inputs, per-image compression and previews by tracking compressedImageFiles and passing imageNo through image handlers, backup, form submission and JSON export.
  • Extend backend read/write paths to use suffixed filenames (e.g. image2.jpg) and to accept imageNo parameters when redirecting or serving images in _core/lib/others.pl, _core/lib/subroutine.pl, and _core/lib/view.pl.
  • Update save flow in _core/lib/save.pl to handle multiple incoming imageFileN fields, per-image deletion flags, per-image update timestamps, to maintain mainImage selection, and to pass image data into dataSave.
  • Add deleteImageData helper in _core/lib/edit.pl to simplify removal of image-related keys and update renderImageForm to render multiple file inputs and a radio UI for mainImage.
  • Change dataSave to archive/read image files with numeric suffixes, include uploaded image data in archives, and to delete/replace the correct suffixed files on updates.

Testing

  • Ran perl -c (syntax checks) on modified Perl modules and they completed successfully.
  • Performed a static JavaScript syntax check on _core/lib/edit.js with node --check and it reported no syntax errors.
  • No additional automated integration tests were included in this change set.

Codex Task

@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: 1c3762fc7f

ℹ️ 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 thread _core/lib/edit.pl Outdated
@{[ input 'image','hidden' ]}
<input type="checkbox" name="imageDelete" value="1"> 画像1を削除する
@{[ join '', map { my $n=$_; my $suffix = $n == 1 ? '' : $n; input("image$suffix",'hidden') . input("imageUpdate$suffix",'hidden') } (1 .. ($set::image_maxcount || 1)) ]}
<br>メイン画像:@{[ join ' ', map { my $n=$_; qq|<label><input type="radio" name="mainImage" value="$n" |.($::pc{mainImage}==$n?'checked':'').qq|> $n</label>| } (1 .. ($set::image_maxcount || 1)) ]}

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 JSON出力でもメイン画像を返してください

ここで画像2以降をメインに選べるようになりましたが、mode=json_core/lib/json.pl:47-48 のまま image / imageUpdate(画像1)だけを見て imageURL を作っています。そのため画像1が空で画像2をメインにしたシートは外部連携やエクスポートで画像なしになり、画像1もある場合はユーザーが選んだメイン画像ではなく画像1のURLを返してしまいます。JSON側も mainImage に対応する imageN / imageUpdateN を参照する必要があります。

Useful? React with 👍 / 👎.

@yutorize yutorize changed the title Support multiple character images with per-image upload, compression and main-image selection ⚡ 追加: 複数のキャラクター画像を利用できる機能 Jun 27, 2026

@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: 58eded1345

ℹ️ 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 thread _core/lib/edit.js Outdated
if(saving){ return; }
if(!formCheck()){ return false; }

saveCurrentImageLayout();

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 画像フォームがないシートでは保存処理を分岐してください

この呼び出しは全編集画面で実行されますが、renderEditPageStart を使う SW2 の魔物/アイテムや既存の国・クラン・一般アイテム編集フォームは renderImageForm を通らないため editingImageFit などを持ちません。その状態で保存すると saveCurrentImageLayout() 内の form.editingImageFit.value 参照で TypeError になり、fetch まで進まず保存できません。画像レイアウト欄が存在する場合だけ呼ぶ必要があります。

Useful? React with 👍 / 👎.

Comment thread _core/lib/view.pl Outdated
else { $pc{imageCopyright} = unescapeTags($pc{imageCopyright}) }
$pc{imageLayouts} = %layouts ? JSON::PP->new->canonical(1)->encode(\%layouts) : "{}";

$pc{imageSrc} = "./?id=$::in{id}&mode=image&imageNo=$pc{mainImage}&cache=$pc{imageUpdate}";

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 メイン画像の有無を image にも反映してください

ここで imageSrc などは mainImage の番号へ差し替えていますが、テンプレート側は <TMPL_IF image>(画像1の有無)で画像ブロックを出すままです。画像1を削除して画像2/3だけを登録したシートでは $pc{image} が空のままなので、mainImage が2/3に補正されても閲覧画面は no image 分岐になり、登録したメイン画像が表示されません。$pc{image} もメイン画像の拡張子に合わせるか表示条件を変更してください。

Useful? React with 👍 / 👎.

Comment thread _core/lib/view.pl Outdated
Comment on lines +327 to +328
if($pc{convertSource} && $pc{image}){
$pc{imageSrc} = $pc{imageURL};

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 コンバート画像でも imageLayouts を初期化してください

この分岐に入るコンバート表示(例: blp/convert.pldx3/convert.plconvertSourceimageURL/image を設定)では、下の else で追加された $pc{imageLayouts} 初期化が実行されません。一方 sheet-head.html は常に const imageLayouts = <TMPL_VAR imageLayouts />; を出すため、外部画像付きコンバート結果は const imageLayouts = ; という構文エラーになり、以降のシート用 JS が動かなくなります。この分岐でも少なくとも {} を設定してください。

Useful? React with 👍 / 👎.

@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: 26bff2bc2b

ℹ️ 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 thread _core/lib/edit.js
Comment on lines +669 to +672
function setImagePosition() {
editingImageNo = Number(form.mainImage?.value || 1);
loadImageLayout(editingImageNo);
setPreviewImage(editingImageNo);

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 メイン画像切替前に編集中レイアウトを保存してください

画像設定で位置やセリフを変更したあとに「メイン画像」ラジオを押すケースでは、この関数が現在の編集内容を hidden の imageFitN / wordsN へ退避しないまま loadImageLayout() でフォームを上書きします。その後の保存時は新しい editingImageNo だけが saveCurrentImageLayout() されるため、直前に編集していた画像のレイアウト変更が失われます。サムネイル切替の switchImageLayoutConfig() と同様、ユーザー操作で切り替える前に現在のレイアウトを保存する必要があります。

Useful? React with 👍 / 👎.

Comment thread _core/lib/edit.js
form[`imagePositionY${suffix}`].value = form.editingImagePositionY.value;
form[`imageCopyright${suffix}`].value = form.editingImageCopyright.value;
form[`imageCopyrightURL${suffix}`].value = form.editingImageCopyrightURL.value;
form[`words${suffix}`].value = form.editingWords.value;

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 番号付きセリフの改行も保存前に正規化してください

画像2/3を編集中のとき suffix が 2/3 になり、改行を含むセリフが words2 / words3 として送信されます。一方、各 calc 側で改行を <br> に変換しているのは従来の words だけなので、番号付きセリフはその後の共通エスケープで改行が削除され、保存後に複数行のセリフが連結されて表示されます。wordsNwords と同じ保存前正規化に通してください。

Useful? React with 👍 / 👎.

Comment thread _core/lib/view.pl Outdated
Comment on lines +375 to +377
$pc{imageSrc} = "./?id=$::in{id}&mode=image&imageNo=$pc{mainImage}&cache=$pc{imageUpdate}";
$pc{imageURL} = url()."?id=$::in{id}&mode=image&imageNo=$pc{mainImage}&cache=$pc{imageUpdate}";
$pc{imageOgpURL} = url()."?id=$::in{id}&mode=ogp-image&imageNo=$pc{mainImage}&cache=$pc{imageUpdate}";

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 メイン画像の更新時刻でキャッシュを更新してください

mainImage が 2/3 の場合でも、初期表示・JSON用URL・OGP用URLの cache が常に画像1の imageUpdate になっています。保存処理は画像2/3を差し替えたとき imageUpdate2 / imageUpdate3 だけを更新するため、画像1を触らずにメイン画像だけ差し替えるとURLが変わらず、ブラウザやOGPキャッシュが古いメイン画像を表示し続けます。ここは imageUpdate$mainSuffix を使う必要があります。

Useful? React with 👍 / 👎.

@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: 6f0357b1bf

ℹ️ 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 thread _core/lib/edit.pl Outdated

obj.files = e.dataTransfer.files;
imagePreView(obj.files[0], $set::image_maxsize || 0);
imagePreView(obj.files[0], imageMaxSize, imageNo);

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 ドロップ時も画像サイズ上限を渡してください

画像設定画面へドラッグ&ドロップした場合だけ、この呼び出しが未定義の imageMaxSize を参照するため ReferenceError になり、プレビューもファイル設定も行われません。ファイル選択の onchange$set::image_maxsize のリテラルを渡しているので、同じ値をドロップ経路にも渡す必要があります。

Useful? React with 👍 / 👎.

Comment thread _core/skin/_common/js/sheet.js Outdated
}
}
function getImageId(direction = 0) {
const ids = Object.keys(images).map(Number).sort((a, b) => a - b);

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 カルーセル対象をキャラクター画像に限定してください

BLP/KIZ のパートナー自動取得では setupPartnerDataCommonimagesp1/p2 も追加するため、キャラクター画像が複数あるシートでこの配列を Number 化すると NaN が混ざります。その状態で最後のキャラクター画像から次へ進むと選択 ID が NaN になり、images.hasOwnProperty(selected) が false でボタンが無反応になります。imageLayouts など数値キーだけを巡回対象にしてください。

Useful? React with 👍 / 👎.

Comment thread _core/lib/subroutine.pl Outdated
my $mainSuffix = $pc{mainImage} == 1 ? '' : $pc{mainImage};
if($OPT{includeImage} && $pc{image}){
$pc{imageURL} = ($OPT{imageUrlBase} || $self)."?id=$id&mode=image&cache=$pc{imageUpdate}";
$pc{imageURL} = ($OPT{imageUrlBase} || $self).qq|?id=$id&mode=image&imageNo=$mainSuffix&cache=$pc{"imageUpdate$mainSuffix"}|;

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 パートナー取り込みでメイン画像の実体を読んでください

この行でURLだけ mainImage の番号へ切り替わりますが、この分岐は $pc{image}(画像1)がある時しか入らず、直下の imagePath/imageDataimage.$pc{image} のままです。BLP/KIZ のパートナー自動取得やダウンロードで、相手が画像2/3をメインにしていると、画像1が無ければ画像なし、画像1もあるとプレビューURLと埋め込みデータが別画像になります。

Useful? React with 👍 / 👎.

@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: 1c57589cbe

ℹ️ 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 thread _core/lib/others.pl
Comment on lines +57 to +60
my $imageNo = $::in{imageNo} || $pc{mainImage} || 1;
$imageNo = 1 if $imageNo !~ /^\d+$/ || $imageNo < 1 || $imageNo > ($set::image_maxcount || 1);
my $suffix = $imageNo == 1 ? '' : $imageNo;
my $ext = $pc{"image$suffix"};

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 OGP生成にも選択画像のレイアウトを渡してください

メイン画像が2/3のシートで mode=ogp-image&imageNo=2 が呼ばれると、ここで画像ファイルだけは image2/image3 に切り替わりますが、直後の outputOgpImage(%pc) は無印の imageFit / imagePositionX / imagePercent だけを参照します。そのため画像2/3に個別のトリミングを設定しても、SNSカードでは画像1の設定またはデフォルトで切り抜かれます。imageNo に対応するレイアウト値を無印キーへ反映してからOGPを生成してください。

Useful? React with 👍 / 👎.

Comment thread _core/lib/subroutine.pl Outdated
Comment on lines +1340 to +1342
if($OPT{includeImage} && $pc{"image$mainSuffix"}){
$pc{imageURL} = ($OPT{imageUrlBase} || $self).qq|?id=$id&mode=image&imageNo=$mainSuffix&cache=$pc{"imageUpdate$mainSuffix"}|;
my $imgName = qq|image$mainSuffix.$pc{"image$mainSuffix"}|;

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 パートナー画像のレイアウトもメイン画像へ合わせてください

BLP/KIZ の loadPartnerData(... includeImage => 1) ではこの分岐でURLと実体だけを mainImage の番号へ切り替えていますが、呼び出し側のテンプレートは p1_imageFit / p1_imagePositionX / p1_imageCopyright など無印キーを表示に使います。相手が画像2/3をメインにして個別の配置や権利表記を設定している場合、画像だけ画像2/3でレイアウトや注釈は画像1のものになってしまうため、imageFit$mainSuffix なども無印キーへコピーする必要があります。

Useful? React with 👍 / 👎.

Comment thread _core/lib/subroutine.pl Outdated
$pc{imageData} = readSheetFileBinary($dataDir, $file, $imgName);
}
}
elsif(!$OPT{includeImage} && $pc{image}){

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 画像1がないシートでもコンバート用URLを作ってください

同じゆとシートⅡから includeImage なしで取り込む経路では、この条件が画像1の有無だけを見ているため、画像2/3だけを持つシートでは imageURL2 / imageURL3 が一切作られません。view.pl 側は image2 があると画像ブロックを表示しようとしますがURLが空のままになり、?url=... のコンバート表示やそのJSON利用で画像が表示されません。番号付き画像のいずれかがある場合にURL生成ループへ入るようにしてください。

Useful? React with 👍 / 👎.

@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: d32cc95629

ℹ️ 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 thread _core/lib/edit.js Outdated

compressedImageFile = null;
compressScale = 1;
switchImageLayoutConfig(imageNo);

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 単一画像フォームでは複数画像切替を避けてください

この共通関数は、GC国・MSクラン・SW2神格など旧来の単一画像フォーム(例: _core/lib/gc/edit-country.pl:449, _core/lib/ms/edit-clan.pl:139, _core/lib/sw2/edit-arts.pl:183)からも imagePreView(this.files[0], ...) で呼ばれますが、それらのフォームには editingImageFitimageFit 系 hidden がありません。ファイル選択時にここから switchImageLayoutConfig()saveCurrentImageLayout() が走ると form.imageFit が undefined で TypeError になり、プレビューもアップロード設定もできません。複数画像フォームでない場合は従来の単一画像プレビュー経路に分岐してください。

Useful? React with 👍 / 👎.

Comment on lines +921 to +924
> :is(.image, .image-none) {
position: absolute;
z-index: 2;
inset: 0;

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 画像ラッパーに高さを持たせてください

ここで .image / .image-none を絶対配置にしたため、親の #image には内容高さが残りません。特にMSクラン表示では _core/skin/ms/css/clan.css#area-statusalign-items: start で、縦横比も .image, .image-none 側にしかないため、画像枠が高さ0になって画像または no image 表示が消えます。#image 側にも aspect-ratio や高さを移すなど、親が高さを持つようにしてください。

Useful? React with 👍 / 👎.

@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: 958103b095

ℹ️ 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 thread _core/lib/edit.js Outdated

compressedImageFile = null;
compressScale = 1;
if(form.editingImageFit){ switchImageLayoutConfig(); }

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 画像切替時に対象番号を渡してください

複数画像フォームで画像ファイルを選択またはドロップすると、この呼び出しが引数なしで switchImageLayoutConfig() を実行するため、内部で editingImageNoNaN になり、loadImageLayout()form.imageFitNaN.value を参照して TypeError になります。その結果、画像1を含む通常のファイル選択経路でもプレビューや圧縮処理まで進めず、今回追加したキャラクター画像のアップロードができません。

Useful? React with 👍 / 👎.

Comment thread _core/skin/_common/sheet-head.html Outdated
document.addEventListener('DOMContentLoaded', () => {
if(document.getElementById('image')){
document.getElementById('image').style.backgroundImage = `url(${images['1']})`;
document.getElementById('image').style.backgroundImage = `url(${images['<TMPL_VAR mainImage DEFAULT=1>']})`;

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 ダウンロード時は実際の画像要素へ反映してください

mode=download では images[...] に埋め込んだ base64 をここで反映していますが、今回テンプレート側の表示対象は #image ではなくその子の .image.current になり、背景サイズや位置も子要素に付いています。ダウンロードHTMLを開くと子要素には依然 ./?id=...&mode=image のURLが残るため自己完結せず、親に設定したbase64もトリミング設定を持たないまま背面に出るだけになります。base64は .image.current 側へ設定する必要があります。

Useful? React with 👍 / 👎.

@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: 32de8ca3b9

ℹ️ 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 thread _core/lib/save.pl
if($oldext{$imageNo} && $oldext{$imageNo} ne $pc{$imageKey}){
deleteSheetFile("${dataDir}${userDir}", $file, "image$suffix.$oldext{$imageNo}"); # 前のファイルを削除
}
updateSheetFile("${dataDir}${userDir}", $file, "image$suffix.$pc{$imageKey}", $imageData{$imageNo});

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 画像削除で番号付き画像も消してください

この変更で image2.* / image3.* も保存されるようになりましたが、管理者用の画像削除フローは _core/lib/delete.pl:85-106 で従来の image.$ext しか削除・差し替えしていません。複数画像を登録したシートに対して「画像削除」を実行しても、mode=image&imageNo=2 などから番号付き画像が残って表示できるため、削除依頼や不適切画像対応が完了しません。

Useful? React with 👍 / 👎.

Comment thread _core/skin/_common/sheet-head.html Outdated
if(document.getElementById('image')){
document.getElementById('image').style.backgroundImage = `url(${images['1']})`;
if(document.querySelectorAll('#image .image.current')){
document.querySelectorAll('#image .image.current').style.backgroundImage = `url(${images['<TMPL_VAR mainImage DEFAULT=1>']})`;

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 ダウンロードHTMLでは単一要素を更新してください

querySelectorAll() は常に NodeList を返し、NodeList には style がないため、ダウンロードHTMLを開くとこの行で TypeError になります。その結果、modeDownload 用に用意した images[...] の base64 が .image.current へ反映されず、HTML単体保存したシートが元の ./?id=...&mode=image URLを参照したままになります。querySelector() を使うか、NodeList をループして更新してください。

Useful? React with 👍 / 👎.

@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: 0ee98d2fb0

ℹ️ 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 thread _core/lib/view.pl Outdated
$pc{imageURL} = url()."?id=$::in{id}&mode=image&cache=$pc{imageUpdate}";
$pc{imageOgpURL} = url()."?id=$::in{id}&mode=ogp-image&cache=$pc{imageUpdate}";
$pc{mainImage} ||= 1;
if($pc{ver}) {

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 ver=0 のコンバート画像も images に入れてください

BLP/DX3 のキャラクターシート倉庫変換などは convert.plimageURL/image を設定しつつ ver は 0 のままなので、この条件を通らず下の convertSource 分岐で imageSrc だけが設定されます。今回テンプレート側のクリック処理は popImage(<TMPL_VAR mainImage>) から images[id] を参照するため、画面上の画像は表示されても拡大表示では undefined を開いてしまいます。ver == 0 の外部コンバート画像でも images(必要なら imageLayouts)を初期化してください。

Useful? React with 👍 / 👎.

@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: bcef9ff3d3

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


> :is(.prev-button, .next-button) {
display: none;
#image:hover & { display: block; }

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 カルーセルボタンをホバー時に表示してください

この入れ子では & が親セレクタ全体(#image > :is(.prev-button, .next-button))に展開されるため、実際のセレクタは #image:hover #image > ... 相当になり、同じ #image の中にさらに #image がある場合しか一致しません。複数画像の閲覧画面では前後ボタンが display: none のまま表示されず、追加した画像切替 UI をクリックできません。

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

入れ子セレクタ & の解釈が間違っています。
この場合、#image:hover #image > ... ではなく、 :is(#image:hover ...):is(#image > ...) と相当となるため、 #image に対するhover時に想定通りdisplay:block が有効となります。
よって、修正は不要です。

参考
https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Nesting/Using#appended_nesting_selector

@yutorize

Copy link
Copy Markdown
Owner Author

@codex 再レビューをお願いします。

@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: bcef9ff3d3

ℹ️ 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 thread _core/lib/edit.js Outdated
}

// 現在フォームに入っているレイアウト設定をプレビューへ反映
imagePosition();

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 旧形式の画像フォームではプレビュー処理を分岐してください

ms/edit-clan.pl、gc/edit-country.pl、sw2/edit-arts.pl の画像欄はまだ editingImageFit などを持たない旧形式のまま imagePreView() を呼ぶため、ここで常に imagePosition() に入ると form.editingImageFit 参照で例外になります。特に上限超過画像ではファイル入力を空にした後、compressedImageFiles へ代替ファイルを入れる前に例外で止まるため、圧縮後画像が送信されずアップロードできません。

Useful? React with 👍 / 👎.

Comment thread _core/lib/json.pl Outdated
Comment on lines +47 to +49
foreach my $n (1 .. ($set::image_maxcount || 1)){
my $suffix = $n == 1 ? '' : $n;
$pc{"imageURL$suffix"} = url().qq|?id=$id&mode=image&imageNo=$n&cache=$pc{"imageUpdate$suffix"}| if $pc{"image$suffix"};

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 JSONにはメイン画像の imageURL も維持してください

メイン画像を2枚目以降にして1枚目が空のシートでは、このループは imageURL2/imageURL3 だけを出力し、従来の imageURL を返しません。既存の mode=json 利用者は単一画像時代の imageURL を読んでいるため、複数画像化後にメイン画像を1以外へ移したシートの画像URLを取得できなくなります。ループ後に mainImage のURLを imageURL にも入れるなど互換性を保ってください。

Useful? React with 👍 / 👎.

@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: ba4f9c827d

ℹ️ 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 thread _core/lib/json.pl Outdated
$pc{"imageURL$suffix"} = url().qq|?id=$id&mode=image&imageNo=$n&cache=$pc{"imageUpdate$suffix"}| if $pc{"image$suffix"};
}
if(!$pc{image} && $pc{mainImage} > 1){
$pc{image} = $pc{"image$pc{mainImage}"}

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 JSONモジュールをコンパイルできるようにしてください

この代入の末尾にセミコロンがないため、_core/lib/json.pl が Perl の構文エラーで読み込めません。mode=json の全リクエストがレスポンス生成前に失敗し、外部連携・JSONエクスポート・編集画面の最新データ取得など JSON 経路全体が使えなくなります。

Useful? React with 👍 / 👎.

@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: efa969665a

ℹ️ 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 thread _core/lib/edit.pl Outdated
my $mainSuffix = $::pc{mainImage} == 1 ? '' : $::pc{mainImage};
my %imageURLs;
my $imageURLsJS;
foreach my $n (1 .. $set::image_maxcount){

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 image_maxcount 未設定時も URL を初期化してください

既存環境の設定ファイルに新設の image_maxcount がまだ無い、または 0 の場合、このループだけが他の箇所と違って || 1 のフォールバックを使わないため %imageURLs / savedImageURLs が空になります。一方で直下の hidden/radio/サムネイル生成は ($set::image_maxcount || 1) で 1 枚分を描画し、各 edit-chara.js のロード時 setImagePosition()setPreviewImage(1) を呼ぶので、保存済み画像の背景が空文字で上書きされ、編集画面で既存画像を確認・調整できなくなります。ここも他と同じフォールバックを使ってください。

Useful? React with 👍 / 👎.

@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: 560143ad97

ℹ️ 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 thread _core/lib/edit.js
}

// 画像配置 ----------------------------------------
let imgURL = '';

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 imgURL を二重宣言しないでください

キャラクター編集画面では renderImageForm 側のインラインスクリプトも let imgURL = ... を出力しているため、この共通スクリプトで同じトップレベル let を宣言するとブラウザが Identifier 'imgURL' has already been declared の構文エラーにします。edit.js は defer で後から評価されるので、画像フォームを持つ通常のキャラクター編集画面で formSubmit など共通処理全体が定義されず、保存ボタンや画像プレビューが動かなくなります。

Useful? React with 👍 / 👎.

@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: 90da2951d3

ℹ️ 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 thread _core/lib/delete.pl
Comment on lines +60 to +62
if (my $deletedImages = deleteSheetImages($sheetBaseDir, $file)) {
$message .= "画像を${deletedImages}件削除しました。<br>";
}

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 削除バックアップの前に画像を消さないでください

この呼び出しは $set::del_back の判定より前に実行されるため、デフォルト設定(config-default.pldel_back=0)のように削除シートを deleted/ へバックアップする運用でも、移動前の zip/ディレクトリから画像だけが先に削除されます。画像付きシートを通常削除すると、削除バックアップから復元しても画像が欠落するデータ損失になるので、完全削除時だけ消すか、バックアップ移動後に処理してください。

Useful? React with 👍 / 👎.

@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: a198495800

ℹ️ 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 thread _core/lib/save.pl Outdated
Comment on lines +183 to +184
$pc{mainImage} = 1 if !$pc{mainImage} || $pc{mainImage} !~ /^[0-9]+$/ || $pc{mainImage} > $imageMaxCount;
if(!$pc{'image'.($pc{mainImage} == 1 ? '' : $pc{mainImage})}){

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 一覧用の画像フラグもメイン画像で更新してください

画像1が空で画像2/3だけを登録して保存する場合、この補正で mainImage は番号付き画像へ切り替わりますが、一覧ファイル用の $::newline はその前の %pc = data_calc(\%pc) で各 calc 側の $pc{image} だけを見て作られたままです。そのため閲覧画面では画像が出るシートでも listfile の画像列が空になり、各一覧の「画像あり」フィルタから除外されます。補正後に一覧行を再生成するか、calc 側で番号付き画像を画像ありとして扱う必要があります。

Useful? React with 👍 / 👎.

@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: 00f2a699e7

ℹ️ 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 thread _core/lib/edit.pl
join '', map {
my $n = $_;
my $suffix = ($n == 1) ? '' : $n;
input("image$suffix",'hidden')

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 imageUpdateもhiddenで保持してください

ここでは既存画像の拡張子だけを送信していますが、save.pl はリクエストの %pc をそのまま保存し、imageUpdateN は新規アップロードを受理した時だけ再設定します。そのため画像を変更せずに通常保存しただけで既存の imageUpdate / imageUpdate2 / imageUpdate3data.cgi から消え、以後の閲覧・JSON・OGP・編集プレビューのキャッシュキーが空になって画像更新時刻を維持できません。各画像の imageUpdate$suffix も hidden で送るか、保存側で旧値を引き継いでください。

Useful? React with 👍 / 👎.

@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: 6b98a3e8ad

ℹ️ 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 thread _core/lib/delete.pl
binmode $BEHEADED;
my $image = do { local $/; <$BEHEADED> };
close($BEHEADED);
updateSheetFile($sheetBaseDir, $file, "image.$ext", $image);

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 差し替え画像を参照される番号に保存してください

mainImage が 2/3 のシートで管理者の画像削除を実行し、$set::beheaded が有効な場合、この行は全画像を削除したあと差し替え画像を常に image.*(画像1)へだけ保存します。一方 data.cgimainImageimage2/image3 は更新されないため、閲覧画面や mode=image&imageNo=2 は削除済みの画像2/3を参照し続け、差し替え画像が表示されず 404 になります。

Useful? React with 👍 / 👎.

@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: effe16b5b0

ℹ️ 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 thread _core/lib/subroutine.pl Outdated
$pc{imagePositionY} = $pc{"imagePositionY$mainSuffix"};
$pc{imageCopyright} = $pc{"imageCopyright$mainSuffix"};

my $imgName = qq|image$mainSuffix.$pc{"image$mainSuffix"}|;

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 パートナー用の画像拡張子もメイン画像に合わせてください

この版では $imgName でメイン画像2/3の実体を読むようになっていますが、$pc{image} 自体は無印(画像1)の拡張子のままです。BLP/KIZ のパートナー自動取得で相手のメイン画像が2/3かつ画像1と拡張子が違う、または画像1が空の場合、partnerImageToBase64()pN_imageData に入ったメイン画像のバイナリを古い/空の pN_image MIME として data URI 化するため、ダウンロードHTML上のパートナー画像が壊れる可能性があります。

Useful? React with 👍 / 👎.

@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: 309d70999a

ℹ️ 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 thread _core/lib/view.pl Outdated
$pc->{"p${num}_imagePercent"} = $pc->{"p${num}_imagePercent$suffix"};
$pc->{"p${num}_imagePositionX"} = $pc->{"p${num}_imagePositionX$suffix"};
$pc->{"p${num}_imagePositionY"} = $pc->{"p${num}_imagePositionY$suffix"};
$pc->{"p${num}_imageCopyright"} = $pc->{"p${num}_imageCopyright$suffix"};

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 パートナーのセリフもメイン画像からコピーしてください

この補正ブロックは画像2/3を無印の pN_image* に写していますが、BLP/KIZ のパートナー表示テンプレートはセリフに p1_words / p1_wordsX / p1_wordsY を使います。相手が画像1なしで画像2をメインにし、その画像2にセリフを設定している場合、画像本体と配置だけが画像2に切り替わり、セリフは空または画像1側のままになるため、words$suffix 系も同じタイミングで無印キーへコピーする必要があります。

Useful? React with 👍 / 👎.

@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: fcdaa6bb9e

ℹ️ 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 thread _core/lib/edit.js Outdated
if(saving){ return; }
if(!formCheck()){ return false; }

if(imageType === 'character'){ saveCurrentImageLayout(); }

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 imageType 未定義の編集画面を保存できるようにしてください

SW2 の魔物・アイテム編集画面は renderEditPageStart でこの共通 edit.js を読み込みますが、画像フォームを出さないため const imageType を定義しません(_core/lib/sw2/edit-mons.pl / edit-item.pl を確認)。その状態で保存ボタンや Ctrl+S を押すとここで ReferenceError: imageType is not defined が発生し、FormData 送信に進めないため、これらのシートが保存不能になります。typeof imageType !== 'undefined' でガードするなど、画像欄のない編集画面を許容してください。

Useful? React with 👍 / 👎.

@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: c9165ec7eb

ℹ️ 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 thread _core/lib/json.pl Outdated
my $suffix = imageSuffix($n);
$pc{"imageURL$suffix"} = url().qq|?id=$id&mode=image&imageNo=$n&cache=$pc{"imageUpdate$suffix"}| if $pc{"image$suffix"};
}
if(!$pc{image} && $pc{mainImage} > 1){

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 JSON の imageURL を常にメイン画像へ合わせてください

メイン画像を 2/3 にしていても画像1が残っているシートでは、この条件に入らないため、直前のループで作られた imageURL は画像1のままになります。閲覧画面は mainImage を見て画像2/3を表示する一方、既存の mode=json 利用者が従来キーの imageURL / image を読むとメイン画像ではない画像1を取得してしまうので、画像1の有無に関係なく mainImage 側を従来キーへ反映してください。

Useful? React with 👍 / 👎.

@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: eed39ae139

ℹ️ 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 thread _core/lib/json.pl Outdated
}
if($pc{mainImage} > 1){ # 複数画像未対応verへの対応
my $suffix = imageSuffix($pc{mainImage});
foreach my $key (qw/image imageURL imageFit imagePercent imagePositionX imagePositionY imageCopyright imageCopyrightURL words wordsX wordsY/){

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 imageUpdate もメイン画像側へ入れ替えてください

mainImage が 2/3 の JSON 出力では、この互換用の入れ替えで image / imageURL はメイン画像側になりますが、imageUpdate は画像1の値のまま残ります。画像1を更新せず画像2/3だけ差し替えたシートでは、従来キーの imageimageUpdate が別画像を指す不整合になり、JSON 利用側が imageUpdate でキャッシュ判定や URL 組み立てをしている場合にメイン画像の更新を検知できません。

Useful? React with 👍 / 👎.

@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: 8a04c8303b

ℹ️ 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 thread _core/lib/edit.js
Comment on lines +688 to +689
editingImageNo = Number(form.mainImage?.value || 1);
loadImageLayout(editingImageNo);

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 メイン画像切替前に現在のレイアウトを保存してください

画像設定画面で画像1のトリミングやセリフを調整したあと、上部の「メイン画像」ラジオで画像2/3を選ぶと、この関数が editingImageNo を先に上書きして loadImageLayout() するため、直前に編集していた画像の値が hidden の imageFit / words などへ退避されず破棄されます。サムネイル切替側は switchImageLayoutConfig() で保存しているので、ラジオ切替でも同様に現在のレイアウトを保存してから読み替えないと、そのまま保存したとき直前の画像設定だけ失われます。

Useful? React with 👍 / 👎.

@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: 688914b8b3

ℹ️ 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 thread _core/lib/json.pl Outdated
foreach my $key (qw/image imageUpdate imageURL imageFit imagePercent imagePositionX imagePositionY imageCopyright imageCopyrightURL words wordsX wordsY/){
($pc{$key}, $pc{"$key$suffix"}) = ($pc{"$key$suffix"}, $pc{$key});
}
$pc{mainImage} = 1;

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 JSONで mainImage を書き換えないでください

mode=json で画像2/3をメインにしているシートを出力すると、この互換処理で image 系キーを入れ替えたうえで mainImage を常に 1 にしてしまうため、複数画像対応の利用者やJSON再取り込み側は元のメイン画像番号を復元できません。特に画像1と画像2の両方がある場合、imageURL2 も実際には画像1を指す状態になり、JSON上の番号と mode=image&imageNo=N の実体がずれます。従来キーへメイン画像をコピーする場合でも、mainImage は実際の選択番号のまま残してください。

Useful? React with 👍 / 👎.

@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: 1bcee39cec

ℹ️ 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 thread _core/lib/edit.js Outdated
imagePosition();

// 著作権表示・セリフ表示も更新
wordsPreView();

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 セリフプレビュー更新をキャラクター画像だけに限定してください

GC国・MSクラン・SW2神格の単一画像フォームは imageType = 'symbol' で、editingWordswords-preview を持たないことを確認しました。この行は setPreviewImage() から常に呼ばれるため、画像選択時に form.editingWords.value で TypeError になります。特に上限超過画像では直前に imageFile を空にしてから、圧縮結果を compressedImageFiles に入れる前に止まるので、圧縮後画像を保存できません。imageType === 'character' の場合だけ呼ぶようにしてください。

Useful? React with 👍 / 👎.

@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: 1f040a4557

ℹ️ 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 thread _core/lib/json.pl Outdated
Comment on lines +54 to +55
foreach my $key (qw/image imageUpdate imageURL imageFit imagePercent imagePositionX imagePositionY imageCopyright imageCopyrightURL words wordsX wordsY/){
($pc{$key}, $pc{"$key$suffix"}) = ($pc{"$key$suffix"}, $pc{$key});

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 JSON互換キーは入れ替えずコピーしてください

画像1が空で画像2/3をメインにしているシートでは、この互換処理が image2 / imageURL2 などを従来キーへコピーせず swap しているため、出力後の JSON では mainImage が 2 のままなのに image2 側が空になります。以前の mainImage 書き換えは消えていますが、今回の版でもこの代入が swap のまま残っているのが新しい根拠で、複数画像対応の JSON 利用者や別ゆとシート経由のパートナー取り込みが mainImage の番号をたどると画像を見失います。

Useful? React with 👍 / 👎.

@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: a4589291c7

ℹ️ 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 thread _core/skin/_common/js/sheet.js Outdated
function getImageId(direction = 0) {
const ids =
Object.keys(images)
.filter(key => /[0-9]/.test(key))

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 カルーセル対象を数字キーだけに絞ってください

BLP/KIZ のようにパートナー画像があるシートでは、imagesp1/p2 も追加されますが、この条件だとそれらも通過して Number('p1')NaN になります。画像2枚以上のキャラクターでパートナーも表示している場合、最後の画像から「次」または先頭から「前」を押すと選択先が NaN になって images.hasOwnProperty(selected) が失敗し、端でカルーセルが回らなくなります。imageLayouts のキー、または /^\d+$/ のような純粋な番号だけを対象にしてください。

Useful? React with 👍 / 👎.

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