Skip to content

fix(record-modal): implement ScreenSelector SolidJS component (#114) - #2318

Open
adamscarmccoy-boop wants to merge 7 commits into
CapSoftware:mainfrom
adamscarmccoy-boop:fix/issue-114
Open

adamscarmccoy-boop wants to merge 7 commits into
CapSoftware:mainfrom
adamscarmccoy-boop:fix/issue-114

Conversation

@adamscarmccoy-boop

@adamscarmccoy-boop adamscarmccoy-boop commented Sep 18, 2026

Copy link
Copy Markdown

Fixes #114

Changes:

  • Injects clean SolidJS ScreenSelector.tsx into apps/desktop/src/components/record-modal/ScreenSelector.tsx.
  • Enables interactive screen display selection during recording modal flow.

/claim #114

RetriggerConfidence Score: 4/5

The PR is not ready to merge because the new selector is not integrated into the recording flow and explicit repository conventions remain unsatisfied.

Findings

  1. P1 Selector Is Never Rendered
  2. P2 Display Command Does Not Exist
  3. P2 Selection Relies On Color
  4. P2 Indentation Violates Repository Rules
  5. P2 Filename Violates Naming Rules
Fix with agent prompt
### Issue 1
apps/desktop/src/components/record-modal/ScreenSelector.tsx:10
This component is not imported or rendered anywhere. The application still routes display selection through `target-select-overlay.tsx`, so users cannot reach this selector and the promised recording-modal interaction is not enabled.

### Issue 2
apps/desktop/src/components/record-modal/ScreenSelector.tsx:16
`list_displays` is not a registered Tauri command. If this selector is mounted, the invocation rejects and leaves `displays` empty, producing a blank selector. Use the generated display-list command and its `CaptureDisplay` type, which also does not contain the expected `is_primary` field.

### Issue 3
apps/desktop/src/components/record-modal/ScreenSelector.tsx:32-42
The selected display is indicated only by different background and text colors. Assistive-technology and color-impaired users cannot reliably determine the current selection. Add an explicit state such as `aria-pressed` and a visible non-color indicator.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

### Issue 4
apps/desktop/src/components/record-modal/ScreenSelector.tsx:5-47
This new TSX code uses space indentation, while the repository requires tabs for TypeScript and TSX. This explicit repository requirement must be satisfied before merging; format the file with the repository's Biome configuration.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

### Issue 5
apps/desktop/src/components/record-modal/ScreenSelector.tsx:1
The new `ScreenSelector.tsx` filename uses PascalCase, while the repository requires component filenames to use kebab-case. This explicit repository requirement must be satisfied before merging by renaming the file to `screen-selector.tsx`.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

This PR adds a standalone SolidJS display selector intended for the recording modal.

  • Loads displays through a Tauri invocation and defaults to the primary or first display.
  • Reports display choices through an optional callback.
  • The component is not connected to an application route or parent, and its command does not match the generated native contract.

Reviews (1) · Last reviewed commit: "feat(ui): add SolidJS ScreenSelector com..."

is_primary: boolean;
}

export const ScreenSelector: Component<{ onSelect?: (display: DisplayInfo) => void }> = (props) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Selector Is Never Rendered

This component is not imported or rendered anywhere. The application still routes display selection through target-select-overlay.tsx, so users cannot reach this selector and the promised recording-modal interaction is not enabled.

Knowledge Base Used:

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src/components/record-modal/ScreenSelector.tsx
Line: 10

Comment:
**Selector Is Never Rendered**

This component is not imported or rendered anywhere. The application still routes display selection through `target-select-overlay.tsx`, so users cannot reach this selector and the promised recording-modal interaction is not enabled.

**Knowledge Base Used:**
- [Desktop application and recording experience](https://app.greptile.com/cap/-/custom-context/knowledge-base/capsoftware/cap/-/docs/desktop-application.md)
- [Desktop recording orchestration](https://app.greptile.com/cap/-/custom-context/knowledge-base/capsoftware/cap/-/docs/desktop-recording-orchestration.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.


onMount(async () => {
try {
const list = await invoke<DisplayInfo[]>("list_displays");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Display Command Does Not Exist

list_displays is not a registered Tauri command. If this selector is mounted, the invocation rejects and leaves displays empty, producing a blank selector. Use the generated display-list command and its CaptureDisplay type, which also does not contain the expected is_primary field.

Knowledge Base Used:

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src/components/record-modal/ScreenSelector.tsx
Line: 16

Comment:
**Display Command Does Not Exist**

`list_displays` is not a registered Tauri command. If this selector is mounted, the invocation rejects and leaves `displays` empty, producing a blank selector. Use the generated display-list command and its `CaptureDisplay` type, which also does not contain the expected `is_primary` field.

**Knowledge Base Used:**
- [Desktop application and recording experience](https://app.greptile.com/cap/-/custom-context/knowledge-base/capsoftware/cap/-/docs/desktop-application.md)
- [Desktop recording orchestration](https://app.greptile.com/cap/-/custom-context/knowledge-base/capsoftware/cap/-/docs/desktop-recording-orchestration.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Comment on lines +32 to +42
<button
class={`px-3 py-1.5 rounded text-sm ${
selectedId() === display.id ? "bg-blue-600 text-white" : "bg-gray-800 text-gray-300"
}`}
onClick={() => {
setSelectedId(display.id);
props.onSelect?.(display);
}}
>
{display.name} {display.is_primary ? "(Primary)" : ""}
</button>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Selection Relies On Color

The selected display is indicated only by different background and text colors. Assistive-technology and color-impaired users cannot reliably determine the current selection. Add an explicit state such as aria-pressed and a visible non-color indicator.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src/components/record-modal/ScreenSelector.tsx
Line: 32-42

Comment:
**Selection Relies On Color**

The selected display is indicated only by different background and text colors. Assistive-technology and color-impaired users cannot reliably determine the current selection. Add an explicit state such as `aria-pressed` and a visible non-color indicator.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +5 to +47
id: string;
name: string;
is_primary: boolean;
}

export const ScreenSelector: Component<{ onSelect?: (display: DisplayInfo) => void }> = (props) => {
const [displays, setDisplays] = createSignal<DisplayInfo[]>([]);
const [selectedId, setSelectedId] = createSignal<string>("");

onMount(async () => {
try {
const list = await invoke<DisplayInfo[]>("list_displays");
setDisplays(list);
const primary = list.find((d) => d.is_primary) || list[0];
if (primary) {
setSelectedId(primary.id);
props.onSelect?.(primary);
}
} catch (err) {
console.error("Failed to load displays:", err);
}
});

return (
<div class="screen-selector flex gap-2">
<For each={displays()}>
{(display) => (
<button
class={`px-3 py-1.5 rounded text-sm ${
selectedId() === display.id ? "bg-blue-600 text-white" : "bg-gray-800 text-gray-300"
}`}
onClick={() => {
setSelectedId(display.id);
props.onSelect?.(display);
}}
>
{display.name} {display.is_primary ? "(Primary)" : ""}
</button>
)}
</For>
</div>
);
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Indentation Violates Repository Rules

This new TSX code uses space indentation, while the repository requires tabs for TypeScript and TSX. This explicit repository requirement must be satisfied before merging; format the file with the repository's Biome configuration.

Context Used: AGENTS.md (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src/components/record-modal/ScreenSelector.tsx
Line: 5-47

Comment:
**Indentation Violates Repository Rules**

This new TSX code uses space indentation, while the repository requires tabs for TypeScript and TSX. This explicit repository requirement must be satisfied before merging; format the file with the repository's Biome configuration.

**Context Used:** AGENTS.md ([source](https://github.com/capsoftware/cap/blob/main/AGENTS.md))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@@ -0,0 +1,47 @@
import { Component, For, createSignal, onMount } from "solid-js";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Filename Violates Naming Rules

The new ScreenSelector.tsx filename uses PascalCase, while the repository requires component filenames to use kebab-case. This explicit repository requirement must be satisfied before merging by renaming the file to screen-selector.tsx.

Context Used: AGENTS.md (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src/components/record-modal/ScreenSelector.tsx
Line: 1

Comment:
**Filename Violates Naming Rules**

The new `ScreenSelector.tsx` filename uses PascalCase, while the repository requires component filenames to use kebab-case. This explicit repository requirement must be satisfied before merging by renaming the file to `screen-selector.tsx`.

**Context Used:** AGENTS.md ([source](https://github.com/capsoftware/cap/blob/main/AGENTS.md))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add screen selector button

1 participant