-
Notifications
You must be signed in to change notification settings - Fork 48
Enhance AI inspection features and stabilize snapshot preview #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
8bffc04
feat: add isolated live snapshot preview
kleinlau17 5170506
fix: raise default snapshot dialog height
kleinlau17 b1554df
fix: stabilize snapshot preview capture flow
kleinlau17 75b10ce
feat(ai-assistant): add dual-mode inspection setup
kleinlau17 7eb93a5
fix: keep snapshot dialog open after export
kleinlau17 6b71e28
fix: capture live orbit target for snapshot preview
kleinlau17 32b30ea
feat(ai-assistant): refine inspection setup mode ui
kleinlau17 2d1eb3d
fix: auto-fit snapshot dialog height
kleinlau17 2edf0c2
fix: widen snapshot dialog and show grid by default
kleinlau17 12719d8
fix: left-align snapshot grid toggle
kleinlau17 89eb541
feat(ai-assistant): refine inspection run pointer guidance
kleinlau17 715185b
feat(ai-assistant): polish normal inspection item states
kleinlau17 d6e35fa
feat: sync ai inspection dual mode into dev
kleinlau17 9fd5c00
docs: add ai inspection badge toggle design spec
kleinlau17 7d335ff
feat(ai-assistant): refine inspection setup interactions
kleinlau17 44605a1
Merge branch 'OpenLegged:dev' into dev
kleinlau17 28653b9
Merge branch 'dev' into dev
wyfhbb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
75 changes: 75 additions & 0 deletions
75
.../superpowers/specs/2026-04-14-ai-inspection-professional-badge-toggle-design.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| # AI Inspection Professional Badge Toggle Design | ||
|
|
||
| **Date:** 2026-04-14 | ||
|
|
||
| **Goal** | ||
|
|
||
| Enable the status badge in AI inspection professional mode to toggle the corresponding inspection item selection. Clicking `已纳入` or `未纳入` should behave the same as toggling that item from the left inspection sidebar. | ||
|
|
||
| **Scope** | ||
|
|
||
| - Only change the professional-mode setup view in the AI inspection modal. | ||
| - Only make the per-item status badge clickable. | ||
| - Keep the rest of the card read-only. | ||
| - Preserve existing behavior in normal mode, running state, and report state. | ||
|
|
||
| **Current Behavior** | ||
|
|
||
| - In professional mode, the right-side detail panel shows each inspection item as a card. | ||
| - The badge text reflects selection state with `已纳入` or `未纳入`. | ||
| - The badge is display-only and cannot change selection. | ||
| - Selection changes are currently driven from the left sidebar and the normal-mode setup view. | ||
|
|
||
| **Desired Behavior** | ||
|
|
||
| - In professional mode setup, clicking the status badge toggles the item selection. | ||
| - When the item is selected, clicking `已纳入` removes it from the run. | ||
| - When the item is not selected, clicking `未纳入` includes it in the run. | ||
| - The right card state, left sidebar state, and summary metrics stay synchronized because they continue to share the same `selectedItems` state. | ||
|
|
||
| **Design** | ||
|
|
||
| ## UI structure | ||
|
|
||
| - Replace the badge-only `span` in `InspectionSetupView.tsx` with a semantic `button`. | ||
| - Keep the visual style close to the existing badge so the change is behavioral, not visual redesign. | ||
| - Add a small hover/focus treatment consistent with current token usage. | ||
|
|
||
| ## Data flow | ||
|
|
||
| - `AIInspectionModal.tsx` remains the owner of `selectedItems`. | ||
| - Pass a new `onToggleItem(categoryId, itemId)` callback into `InspectionSetupView`. | ||
| - The callback updates `selectedItems` with the same add/remove semantics already used by the sidebar item toggle. | ||
|
|
||
| ## Interaction rules | ||
|
|
||
| - The badge is clickable only in setup view professional mode. | ||
| - No change to whole-card click behavior. | ||
| - No extra confirmation dialog. | ||
| - No i18n changes are required because the existing labels already match the desired states. | ||
|
|
||
| ## Accessibility | ||
|
|
||
| - Use a real `button` so keyboard users can trigger the change. | ||
| - Keep the visible label as the current included/skipped text. | ||
| - Add an `aria-pressed` state tied to item selection. | ||
|
|
||
| ## Testing | ||
|
|
||
| - Add a test in `AIInspectionModal.test.tsx` that enters professional mode, clicks the right-side status badge, and verifies: | ||
| - the right-side item state toggles from included to skipped or the reverse | ||
| - the selection summary updates | ||
| - the left sidebar selection count remains synchronized | ||
|
|
||
| **Files** | ||
|
|
||
| - Modify `src/features/ai-assistant/components/AIInspectionModal.tsx` | ||
| - Modify `src/features/ai-assistant/components/InspectionSetupView.tsx` | ||
| - Modify `src/features/ai-assistant/components/AIInspectionModal.test.tsx` | ||
|
|
||
| **Out of Scope** | ||
|
|
||
| - Making the entire inspection item card clickable | ||
| - Changing normal-mode selection behavior | ||
| - Refactoring shared selection helpers between the sidebar and setup view | ||
| - Any report-view interaction changes |
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The snapshot dialog no longer closes automatically after a successful capture. This seems like a regression from the previous behavior. Was this intentional? If not, you should call
handleCloseSnapshotDialog()after the capture is complete to restore the old behavior and improve user experience.The
handleCloseSnapshotDialogfunction is already in the dependency array ofhandleCaptureSnapshot, which suggests it was intended to be used here.