Files
orangecat/src/components
CatoandClaude Fable 5.1 f67efa8926 fix(cat): a failed "Do it?" card shows the server's sentence, not [object Object] (#1507)
* feat(bots): a bot writes first, on the person's own key

A person can tell one of their bots to write first, every day at a time
they pick, with a prompt they wrote. The run happens on the person's own
OpenRouter key only; without a key the routine is kept, shown as waiting,
and skipped with the reason, so no platform key is ever spent by a timer
(fleet standing rule 2026-09-25).

- companion_routines table (one per person per bot, owner-only RLS),
  routines-store (time validation, next run in the person's zone) and the
  runner behind a cron route + 15-minute systemd timer, registered as a
  person-asked timer in the no-background-ai gate with a marker check.
- GET/PUT/DELETE /api/ai-assistants/[id]/routine for the owner.
- RoutineRow in a bot's own chat: "Writes first, every day", time and
  prompt inline, a line to Settings when a key is missing.
- Hands: the proposal line names what will be set up, never only "Sure";
  a created event's outcome carries its link.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmrXvMqAqZtbpQ4x3et

* feat(bots): a bot can ask Loki, as the person — the first connector

ask_loki: a Cat action (communication, low risk, confirmed) in the hands
launch set. The bot relays a question over the signed OrangeCat → Loki rail
to Loki's POST /api/orangecat/ask, which runs a read-only turn as the Loki
user linked to the actor; Loki's own sentence is the outcome the person
reads, and a refusal (no linked account, a spent budget) is relayed as
written. A relayed question can never dispatch, approve or spend: that stays
with send_task_to_loki, and the two verbs name each other so a question is
never dispatched as a task.

ADR-0013: D6 first connector and D7 recorded as shipped.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmrXvMqAqZtbpQ4x3et

* fix(bots): the routine's day-in-zone comes from the timezone helper

check:app-locale (new on main) refuses a literal locale handed to Intl; the
routine's next-run computation now takes the day in the person's zone from
instantToWallTime, the one rendering the app already trusts.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmrXvMqAqZtbpQ4x3et

* fix(bots): the chip knows the verb of ask_loki

The tool-label table of leading verbs gains ask → Asking / Asked, so the
chip for a bot's question to Loki never falls back to the generic label.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmrXvMqAqZtbpQ4x3et

* fix(cat): a failed "Do it?" card shows the server's sentence, not [object Object]

The confirm and reject hook handed the API's error envelope (an object) to
new Error(), so every failed action read "[object Object]". Seen live the
first time a bot asked Loki for an account not linked to Loki: Loki's
sentence naming the one step was on the action row and lost on the card.
The hook, the memory import and the interests list now read the message
through apiErrorMessage, the reader written for exactly this.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmrXvMqAqZtbpQ4x3et

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 08:24:15 +01:00
..
2026-05-19 15:12:20 +02:00

Components Directory

This directory contains all React components used in the OrangeCat application. Components are organized by feature and type to maintain a clear and scalable structure.

Directory Structure

components/
├── auth/             # Authentication-related components
│   ├── LoginForm.tsx
│   ├── RegisterForm.tsx
│   └── AuthProvider.tsx
├── dashboard/        # Dashboard components
│   ├── StatsCard.tsx
│   ├── ActivityFeed.tsx
│   └── FundingOverview.tsx
├── funding/          # Funding page components
│   ├── DonationForm.tsx
│   ├── ProgressBar.tsx
│   └── FundingCard.tsx
├── profile/          # Profile-related components
│   ├── ProfileHeader.tsx
│   ├── ProfileForm.tsx
│   └── SocialLinks.tsx
└── ui/               # Reusable UI components
    ├── Button.tsx
    ├── Card.tsx
    ├── Input.tsx
    └── Modal.tsx

Component Guidelines

  1. Naming Convention

    • Use PascalCase for component names
    • Suffix with .tsx for TypeScript React components
    • Use descriptive names that reflect the component's purpose
  2. Props

    • Define all props using TypeScript interfaces
    • Use meaningful prop names
    • Document required and optional props
    • Provide default values where appropriate
  3. Styling

    • Use Tailwind CSS for styling
    • Follow the design system guidelines
    • Ensure responsive design
    • Maintain accessibility standards
  4. Testing

    • Each component should have corresponding test files
    • Tests should cover main functionality and edge cases
    • Use React Testing Library for component tests
  5. Documentation

    • Include JSDoc comments for component props
    • Document usage examples
    • Note any dependencies or requirements

Best Practices

  • Keep components small and focused on a single responsibility
  • Use composition over inheritance
  • Implement proper error handling
  • Follow React hooks rules
  • Use memoization when necessary
  • Ensure proper TypeScript typing
  • Maintain consistent code style