fix(view): alert [보기] highlights the bar it is about (시안 ③, spec §6.1)
[보기] only switched the member tab. The alert now names its bar (RB-F08 → B2), and [보기] switches to the member, highlights that row, and scrolls to it. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
140d34a844
commit
488b65af31
3 files changed
+11
-1
No files matched your search
@@ -74,6 +74,8 @@ const state = {
|
||||
stage: 'shape' as 'shape' | 'plan' | 'rebar',
|
||||
/** ③ 공통 설정 (fck · fy). */
|
||||
material: { ...DEFAULT_MATERIAL } as Material,
|
||||
/** Bar highlighted on ③ after [보기] (시안 ③ 알림). */
|
||||
rebarFocus: null as string | null,
|
||||
/** Member tab on ③ (철근표). */
|
||||
rebarMember: 'coping' as RebarRow['member'],
|
||||
/** Member card selected on ② (시안 ② 부재 목록). */
|
||||
@@ -737,6 +739,7 @@ function renderRebar(): void {
|
||||
nameCell.classList.add('bar-no');
|
||||
// Clicking a 번호 highlights that row (시안: 번호를 누르면 그 철근만 강조).
|
||||
nameCell.addEventListener('click', () => tr.classList.toggle('hl'));
|
||||
if (r.name === state.rebarFocus) tr.classList.add('hl');
|
||||
tr.append(
|
||||
el('td', ROLE[r.name] ?? '—'),
|
||||
nameCell,
|
||||
@@ -766,7 +769,9 @@ function renderRebar(): void {
|
||||
$<HTMLInputElement>('mat-fck').focus();
|
||||
$<HTMLInputElement>('mat-fck').scrollIntoView({ block: 'center' });
|
||||
} else {
|
||||
// [보기]: go to the member and highlight the bar the alert is about.
|
||||
state.rebarMember = w.target;
|
||||
state.rebarFocus = w.bar ?? null;
|
||||
renderAll();
|
||||
}
|
||||
});
|
||||
@@ -783,6 +788,8 @@ function renderRebar(): void {
|
||||
}
|
||||
$('step3-status').textContent = `계산됨 · 경고 ${warnings.length}`;
|
||||
renderMaterial();
|
||||
const focused = box.querySelector('tr.hl');
|
||||
if (focused && state.rebarFocus) focused.scrollIntoView({ block: 'center' });
|
||||
}
|
||||
|
||||
/** 구분 (role) of each bar, as in the 시안 ③ table. */
|
||||
|
||||
Reference in new issue
Block a user