Repository navigation
Wiki比較パネルの初期表示不一致を修正 - #827
Open
NishikawaKoharu wants to merge 1 commit into
Open
NishikawaKoharu wants to merge 1 commit into
NishikawaKoharu wants to merge 1 commit into
Conversation
yacchin1205
reviewed
Nov 13, 2026
yacchin1205
left a comment
There was a problem hiding this comment.
コメントさせていただきました。ご確認ください。
.jsのコードはユニットテストがなく、問題が本番で顕在化することが予想されるため、予期しないケースではなんらかの痕跡を残しておくのが良いのかなと感じます。
|
|
||
| function getEditorMarkdown() { | ||
| var content = ''; | ||
| if (mEdit && typeof mEdit.action === 'function') { |
There was a problem hiding this comment.
この関数は、エディタが予期しない状態であったときも、実際に空の内容であった場合も、同様に空文字列を返すため、何かトラブルが起きたときに調査しづらいコードに見えます。if (mEdit && typeof mEdit.action === 'function') { が成立しない場合に、エラーとまではしなくても、consoleにwarning等は出力できると良いかもしれません。ご検討ください。
| if (compareVersion !== 'previous') { | ||
| return String(compareVersion); | ||
| } | ||
| var select = document.getElementById('compareVersionSelect'); |
There was a problem hiding this comment.
previous を指定しても、対応する選択肢を取得できなかった場合は、黙って current に切り替わる点が気になりました。過去版が存在しない場合の扱いと、DOMを取得できない等の想定外の状態を区別し、後者はwarning等で確認できるとよいかもしれません。ご検討ください。
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.
Purpose
Fix a Wiki Compare bug: opening Compare shows "(Current)" in the compare dropdown, but the actual diff is against the previous version. Selecting the previous version does not change the diff; selecting "(Current)" again is required before the comparison matches the label.
Companion frontend PR: RDM-wiki-develop
feature/fix-wiki-compare-default-current.Changes
previoustocurrent(JS andviews.py)previousto the real dropdown value (version number)resolveCompareVersion()on the Milkdown side (client-side safeguard)test_wiki.pyChanged files:
addons/wiki/static/wikiPageMilkdown.jsaddons/wiki/static/wikiPage.jswebsite/static/js/pages/wiki-edit-page.jsaddons/wiki/views.pyaddons/wiki/tests/test_wiki.pyQA Notes
Documentation
Side Effects
Ticket
https://redmine.devops.rcos.nii.ac.jp/issues/63974