Skip to content

Commit 02d53cb

Browse files
fix: address Copilot review feedback
- Fix tabNames mapping in overview mode (was logging 'code' instead of 'specification') - Remove redundant onClick handlers from Tab components (handleTabChange handles toggle) - Document regex limitation in strip_noqa_comments docstring 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 785a644 commit 02d53cb

File tree

2 files changed

+14
-21
lines changed

2 files changed

+14
-21
lines changed

app/src/components/SpecTabs.tsx

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,10 @@ export function SpecTabs({
178178
onTrackEvent?.('tab_collapse', { library: libraryId });
179179
} else {
180180
setTabIndex(newValue);
181-
const tabNames = ['code', 'specification', 'implementation', 'quality'];
181+
// In overview mode, only Spec tab exists at index 0
182+
const tabNames = overviewMode
183+
? ['specification']
184+
: ['code', 'specification', 'implementation', 'quality'];
182185
onTrackEvent?.('tab_click', { tab: tabNames[newValue], library: libraryId });
183186
}
184187
};
@@ -242,33 +245,17 @@ export function SpecTabs({
242245
}}
243246
>
244247
{!overviewMode && (
245-
<Tab
246-
icon={<CodeIcon sx={{ fontSize: '1.1rem' }} />}
247-
iconPosition="start"
248-
label="Code"
249-
onClick={() => tabIndex === 0 && setTabIndex(null)}
250-
/>
248+
<Tab icon={<CodeIcon sx={{ fontSize: '1.1rem' }} />} iconPosition="start" label="Code" />
251249
)}
252-
<Tab
253-
icon={<DescriptionIcon sx={{ fontSize: '1.1rem' }} />}
254-
iconPosition="start"
255-
label="Spec"
256-
onClick={() => tabIndex === specTabIndex && setTabIndex(null)}
257-
/>
250+
<Tab icon={<DescriptionIcon sx={{ fontSize: '1.1rem' }} />} iconPosition="start" label="Spec" />
258251
{!overviewMode && (
259-
<Tab
260-
icon={<ImageIcon sx={{ fontSize: '1.1rem' }} />}
261-
iconPosition="start"
262-
label="Impl"
263-
onClick={() => tabIndex === 2 && setTabIndex(null)}
264-
/>
252+
<Tab icon={<ImageIcon sx={{ fontSize: '1.1rem' }} />} iconPosition="start" label="Impl" />
265253
)}
266254
{!overviewMode && (
267255
<Tab
268256
icon={<StarIcon sx={{ fontSize: '1.1rem', color: tabIndex === 3 ? '#3776AB' : '#f59e0b' }} />}
269257
iconPosition="start"
270258
label={qualityScore ? `${Math.round(qualityScore)}` : 'Quality'}
271-
onClick={() => tabIndex === 3 && setTabIndex(null)}
272259
/>
273260
)}
274261
</Tabs>

core/utils.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@
44

55

66
def strip_noqa_comments(code: str | None) -> str | None:
7-
"""Remove # noqa: comments from code for cleaner user display."""
7+
"""Remove # noqa: comments from code for cleaner user display.
8+
9+
Note:
10+
Uses regex-based matching, which will also remove noqa patterns inside
11+
string literals. This is acceptable for plot implementation code where
12+
noqa comments in strings are extremely rare.
13+
"""
814
if not code:
915
return code
1016
return re.sub(r"\s*# noqa:[^\n]*", "", code)

0 commit comments

Comments
 (0)