Skip to content

Commit 9535c1d

Browse files
horia141claude
andauthored
Merged branch feature/better-control-of-adding-from-another-time-plan into develop
* Add kind and feasability filters to add-from-current-time-plans view Adds two filter dropdowns (Kind and Feasability) in the section actions below the Add buttons, allowing users to narrow the displayed activity list before selecting items to carry forward. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VQRJoWqsqsn7Eet8s5EZqU * Hide New Todo button for monthly/quarterly/yearly time plans Mirrors the existing inbox-task guard: the New Todo nav item is now conditionally included only when timePlanAllowsInboxTasks returns true, so longer-period plans don't offer a button that leads to tasks they cannot include. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VQRJoWqsqsn7Eet8s5EZqU --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent bd5b79d commit 9535c1d

2 files changed

Lines changed: 66 additions & 6 deletions

File tree

src/webui/app/routes/app/workspace/time-plans/$id.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -686,11 +686,15 @@ export default function TimePlanView() {
686686
actions={[
687687
NavMultipleCompact({
688688
navs: [
689-
NavSingle({
690-
text: "New Todo",
691-
link: `/app/workspace/todos/new?timePlanReason=for-time-plan&timePlanRefId=${loaderData.timePlan.ref_id}`,
692-
gatedOn: WorkspaceFeature.TODO_TASK,
693-
}),
689+
...(timePlanAllowsInboxTasks(loaderData.timePlan)
690+
? [
691+
NavSingle({
692+
text: "New Todo",
693+
link: `/app/workspace/todos/new?timePlanReason=for-time-plan&timePlanRefId=${loaderData.timePlan.ref_id}`,
694+
gatedOn: WorkspaceFeature.TODO_TASK,
695+
}),
696+
]
697+
: []),
694698
NavSingle({
695699
text: "New Big Plan",
696700
link: `/app/workspace/big-plans/new?timePlanReason=for-time-plan&timePlanRefId=${loaderData.timePlan.ref_id}`,

src/webui/app/routes/app/workspace/time-plans/$id/add-from-current-time-plans/$otherTimePlanId.tsx

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import { LeafPanel } from "@jupiter/core/infra/component/layout/leaf-panel";
3737
import {
3838
ActionMultipleSpread,
3939
ActionSingle,
40+
FilterFewOptionsCompact,
4041
SectionActions,
4142
} from "@jupiter/core/infra/component/section-actions";
4243
import { SectionCard } from "@jupiter/core/infra/component/section-card";
@@ -237,6 +238,14 @@ export default function TimePlanAddFromCurrentTimePlans() {
237238
new Set<string>(),
238239
);
239240

241+
const [filterKind, setFilterKind] = useState<TimePlanActivityKind | null>(
242+
null,
243+
);
244+
const [
245+
filterFeasability,
246+
setFilterFeasability,
247+
] = useState<TimePlanActivityFeasability | null>(null);
248+
240249
const otherTargetInboxTasksByRefId = new Map<string, InboxTask>(
241250
loaderData.otherTargetInboxTasks.map((it) => [it.ref_id, it]),
242251
);
@@ -254,7 +263,7 @@ export default function TimePlanAddFromCurrentTimePlans() {
254263
// otherTimeEventsByRefId.set(`bp:${e.big_plan.ref_id}`, e.time_events);
255264
// }
256265

257-
const filteredOtherActivities = filterActivitiesByTargetStatus(
266+
const filteredOtherActivitiesByStatus = filterActivitiesByTargetStatus(
258267
loaderData.otherActivities,
259268
otherTargetInboxTasksByRefId,
260269
otherTargetBigPlansByRefId,
@@ -264,6 +273,11 @@ export default function TimePlanAddFromCurrentTimePlans() {
264273
!isTimePlanActivityInboxTaskTarget(activity.target) ||
265274
timePlanAllowsInboxTasks(loaderData.mainTimePlan),
266275
);
276+
const filteredOtherActivities = filteredOtherActivitiesByStatus.filter(
277+
(activity) =>
278+
(filterKind === null || activity.kind === filterKind) &&
279+
(filterFeasability === null || activity.feasability === filterFeasability),
280+
);
267281
const sortedOtherActivities = sortTimePlanActivitiesNaturally(
268282
filteredOtherActivities,
269283
otherTargetInboxTasksByRefId,
@@ -301,6 +315,48 @@ export default function TimePlanAddFromCurrentTimePlans() {
301315
}),
302316
],
303317
}),
318+
FilterFewOptionsCompact(
319+
"Kind",
320+
null,
321+
[
322+
{
323+
value: null,
324+
text: "All",
325+
},
326+
{
327+
value: TimePlanActivityKind.FINISH,
328+
text: "Finish",
329+
},
330+
{
331+
value: TimePlanActivityKind.MAKE_PROGRESS,
332+
text: "Make Progress",
333+
},
334+
],
335+
(selected) => setFilterKind(selected),
336+
),
337+
FilterFewOptionsCompact(
338+
"Feasability",
339+
null,
340+
[
341+
{
342+
value: null,
343+
text: "All",
344+
},
345+
{
346+
value: TimePlanActivityFeasability.MUST_DO,
347+
text: "Must Do",
348+
},
349+
{
350+
value: TimePlanActivityFeasability.NICE_TO_HAVE,
351+
text: "Nice To Have",
352+
},
353+
{
354+
value: TimePlanActivityFeasability.STRETCH,
355+
text: "Stretch",
356+
},
357+
],
358+
(selected) => setFilterFeasability(selected),
359+
),
304360
]}
305361
/>
306362
}

0 commit comments

Comments
 (0)