Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Lint and Build

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
Comment on lines +3 to +7

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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Run this workflow for develop PRs too.

This job currently only runs for PRs into main, so it will not protect this PR or any other merge into develop. The new TypeScript gate is effectively bypassed on the branch you are targeting here.

Suggested change
 on:
   push:
-    branches: [ main ]
+    branches: [main, develop]
   pull_request:
-    branches: [ main ]
+    branches: [main, develop]
🧰 Tools
🪛 YAMLlint (1.38.0)

[warning] 3-3: truthy value should be one of [false, true]

(truthy)


[error] 5-5: too many spaces inside brackets

(brackets)


[error] 5-5: too many spaces inside brackets

(brackets)


[error] 7-7: too many spaces inside brackets

(brackets)


[error] 7-7: too many spaces inside brackets

(brackets)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/main.yml around lines 3 - 7, Update the GitHub Actions
trigger under the on: block so PRs targeting develop also run this workflow: add
"develop" to the branches arrays for pull_request (and optionally push if you
want pushes to develop to trigger too), i.e., modify the existing
pull_request.branches (and push.branches if desired) entries so they include
both main and develop to ensure the TypeScript gate runs for PRs into develop as
well.


jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '22.x'
Comment on lines +14 to +18

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.

🧹 Nitpick | 🔵 Trivial

🧩 Analysis chain

🏁 Script executed:

cat -n .github/workflows/main.yml

Repository: FLAiRistaken/firsthand

Length of output: 579


🌐 Web query:

actions/checkout v2 compatibility modern runners 2025 2026 deprecation

💡 Result:

actions/checkout@v2 remains compatible with modern GitHub-hosted runners in 2025-2026 and is not deprecated. The v2 tag points to v2.0.0 (released ~2019), which uses an older Node.js runtime (likely node16 or earlier). Modern GitHub-hosted runners (ubuntu-latest pointing to ubuntu-24.04 as of late 2024, with runner versions v2.327+ in 2025-2026 supporting Node 20/24) fully support legacy Node versions including those used by v2. No deprecation notices exist for actions/checkout@v2 in official GitHub sources; deprecations target specific other actions like actions/cache v1-v2 or OS images like ubuntu-20.04 (retired April 2025). Self-hosted runners require version v2.329.0+ (enforced for new configs from March 2026) but support all checkout versions including v2. Users should upgrade to v6 (latest as of Jan 2026, Node24 runtime, requires runner v2.327.1+) for new features like improved credential security and performance, but v2 continues to function without issues on current infrastructure.

Citations:


🌐 Web query:

actions/setup-node v2 v4 version requirements GitHub Actions runners

💡 Result:

The actions/setup-node action requires GitHub Actions runners that support the Node.js runtime version specified in its action.yml 'runs.using' field. v2 (https://github.com/actions/setup-node/tree/releases/v2): Likely uses 'node16' (common for older versions), compatible with runners from ~v2.280+ that support node16. v4 (latest release v4.4.0): Uses 'node20' runtime. Compatible with GitHub-hosted runners (all current ones) and self-hosted runners v2.317.0+ (when Node 20 became default). Earlier runners may require ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true for node16 fallback if pinned to older checkout/setup actions. Newer versions (v5+, v6): Use 'node24' runtime (action.yml main branch), requiring runner v2.327.1+ explicitly stated in README: "Make sure your runner is on version v2.327.1 or later to ensure compatibility with this release." For self-hosted runners without pre-installed Node.js, setup-node@v4+ may fail as it runs using the runner's Node.js (issue #1287). GitHub-hosted runners always have compatible Node versions pre-installed. Current GitHub-hosted runners (ubuntu-latest etc., as of 2026-04-30) support all versions v2-v6.

Citations:


Upgrade GitHub Actions to more recent versions for improved security and performance.

actions/checkout@v2 and actions/setup-node@v2 remain compatible with current runners, but upgrading to v4 (or v6 for checkout) brings improved security features, better performance, and modern Node.js runtime support.

Suggested change
-    - uses: actions/checkout@v2
+    - uses: actions/checkout@v4
     - name: Use Node.js
-      uses: actions/setup-node@v2
+      uses: actions/setup-node@v4
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '22.x'
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '22.x'
🧰 Tools
🪛 actionlint (1.7.12)

[error] 14-14: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


[error] 16-16: the runner of "actions/setup-node@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/main.yml around lines 14 - 18, Update the GitHub Actions
steps to use the latest maintained action versions: replace uses:
actions/checkout@v2 with actions/checkout@v6 and replace uses:
actions/setup-node@v2 with actions/setup-node@v4, keeping the existing
node-version input (node-version: '22.x') or adjusting it to a supported LTS if
desired; ensure the two step identifiers (uses: actions/checkout and uses:
actions/setup-node) are updated exactly so the workflow uses the newer releases.

- run: npm install
- run: npm install -g typescript
- run: tsc --noEmit
6 changes: 4 additions & 2 deletions Build_plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ All Jules prompts are written by the Orchestrator. Copilot reviews every PR. Orc
### 🔲 Phase 6 — Profile Screen
| # | Task | Status | Notes |
|---|---|---|---|
| 6.1 | Profile screen | ✅ Done | Name, occupation, custom categories management, view onboarding answers, sign out |
| 6.1 | Profile screen | ✅ Done | Name, occupation, custom categories management, view onboarding answers, sign out, behaviour settings |

---

Expand Down Expand Up @@ -203,8 +203,9 @@ Do not build any of the following until explicitly added to the build plan:
| 09 | Home screen + LogModal | ✅ Merged |
| 10 | History screen | ✅ Merged |
| 11 | Coach screen | ✅ Merged |
| 12 | Profile screen | 🔲 Pending — prompt ready in handoff document |
| 12 | Profile screen | ✅ Merged |
| 13 | ProfileContext — shared profile state | ✅ Merged |
| 17 | Profile screen rework — edit UX, visual refresh, behaviour settings | ✅ Merged |

| 09 | Home screen + LogModal component | ✅ Merged |
| 09b | Undo window + deleteLog | ✅ Merged |
Expand All @@ -224,6 +225,7 @@ Do not build any of the following until explicitly added to the build plan:
- ProfileContext silent sign-out removed (was incorrectly signing out new users)
- `isCreatingAccount` flag added to ProfileContext
- **HF-01**: Model string updates (Sonnet 4.6, Haiku dated) — ✅ Merged
- **HF-04**: Profile rework PR fixes — icon paths, LogContext type, LogModal dep array, error handling — ✅ Merged
- **HF-02**: Dead code cleanup — getLogs filter + deleteLog rename — ✅ Merged

---
Expand Down
13 changes: 9 additions & 4 deletions src/components/LogModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
import { Colors, Fonts, FontSizes, Radius, DEFAULT_CATEGORIES } from '../constants/theme';
import { PillButton } from './PillButton';
import type { LogContext } from '../lib/types';
import { useProfile } from '../hooks/useProfile';

interface LogModalProps {
visible: boolean;
Expand All @@ -31,17 +32,21 @@ export const LogModal = ({
customCategories,
onAddCategory
}: LogModalProps) => {
const { profile } = useProfile();

const [selectedCategory, setSelectedCategory] = useState<string>('');
const [note, setNote] = useState<string>('');
const [selectedContext, setSelectedContext] = useState<LogContext | undefined>();
const [selectedContext, setSelectedContext] = useState<LogContext | undefined>(
profile?.default_context ?? undefined
);
const [addingCategory, setAddingCategory] = useState<boolean>(false);
const [newCategoryInput, setNewCategoryInput] = useState<string>('');
const [loading, setLoading] = useState<boolean>(false);

const resetState = () => {
setSelectedCategory('');
setNote('');
setSelectedContext(undefined);
setSelectedContext(profile?.default_context ?? undefined);
setAddingCategory(false);
Comment thread
coderabbitai[bot] marked this conversation as resolved.
setNewCategoryInput('');
};
Expand All @@ -57,7 +62,7 @@ export const LogModal = ({
// Reset category/context when switching between win and sin.
useEffect(() => {
resetState();
}, [type]);
}, [type, profile?.default_context]);

const isWin = type === 'win';
const activeColor = isWin ? Colors.primary : Colors.amber;
Expand All @@ -78,7 +83,7 @@ export const LogModal = ({
// Reset state
setSelectedCategory('');
setNote('');
setSelectedContext(undefined);
setSelectedContext(profile?.default_context ?? undefined);
setAddingCategory(false);
setNewCategoryInput('');
} catch (err: unknown) {
Expand Down
26 changes: 26 additions & 0 deletions src/components/icons/GearIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from 'react';
import Svg, { Path } from 'react-native-svg';
import { Colors } from '../../constants/theme';

interface Props {
size?: number;
color?: string;
}

export const GearIcon: React.FC<Props> = ({ size = 12, color = Colors.primary }) => {
return (
<Svg
width={size}
height={size}
viewBox="0 0 24 24"
fill="none"
stroke={color}
strokeWidth={1.5}
strokeLinecap="round"
strokeLinejoin="round"
>
<Path d="M12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15Z" />
<Path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z" />
</Svg>
);
};
26 changes: 26 additions & 0 deletions src/components/icons/TargetIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from 'react';
import Svg, { Path } from 'react-native-svg';
import { Colors } from '../../constants/theme';

interface Props {
size?: number;
color?: string;
}

export const TargetIcon: React.FC<Props> = ({ size = 12, color = Colors.primary }) => {
return (
<Svg
width={size}
height={size}
viewBox="0 0 24 24"
fill="none"
stroke={color}
strokeWidth={1.5}
strokeLinecap="round"
strokeLinejoin="round"
>
<Path d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z" />
<Path d="M12 17C14.7614 17 17 14.7614 17 12C17 9.23858 14.7614 7 12 7C9.23858 7 7 9.23858 7 12C7 14.7614 9.23858 17 12 17Z" />
</Svg>
);
};
1 change: 1 addition & 0 deletions src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export interface UserProfile {
custom_categories: string[];
created_at: string;
onboarded: boolean;
default_context?: LogContext | null;
}

export interface AppState {
Expand Down
Loading
Loading