Skip to content

Dev#90

Merged
abhishek-nexgen-dev merged 16 commits into
masterfrom
dev
May 12, 2026
Merged

Dev#90
abhishek-nexgen-dev merged 16 commits into
masterfrom
dev

Conversation

@abhishek-nexgen-dev
Copy link
Copy Markdown
Member

No description provided.

Itzzavdheshh and others added 16 commits May 10, 2026 00:12
…for CommDesk

- Introduced FLATPAK_BUILD_GUIDE.md for Flatpak packaging instructions.
- Created FLATPAK_COMMANDS.sh for quick reference commands related to Flatpak.
- Developed PRODUCTION_DEPLOYMENT.md outlining production deployment strategies and CI/CD workflows.
- Established TESTING_AND_QA.md detailing testing architecture, QA workflows, and performance validation.
- Added latest.json for version management and release notes.
- Created org.commdesk.CommDesk.desktop for application integration.
- Included release.pub for update signing with Minisign public key.

Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
feat: Organizer Event-Based Task Management System — CommDesk
@abhishek-nexgen-dev abhishek-nexgen-dev merged commit af8c85e into master May 12, 2026
0 of 2 checks passed
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a comprehensive Task Management system, including full CRUD functionality, a submission and review workflow, and advanced filtering and search capabilities. The implementation covers new pages, hooks, and a suite of reusable UI components like Avatars, Modals, and Toasts, alongside significant updates to the global design tokens and theme configuration. Feedback focuses on improving the robustness of the system by using more reliable unique ID and color generation methods to avoid collisions. Additionally, there are recommendations to enhance accessibility through semantic HTML, improve error handling in asynchronous operations, and optimize React rendering by removing unnecessary timeouts in validation logic.

Comment on lines +21 to +24
function getColor(name: string): string {
const code = name.charCodeAt(0) + (name.charCodeAt(1) || 0);
return BG_COLORS[code % BG_COLORS.length];
}
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.

medium

The color generation logic only considers the first two characters of the name, which leads to frequent color collisions for different names (e.g., "John" and "Joe" would get the same color). A more robust approach is to hash the entire string.

Suggested change
function getColor(name: string): string {
const code = name.charCodeAt(0) + (name.charCodeAt(1) || 0);
return BG_COLORS[code % BG_COLORS.length];
}
function getColor(name: string): string {
const code = name.split("").reduce((acc, char) => acc + char.charCodeAt(0), 0);
return BG_COLORS[code % BG_COLORS.length];
}

Comment on lines +14 to +19
const handleSubmit = async () => {
if (!text.trim()) { setError("Comment cannot be empty."); return; }
setError("");
await addComment.mutateAsync({ taskId, text: text.trim() });
setText("");
};
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.

medium

The handleSubmit function calls mutateAsync without a try-catch block. If the network request fails, the error won't be caught locally to display a meaningful message to the user via the setError state, and it might result in an unhandled promise rejection.

  const handleSubmit = async () => {
    if (!text.trim()) { setError("Comment cannot be empty."); return; }
    setError("");
    try {
      await addComment.mutateAsync({ taskId, text: text.trim() });
      setText("");
    } catch (err) {
      setError("Failed to post comment. Please try again.");
    }
  };

Comment on lines +113 to +117
<div onClick={() => setUseScore((v) => !v)}
className="relative w-8 h-4 rounded-full cursor-pointer transition-colors"
style={{ backgroundColor: useScore ? "var(--cd-primary)" : "var(--cd-surface-3)" }}>
<span className={`absolute top-0.5 w-3 h-3 bg-white rounded-full shadow transition-transform ${useScore ? "translate-x-4" : "translate-x-0.5"}`} />
</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.

medium

Using a div with an onClick handler for a toggle action is not accessible to screen readers or keyboard users. It should be replaced with a semantic button with appropriate ARIA attributes.

            <button
              type="button"
              role="switch"
              aria-checked={useScore}
              onClick={() => setUseScore((v) => !v)}
              className="relative w-8 h-4 rounded-full transition-colors"
              style={{ backgroundColor: useScore ? "var(--cd-primary)" : "var(--cd-surface-3)" }}>
              <span className={`absolute top-0.5 w-3 h-3 bg-white rounded-full shadow transition-transform ${useScore ? "translate-x-4" : "translate-x-0.5"}`} />
            </button>

Comment on lines +375 to +378
const timer = setTimeout(() => {
setErrors(validate({ eventId, title, description, assignedTo, deadline, points: points === "" ? undefined : Number(points) }));
}, 0);
return () => clearTimeout(timer);
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.

medium

The use of setTimeout with a delay of 0 inside useEffect is unnecessary for validation logic in React 18+ and can lead to redundant render cycles. State updates are already batched.

    setErrors(validate({ eventId, title, description, assignedTo, deadline, points: points === "" ? undefined : Number(points) }));

.filter(Boolean) as typeof mockMembers;

const newTask: Task = {
id: `task-${Date.now()}`,
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.

medium

Using Date.now() for ID generation is prone to collisions if multiple items are created in rapid succession. It is safer to use crypto.randomUUID() for unique identifiers.

Suggested change
id: `task-${Date.now()}`,
id: crypto.randomUUID(),

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants