feat: display configured keyboard shortcuts inside tray menubar dropdown menu (#1854) - #2091
Conversation
…ack endpoints and add contract test (CapSoftware#2039)
|
🚨 Contributor flagged. Click here for more info: Superagent Dashboard |
| return Response.json({ error: "Unauthorized" }, { status: 401 }); | ||
| } | ||
|
|
There was a problem hiding this comment.
Password gate bypassed for metadata
When an unauthenticated caller supplies the ID of a public, password-protected video, this check grants access based only on video.public, exposing its AI title, summary, chapters, and generation status without the configured password. How this was verified: The successful GET path contains no password-cookie or shared video-policy check before returning the metadata.
Knowledge Base Used: Web App (apps/web)
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/web/app/api/video/metadata/route.ts
Line: 61-63
Comment:
**Password gate bypassed for metadata**
When an unauthenticated caller supplies the ID of a public, password-protected video, this check grants access based only on `video.public`, exposing its AI title, summary, chapters, and generation status without the configured password. **How this was verified:** The successful GET path contains no password-cookie or shared video-policy check before returning the metadata.
**Knowledge Base Used:** [Web App (apps/web)](https://app.greptile.com/cap/-/custom-context/knowledge-base/capsoftware/cap/-/docs/web-app.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| let video_id = if url_or_id.contains('/') { | ||
| url_or_id | ||
| .rsplit('/') | ||
| .next() | ||
| .unwrap_or(&url_or_id) | ||
| .to_string() | ||
| } else { | ||
| url_or_id | ||
| }; |
There was a problem hiding this comment.
When a copied share URL contains a trailing slash, query string, or fragment, rsplit('/') produces an empty or decorated video ID, causing valid URLs such as https://cap.so/s/abc123/ or https://cap.so/s/abc123?t=30 to fail with a 404.
Knowledge Base Used: Cap CLI (apps/cli)
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/cli/src/recordings.rs
Line: 111-119
Comment:
**Share URL suffix corrupts ID**
When a copied share URL contains a trailing slash, query string, or fragment, `rsplit('/')` produces an empty or decorated video ID, causing valid URLs such as `https://cap.so/s/abc123/` or `https://cap.so/s/abc123?t=30` to fail with a 404.
**Knowledge Base Used:** [Cap CLI (`apps/cli`)](https://app.greptile.com/cap/-/custom-context/knowledge-base/capsoftware/cap/-/docs/cli.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| } | ||
|
|
||
| const meta = (video.metadata as Record<string, any>) ?? {}; | ||
|
|
There was a problem hiding this comment.
Metadata cast discards type safety
Casting persisted metadata to Record<string, any> removes type checking from every returned property, allowing incompatible values and misspelled fields to pass compilation. Use unknown with narrowing or an existing metadata type instead.
Context Used: CLAUDE.md (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/web/app/api/video/metadata/route.ts
Line: 65
Comment:
**Metadata cast discards type safety**
Casting persisted metadata to `Record<string, any>` removes type checking from every returned property, allowing incompatible values and misspelled fields to pass compilation. Use `unknown` with narrowing or an existing metadata type instead.
**Context Used:** CLAUDE.md ([source](https://github.com/capsoftware/cap/blob/main/CLAUDE.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!
| // Rate limit IDs declared in advance for firewall rules or separate app packages | ||
| // that are intentionally not yet wired in apps/web endpoints. |
There was a problem hiding this comment.
Allowlist comments duplicate the code
These comments only narrate the adjacent, self-describing UNWIRED_RATE_LIMIT_IDS declaration and add text that must be maintained without preserving a non-obvious invariant or trade-off.
| // Rate limit IDs declared in advance for firewall rules or separate app packages | |
| // that are intentionally not yet wired in apps/web endpoints. |
Context Used: CLAUDE.md (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/web/__tests__/unit/rate-limit-ids.test.ts
Line: 6-7
Comment:
**Allowlist comments duplicate the code**
These comments only narrate the adjacent, self-describing `UNWIRED_RATE_LIMIT_IDS` declaration and add text that must be maintained without preserving a non-obvious invariant or trade-off.
```suggestion
```
**Context Used:** CLAUDE.md ([source](https://github.com/capsoftware/cap/blob/main/CLAUDE.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!
Fixes #1854
Summary
Display configured hotkeys next to menu item actions inside the desktop tray menubar dropdown menu and refresh the menu dynamically when shortcuts are modified in Settings.
Greptile Summary
The PR adds tray-menu accelerator labels with dynamic refresh, introduces a CLI command and web endpoint for AI video metadata, adds rate limiting to selected endpoints, supports configurable OpenAI-compatible URLs, and adjusts desktop/mobile teleprompter layout behavior.
cap recordings infoand a corresponding video-metadata GET endpoint.OPENAI_BASE_URL.Confidence Score: 2/5
This PR is not safe to merge until the password-protected metadata disclosure and valid share-URL parsing failure are fixed.
The new metadata route exposes AI-derived content without enforcing the existing password gate, while the CLI rejects valid copied share URLs containing common trailing or query components; the remaining comments are non-blocking repository-quality issues.
Files Needing Attention: apps/web/app/api/video/metadata/route.ts, apps/cli/src/recordings.rs
Security Review
The new metadata endpoint bypasses the password gate for public password-protected videos, exposing titles, summaries, chapters, and generation status to unauthenticated callers. How this was verified: The added GET handler returns metadata whenever
video.publicis true and contains no password-cookie or shared video-policy validation.Important Files Changed
Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "feat: display configured keyboard shortc..." | Re-trigger Greptile
Context used (6)
apps/cli)