|
2664 | 2664 | </div> |
2665 | 2665 | <div class="md-form-row md-form-row--nowrap"> |
2666 | 2666 | <div class="md-input-wrap md-input-wrap--inline"> |
2667 | | - <lht-text-field-help field-id="workBranch" label="作業ブランチ" required placeholder="例: tiga0129a" field-class="md-outlined-field" help-text="これから作業するブランチ名です。未作成なら作成先として使います。生成コマンドにそのまま反映されます。"></lht-text-field-help> |
| 2667 | + <lht-text-field-help field-id="workBranch" label="作業ブランチ" required placeholder="例: devel-tiga0129a" field-class="md-outlined-field" help-text="これから作業するブランチ名です。未作成なら作成先として使います。生成コマンドにそのまま反映されます。"></lht-text-field-help> |
2668 | 2668 | <button type="button" class="md-icon-btn md-icon-btn--prominent md-input-action--inline" onclick="updateWorkBranchWithCurrentTime()" title="現在日時で更新" aria-label="現在日時で作業ブランチを更新"> |
2669 | 2669 | <svg viewBox="0 0 24 24" class="md-icon-small" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> |
2670 | 2670 | <use href="#md-icon-refresh" xlink:href="#md-icon-refresh"></use> |
@@ -5045,6 +5045,18 @@ <h3 class="md-diff-dialog__title">PR整形の差分</h3> |
5045 | 5045 | return s1 + s2 + s3; |
5046 | 5046 | } |
5047 | 5047 |
|
| 5048 | + function buildTimedWorkBranchName(date = new Date()) { |
| 5049 | + const baseBranch = document.getElementById("squashBaseBranch")?.value.trim() || ""; |
| 5050 | + const pad = (num) => String(num).padStart(2, "0"); |
| 5051 | + const mm = pad(date.getMonth() + 1); |
| 5052 | + const dd = pad(date.getDate()); |
| 5053 | + const hh = date.getHours(); |
| 5054 | + const min = date.getMinutes(); |
| 5055 | + const timeStr = convertTimeToThreeChars(hh, min); |
| 5056 | + const suffix = `tiga${mm}${dd}${timeStr}`; |
| 5057 | + return baseBranch ? `${baseBranch}-${suffix}` : suffix; |
| 5058 | + } |
| 5059 | + |
5048 | 5060 | function getUseCurrentBranchSelected() { |
5049 | 5061 | const useCurrentBranch = document.getElementById("useCurrentBranch"); |
5050 | 5062 | if (!useCurrentBranch) return true; |
@@ -5191,28 +5203,14 @@ <h3 class="md-diff-dialog__title">PR整形の差分</h3> |
5191 | 5203 | function setDefaultWorkBranch() { |
5192 | 5204 | const input = document.getElementById("workBranch"); |
5193 | 5205 | if (!input || input.value.trim()) return; |
5194 | | - const now = new Date(); |
5195 | | - const pad = (num) => String(num).padStart(2, "0"); |
5196 | | - const mm = pad(now.getMonth() + 1); |
5197 | | - const dd = pad(now.getDate()); |
5198 | | - const hh = now.getHours(); |
5199 | | - const min = now.getMinutes(); |
5200 | | - const timeStr = convertTimeToThreeChars(hh, min); |
5201 | | - input.value = `tiga${mm}${dd}${timeStr}`; |
| 5206 | + input.value = buildTimedWorkBranchName(); |
5202 | 5207 | regenerateAllCommands(); |
5203 | 5208 | } |
5204 | 5209 |
|
5205 | 5210 | function updateWorkBranchWithCurrentTime() { |
5206 | 5211 | const input = document.getElementById("workBranch"); |
5207 | 5212 | if (!input) return; |
5208 | | - const now = new Date(); |
5209 | | - const pad = (num) => String(num).padStart(2, "0"); |
5210 | | - const mm = pad(now.getMonth() + 1); |
5211 | | - const dd = pad(now.getDate()); |
5212 | | - const hh = now.getHours(); |
5213 | | - const min = now.getMinutes(); |
5214 | | - const timeStr = convertTimeToThreeChars(hh, min); |
5215 | | - input.value = `tiga${mm}${dd}${timeStr}`; |
| 5213 | + input.value = buildTimedWorkBranchName(); |
5216 | 5214 | regenerateAllCommands(); |
5217 | 5215 | const saved = upsertWorkBranchListEntry({ |
5218 | 5216 | requireRepoUrl: false, |
|
0 commit comments