Skip to content

fix: Save channel_name to localStorage from URL parameters#86

Merged
AnnaCodit merged 1 commit intodevfrom
fix-channel-name-storage-17632459648209045697
Mar 17, 2026
Merged

fix: Save channel_name to localStorage from URL parameters#86
AnnaCodit merged 1 commit intodevfrom
fix-channel-name-storage-17632459648209045697

Conversation

@AnnaCodit
Copy link
Copy Markdown
Owner

This change ensures that when channel_name is passed via URL parameters, it is not only used for the current session but also saved to localStorage. This addresses the requirement to persist the settings if the user visits via a specific URL.


PR created automatically by Jules for task 17632459648209045697 started by @AnnaCodit

Co-authored-by: AnnaCodit <173905829+AnnaCodit@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses an issue where the channel_name passed via URL parameters was not being persisted across sessions. The changes ensure that the channel_name is saved to localStorage, allowing users to maintain their settings when revisiting the application via a specific URL.

Highlights

  • Persistence of Channel Name: Ensures that the channel_name parameter passed via URL is saved to localStorage for subsequent sessions.
  • Settings Management: Improves the handling of settings by prioritizing URL parameters and persisting them for future use.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

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 correctly implements saving the channel_name from URL parameters to localStorage to persist it across sessions. I've added one suggestion to simplify the code slightly for better readability and maintainability, without changing the logic.

Comment thread js/settings.js
if (urlChannel) {
localStorage.setItem('channel_name', urlChannel);
}
const storedChannel = urlChannel || localStorage.getItem('channel_name');
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

While the logic is correct, this line is a bit redundant. Since you've just updated localStorage with urlChannel if it exists, you can simplify this by always reading from localStorage. This makes the logic clearer: first update localStorage from the URL if available, then read from localStorage as the single source of truth for the session's setting.

Suggested change
const storedChannel = urlChannel || localStorage.getItem('channel_name');
const storedChannel = localStorage.getItem('channel_name');

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b09ef58188

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread js/settings.js
const storedChannel = urlParams.get('channel_name') || localStorage.getItem('channel_name');
const urlChannel = urlParams.get('channel_name');
if (urlChannel) {
localStorage.setItem('channel_name', urlChannel);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Sanitize URL channel before persisting

Persisting channel_name directly from query params stores malformed values (for example %20foo or trailing spaces) into localStorage, and loadSettings() then treats that value as ready on future visits, which can repeatedly initialize chat with an invalid channel even when the bad URL is no longer present. This regression is introduced by the new persistence path; unlike the manual save flow, this branch does not trim/normalize before saving.

Useful? React with 👍 / 👎.

@AnnaCodit AnnaCodit merged commit 17894ba into dev Mar 17, 2026
@AnnaCodit AnnaCodit deleted the fix-channel-name-storage-17632459648209045697 branch March 18, 2026 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant