Skip to content

monobean:refactor codepage related to #1244#1288

Merged
yyk808 merged 12 commits into
gitmono-dev:mainfrom
pleasedontbreak123:main
Jul 30, 2025
Merged

monobean:refactor codepage related to #1244#1288
yyk808 merged 12 commits into
gitmono-dev:mainfrom
pleasedontbreak123:main

Conversation

@pleasedontbreak123

Copy link
Copy Markdown
Contributor

1 refactor codepage
2 move mage setting page to popup
3 auto load png keys

@vercel

vercel Bot commented Jul 30, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mega ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 30, 2025 1:38pm

This comment was marked as outdated.

@genedna
genedna requested a review from yyk808 July 30, 2025 11:34
@genedna genedna added this to the Decentralized Git milestone Jul 30, 2025
yyk808
yyk808 previously requested changes Jul 30, 2025
Comment thread monobean/src/components/hello_page.rs Outdated

Copilot AI left a comment

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.

Pull Request Overview

This PR refactors the codepage interface and restructures the Mega settings tab. The main purpose is to move the Mega settings from an embedded tab to a popup window and enhance the file tree with icon support.

  • Refactored the Mega tab component from an embedded widget to a standalone popup window
  • Enhanced file tree with file type-specific icons for better visual organization
  • Added history list component and UI improvements to the code page with sidebar buttons

Reviewed Changes

Copilot reviewed 18 out of 30 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
monobean/src/window.rs Restructured window layout and moved Mega settings to popup window functionality
monobean/src/components/mega_tab.rs Converted MegaTab from Box widget to standalone Window
monobean/src/components/file_tree.rs Enhanced with file type icons based on file extensions
monobean/src/components/code_page.rs Added sidebar buttons, history list, and file path display
monobean/src/components/history_list.rs New component for displaying commit history
monobean/resources/gtk/mega_tab_window.ui New UI file for the popup Mega settings window
monobean/resources/gtk/window.ui Updated main window layout with bottom status bar
monobean/resources/gtk/code_page.ui Enhanced with sidebar and popover components
Comments suppressed due to low confidence (1)

Comment thread monobean/src/window.rs
use super::*;
use crate::components::code_page::CodePage;
use crate::components::hello_page::HelloPage;
// use crate::components::not_implemented::NotImplemented;

Copilot AI Jul 30, 2025

Copy link

Choose a reason for hiding this comment

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

Remove commented-out import statement that is no longer needed.

Suggested change
// use crate::components::not_implemented::NotImplemented;

Copilot uses AI. Check for mistakes.
Comment thread monobean/src/window.rs
Comment on lines +62 to +65
// #[template_child]
// pub mega_tab: TemplateChild<MegaTab>,
// #[template_child]
// pub repo_tab: TemplateChild<RepoTab>,

Copilot AI Jul 30, 2025

Copy link

Choose a reason for hiding this comment

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

Remove commented-out template_child declarations that are no longer used.

Suggested change
// #[template_child]
// pub mega_tab: TemplateChild<MegaTab>,
// #[template_child]
// pub repo_tab: TemplateChild<RepoTab>,
// Removed unused commented-out template_child declarations for mega_tab and repo_tab.

Copilot uses AI. Check for mistakes.
Comment on lines +58 to +59
// #[template_child]
// pub tree_lines: TemplateChild<gtk::DrawingArea>,

Copilot AI Jul 30, 2025

Copy link

Choose a reason for hiding this comment

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

Remove commented-out template_child declaration for tree_lines that is no longer used.

Suggested change
// #[template_child]
// pub tree_lines: TemplateChild<gtk::DrawingArea>,

Copilot uses AI. Check for mistakes.
let imp = self.imp();
let label = imp.label.get();
let icon = imp.icon.get();
//let tree_line = imp.tree_lines.get();

Copilot AI Jul 30, 2025

Copy link

Choose a reason for hiding this comment

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

Remove commented-out variable declaration that is no longer used.

Suggested change
//let tree_line = imp.tree_lines.get();

Copilot uses AI. Check for mistakes.
#[weak(rename_to=this)]
self,
async move {
timeout_future(Duration::from_millis(1500)).await;

Copilot AI Jul 30, 2025

Copy link

Choose a reason for hiding this comment

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

The hardcoded timeout value of 1500ms should be extracted as a named constant for better maintainability.

Suggested change
timeout_future(Duration::from_millis(1500)).await;
timeout_future(Duration::from_millis(PGP_SETUP_TIMEOUT_MS)).await;

Copilot uses AI. Check for mistakes.
let store = ListStore::new::<HistoryItem>();

for i in 1..=20 {
store.append(&HistoryItem::new(&format!("commit信息 \n 提交人:{i}, sha")));

Copilot AI Jul 30, 2025

Copy link

Choose a reason for hiding this comment

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

This appears to be mock data that should be replaced with actual commit history data.

Copilot uses AI. Check for mistakes.
Comment thread monobean/Cargo.toml
Comment on lines +46 to +47
#once_cell = "1.21.3"

Copilot AI Jul 30, 2025

Copy link

Choose a reason for hiding this comment

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

Remove commented-out dependency that is not being used.

Suggested change
#once_cell = "1.21.3"

Copilot uses AI. Check for mistakes.
Comment thread jupiter/Cargo.toml Outdated
tempfile = { workspace = true }
indexmap = { workspace = true }
url = { workspace = true }
#url = { workspace = true }

Copilot AI Jul 30, 2025

Copy link

Choose a reason for hiding this comment

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

Remove commented-out duplicate dependency declaration.

Suggested change
#url = { workspace = true }

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: pleasedontbreak123 <nabeiyq@126.com>
@yyk808
yyk808 added this pull request to the merge queue Jul 30, 2025
Merged via the queue into gitmono-dev:main with commit c2f93f4 Jul 30, 2025
12 checks passed
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.

4 participants